DST functions

group group_rtc_dst_functions

Functions

cy_en_rtc_status_t Cy_RTC_EnableDstTime(cy_stc_rtc_dst_t const *dstTime, cy_stc_rtc_config_t const *timeDate)

The function sets the DST time and configures the ALARM2 interrupt register with the appropriate DST time.

This function sets the DST stop time if the current time is already in the DST period. The DST period is a period of time between the DST start time and DST stop time. The DST start time and DST stop time is presented in the DST configuration structure, see cy_stc_rtc_dst_t.

Return

cy_en_rtc_status_t A validation check result of RTC register update.

Parameters
  • dstTime: The DST configuration structure, see cy_stc_rtc_dst_t.

  • timeDate: The time and date structure. The the appropriate DST time is set based on this time and date, see cy_stc_rtc_config_t.

cy_en_rtc_status_t Cy_RTC_SetNextDstTime(cy_stc_rtc_dst_format_t const *nextDst)

A low-level DST function sets ALARM2 for a next DST event.

If Cy_RTC_GetDSTStatus() is true(=1), the next DST event should be the DST stop, then this function should be called with the DST stop time. Used by the Cy_RTC_EnableDstTime and Cy_RTC_DstInterrupt functions.

If the time format(.format) is relative option(=0), the RelativeToFixed() is called to convert to a fixed date.

Return

A validation check result of RTC register update. See cy_en_rtc_status_t.

Parameters
  • nextDst: The structure with time at which a next DST event should occur (ALARM2 interrupt should occur). See cy_stc_rtc_config_t.

bool Cy_RTC_GetDstStatus(cy_stc_rtc_dst_t const *dstTime, cy_stc_rtc_config_t const *timeDate)

A low-level DST function returns the current DST status using given time information.

This function is used in the initial state of a system. If the DST is enabled, the system sets the DST start or stop as a result of this function. Used by the Cy_RTC_EnableDstTime and Cy_RTC_DstInterrupt functions.

Return

False - The current date and time is out of the DST period. True - The current date and time is in the DST period.

Parameters
  • dstTime: The DST configuration structure, see cy_stc_rtc_dst_t.

  • timeDate: The time and date structure. The the appropriate DST time is set based on this time and date, see cy_stc_rtc_config_t.