STM8L15x Standard Peripherals Drivers: Alarms configuration functions

STM8L15x/16x Standard Peripherals Drivers

STM8L15x Standard Peripherals Drivers

Alarms configuration functions

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

Functions

ErrorStatus RTC_AlarmCmd (FunctionalState NewState)
 Enables or disables the RTC Alarm.
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).
ErrorStatus RTC_AlarmSubSecondConfig (uint16_t RTC_AlarmSubSecondValue, RTC_AlarmSubSecondMask_TypeDef RTC_AlarmSubSecondMask)
 Configure the RTC Alarm Subseconds value and mask.
void RTC_GetAlarm (RTC_Format_TypeDef RTC_Format, RTC_AlarmTypeDef *RTC_AlarmStruct)
 Gets the RTC Alarm configuration.
void RTC_SetAlarm (RTC_Format_TypeDef RTC_Format, RTC_AlarmTypeDef *RTC_AlarmStruct)
 Sets the RTC Alarm configuration.

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 ( FunctionalState  NewState)

Enables or disables the RTC Alarm.

Parameters:
NewState,:new state of the 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

Definition at line 1236 of file stm8l15x_rtc.c.

References __IO, ALRAWF_TIMEOUT, DISABLE, ERROR, IS_FUNCTIONAL_STATE, RESET, RTC, RTC_CR2_ALRAE, RTC_ISR1_ALRAWF, and SUCCESS.

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

Definition at line 1159 of file stm8l15x_rtc.c.

References RTC_AlarmTypeDef::RTC_AlarmDateWeekDay, RTC_AlarmTypeDef::RTC_AlarmDateWeekDaySel, RTC_AlarmDateWeekDaySel_Date, RTC_AlarmTypeDef::RTC_AlarmMask, RTC_AlarmMask_All, RTC_AlarmTypeDef::RTC_AlarmTime, RTC_TimeTypeDef::RTC_H12, RTC_H12_AM, RTC_TimeTypeDef::RTC_Hours, RTC_TimeTypeDef::RTC_Minutes, and RTC_TimeTypeDef::RTC_Seconds.

ErrorStatus RTC_AlarmSubSecondConfig ( uint16_t  RTC_AlarmSubSecondValue,
RTC_AlarmSubSecondMask_TypeDef  RTC_AlarmSubSecondMask 
)

Configure the RTC Alarm Subseconds value and mask.

Parameters:
RTC_AlarmSubSecondValue,:specifies the Subseconds value. This parameter can be a value from 0 to 0x7FFF.
RTC_AlarmSubSecondMask,:specifies the Subseconds Mask. This parameter can be one of the RTC_AlarmSubSecondMask_TypeDef enumeration.
Return values:
AnErrorStatus enumeration value:
  • SUCCESS: Alarm Subseconds value and mask are configured
  • ERROR: Alarm Subseconds value and mask are not configured

Definition at line 1292 of file stm8l15x_rtc.c.

References ERROR, IS_RTC_ALARM_SS_MASK, IS_RTC_ALARM_SS_VALUE, RESET, RTC, RTC_CR2_ALRAE, RTC_ISR1_INITF, and SUCCESS.

void RTC_GetAlarm ( RTC_Format_TypeDef  RTC_Format,
RTC_AlarmTypeDef RTC_AlarmStruct 
)

Gets the RTC Alarm configuration.

Parameters:
RTC_Format,:specifies the format of the entered parameters. This parameter can be one of the RTC_Format_TypeDef enumeration.
RTC_AlarmStruct,:pointer to a RTC_AlarmTypeDef structure that will contain the Alarm configuration information of the RTC.
Return values:
None

Definition at line 1182 of file stm8l15x_rtc.c.

References Bcd2ToByte(), IS_RTC_FORMAT, RTC, RTC_AlarmTypeDef::RTC_AlarmDateWeekDay, RTC_AlarmTypeDef::RTC_AlarmDateWeekDaySel, RTC_AlarmTypeDef::RTC_AlarmMask, RTC_AlarmTypeDef::RTC_AlarmTime, RTC_ALRMAR1_MSK1, RTC_ALRMAR1_ST, RTC_ALRMAR1_SU, RTC_ALRMAR2_MNT, RTC_ALRMAR2_MNU, RTC_ALRMAR2_MSK2, RTC_ALRMAR3_HT, RTC_ALRMAR3_HU, RTC_ALRMAR3_MSK3, RTC_ALRMAR3_PM, RTC_ALRMAR4_DT, RTC_ALRMAR4_DU, RTC_ALRMAR4_MSK4, RTC_ALRMAR4_WDSEL, RTC_Format_BIN, RTC_TimeTypeDef::RTC_H12, RTC_TimeTypeDef::RTC_Hours, RTC_TimeTypeDef::RTC_Minutes, and RTC_TimeTypeDef::RTC_Seconds.

void RTC_SetAlarm ( RTC_Format_TypeDef  RTC_Format,
RTC_AlarmTypeDef RTC_AlarmStruct 
)

Sets the RTC Alarm configuration.

Note:
Before configuring the Alarm settings, the Alarm Unit must be disabled (if enabled) using RTC_AlarmCmd(DISABLE) function.
Parameters:
RTC_Format,:specifies the format of the entered parameters. This parameter can be one of the RTC_Format_TypeDef enumeration.
RTC_AlarmStruct,:pointer to a RTC_AlarmTypeDef structure that contains the Alarm configuration information for the RTC.
Return values:
None.

Definition at line 1038 of file stm8l15x_rtc.c.

References Bcd2ToByte(), ByteToBcd2(), IS_RTC_ALARM_DATEWEEKDAY_SEL, IS_RTC_ALARM_MASK, IS_RTC_DATE_MAX, IS_RTC_DATE_MIN, IS_RTC_FORMAT, IS_RTC_H12, IS_RTC_HOUR12_MAX, IS_RTC_HOUR12_MIN, IS_RTC_HOUR24, IS_RTC_MINUTES, IS_RTC_SECONDS, IS_RTC_WEEKDAY, RESET, RTC, RTC_AlarmTypeDef::RTC_AlarmDateWeekDay, RTC_AlarmTypeDef::RTC_AlarmDateWeekDaySel, RTC_AlarmDateWeekDaySel_WeekDay, RTC_AlarmTypeDef::RTC_AlarmMask, RTC_AlarmMask_DateWeekDay, RTC_AlarmTypeDef::RTC_AlarmTime, RTC_ALRMAR1_MSK1, RTC_ALRMAR2_MSK2, RTC_ALRMAR3_MSK3, RTC_ALRMAR4_MSK4, RTC_CR1_FMT, RTC_Format_BIN, RTC_TimeTypeDef::RTC_H12, RTC_TimeTypeDef::RTC_Hours, RTC_TimeTypeDef::RTC_Minutes, and RTC_TimeTypeDef::RTC_Seconds.

STM8S Firmware Library: Overview

 

 

 

For complete documentation on STM8L15x 8-bit microcontrollers platform visit www.st.com