STM32F2 Standard Peripheral bibliotheek  1.0
ST Microelectronics bibliotheek documentatie voor de STM32F2 Standard Peripheral Library
 All Data Structures Files Functions Variables Enumerations Enumerator Groups
Alarms configuration functions

Alarms (Alarm A and Alarm B) configuration functions. More...

Functions

void RTC_SetAlarm (uint32_t RTC_Format, uint32_t RTC_Alarm, RTC_AlarmTypeDef *RTC_AlarmStruct)
 Set the specified RTC Alarm. More...
 
void RTC_AlarmStructInit (RTC_AlarmTypeDef *RTC_AlarmStruct)
 Fills each RTC_AlarmStruct member with its default value (Time = 00h:00mn:00sec / Date = 1st day of the month/Mask = all fields are masked). More...
 
void RTC_GetAlarm (uint32_t RTC_Format, uint32_t RTC_Alarm, RTC_AlarmTypeDef *RTC_AlarmStruct)
 Get the RTC Alarm value and masks. More...
 
ErrorStatus RTC_AlarmCmd (uint32_t RTC_Alarm, FunctionalState NewState)
 Enables or disables the specified RTC Alarm. More...
 

Detailed Description

Alarms (Alarm A and Alarm B) configuration functions.

 ===============================================================================
              Alarms (Alarm A and Alarm B) configuration functions
 ===============================================================================  

  This section provide functions allowing to program and read the RTC Alarms.

Function Documentation

ErrorStatus RTC_AlarmCmd ( uint32_t  RTC_Alarm,
FunctionalState  NewState 
)

Enables or disables the specified RTC Alarm.

Parameters
RTC_Alarm,:specifies the alarm to be configured. This parameter can be any combination of the following values:
  • RTC_Alarm_A: to select Alarm A
  • RTC_Alarm_B: to select Alarm B
NewState,:new state of the specified alarm. This parameter can be: ENABLE or DISABLE.
Return values
AnErrorStatus enumeration value:
  • SUCCESS: RTC Alarm is enabled/disabled
  • ERROR: RTC Alarm is not enabled/disabled
void RTC_AlarmStructInit ( RTC_AlarmTypeDef RTC_AlarmStruct)

Fills each RTC_AlarmStruct member with its default value (Time = 00h:00mn:00sec / Date = 1st day of the month/Mask = all fields are masked).

Parameters
RTC_AlarmStruct,:pointer to a RTC_AlarmTypeDef structure which will be initialized.
Return values
None
void RTC_GetAlarm ( uint32_t  RTC_Format,
uint32_t  RTC_Alarm,
RTC_AlarmTypeDef RTC_AlarmStruct 
)

Get the RTC Alarm value and masks.

Parameters
RTC_Format,:specifies the format of the output parameters. This parameter can be one of the following values:
  • RTC_Format_BIN: Binary data format
  • RTC_Format_BCD: BCD data format
RTC_Alarm,:specifies the alarm to be read. This parameter can be one of the following values:
  • RTC_Alarm_A: to select Alarm A
  • RTC_Alarm_B: to select Alarm B
RTC_AlarmStruct,:pointer to a RTC_AlarmTypeDef structure that will contains the output alarm configuration values.
Return values
None
void RTC_SetAlarm ( uint32_t  RTC_Format,
uint32_t  RTC_Alarm,
RTC_AlarmTypeDef RTC_AlarmStruct 
)

Set the specified RTC Alarm.

Note
The Alarm register can only be written when the corresponding Alarm is disabled (Use the RTC_AlarmCmd(DISABLE)).
Parameters
RTC_Format,:specifies the format of the returned parameters. This parameter can be one of the following values:
  • RTC_Format_BIN: Binary data format
  • RTC_Format_BCD: BCD data format
RTC_Alarm,:specifies the alarm to be configured. This parameter can be one of the following values:
  • RTC_Alarm_A: to select Alarm A
  • RTC_Alarm_B: to select Alarm B
RTC_AlarmStruct,:pointer to a RTC_AlarmTypeDef structure that contains the alarm configuration parameters.
Return values
None