/* Enables or Disables the RTC TimeStamp functionality with the specified time stamp pin stimulating edge.  */
void RTC_EnableTimeStamp(uint32_t RTC_TimeStampEdge, FunctionalState Cmd)
/* Enables or Disables the RTC TimeStamp functionality with the specified time stamp pin stimulating edge.  */
void RTC_EnableTimeStamp(uint32_t RTC_TimeStampEdge, FunctionalState Cmd)
{
    uint32_t tmpregister = 0;
    assert_param(IS_RTC_TIMESTAMP_EDGE_MODE(RTC_TimeStampEdge));
    assert_param(IS_FUNCTIONAL_STATE(Cmd));
    tmpregister = (uint32_t)(RTC->CTRL & (uint32_t) ~(RTC_CTRL_TEDGE | RTC_CTRL_TSEN));
    if (Cmd != DISABLE)
    {
       tmpregister |= (uint32_t)(RTC_TimeStampEdge | RTC_CTRL_TSEN);
    }
    else
    {
       tmpregister |= (uint32_t)(RTC_TimeStampEdge);
    }
    RTC->WRP = 0xCA;
    RTC->WRP = 0x53;
    RTC->CTRL = (uint32_t)tmpregister;
    RTC->WRP = 0xFF;
}