/* Enables or Disables the RTC TimeStamp functionality with the specified time stamp pin stimulating edge.  */
void RTC_TimeStampCmd(uint32_t RTC_TimeStampEdge, FunctionalState NewState)
/* Enables or Disables the RTC TimeStamp functionality with the specified time stamp pin stimulating edge.  */
void RTC_TimeStampCmd(uint32_t RTC_TimeStampEdge, FunctionalState NewState)
{
  uint32_t tmpreg = 0;
  assert_param(IS_RTC_TIMESTAMP_EDGE(RTC_TimeStampEdge));
  assert_param(IS_FUNCTIONAL_STATE(NewState));
  tmpreg = (uint32_t)(RTC->CR & (uint32_t)~(RTC_CR_TSEDGE | RTC_CR_TSE));
  if (NewState != DISABLE)
  {
    tmpreg |= (uint32_t)(RTC_TimeStampEdge | RTC_CR_TSE);
  }
  else
  {
    tmpreg |= (uint32_t)(RTC_TimeStampEdge);
  }
  RTC->WPR = 0xCA;
  RTC->WPR = 0x53;
  RTC->CR = (uint32_t)tmpreg;
  RTC->WPR = 0xFF;
}