cancel
Showing results for 
Search instead for 
Did you mean: 

How can I set RTC alarm value ?

antonius
Senior
Posted on January 26, 2014 at 09:48

Guys,

How can I set the value for RTC alarm ?

I want to set on Sunday, 26 January 2014 20:35

I can see only one integer value, do I need to convert from date time to integer ?

Any ideas ? thanks

Code :

/**

  * @brief  Sets the RTC alarm value.

  * @param  AlarmValue: RTC alarm new value.

  * @retval None

  */

void RTC_SetAlarm(uint32_t AlarmValue)

{  

  RTC_EnterConfigMode();

  /* Set the ALARM MSB word */

  RTC->ALRH = AlarmValue >> 16;

  /* Set the ALARM LSB word */

  RTC->ALRL = (AlarmValue & RTC_LSB_MASK);

  RTC_ExitConfigMode();

}
0 REPLIES 0