Alarm

group group_rtc_alarm_functions

Functions

cy_en_rtc_status_t Cy_RTC_SetAlarmDateAndTime(cy_stc_rtc_alarm_t const *alarmDateTime, cy_en_rtc_alarm_t alarmIndex)

Sets alarm time and date values into the ALMx_TIME and ALMx_DATE registers.

note

The function may return CY_RTC_INVALID_STATE if the RTC is busy with previous update. In such situation, user should call this function repetitively with appropriate parameters to ensure that RTC is updated with provided arguments.

Return

A validation check result of date and month. Returns an error, if the date range is invalid. See cy_en_rtc_status_t.

Parameters

void Cy_RTC_GetAlarmDateAndTime(cy_stc_rtc_alarm_t *alarmDateTime, cy_en_rtc_alarm_t alarmIndex)

Returns the current alarm time and date values from the ALMx_TIME and ALMx_DATE registers.

Parameters

cy_en_rtc_status_t Cy_RTC_SetAlarmDateAndTimeDirect(uint32_t sec, uint32_t min, uint32_t hour, uint32_t date, uint32_t month, cy_en_rtc_alarm_t alarmIndex)

Sets alarm time and date values into the ALMx_TIME and ALMx_DATE registers using direct time parameters.

ALM_DAY_EN is default 0 (=ignore) for this function.

Return

A validation check result of date and month. Returns an error, if the date range is invalid. See cy_en_rtc_status_t.

Parameters
  • sec: The alarm second valid range is [0-59].

  • min: The alarm minute valid range is [0-59].

  • hour: The valid range is [0-23]. This parameter type is always in the 24-hour type. This function reads the current 12/24-hour mode, then converts the hour value properly as the mode.

  • date: The valid range is [1-31], if the month of February is selected as the Month parameter, then the valid range is [0-29].

  • month: The alarm month valid range is [1-12].

  • alarmIndex: The alarm index to be configured, see cy_en_rtc_alarm_t.