15.9.1.3.1 Workflow
- Start an infinite loop, to continuously poll for a RTC alarm match.
while
(
true
) {
- Check to see if a RTC alarm match has occurred.
if
(rtc_calendar_is_alarm_match(&rtc_instance, RTC_CALENDAR_ALARM_0)) {
- Once an alarm match occurs, perform the desired user action.
/* Do something on RTC alarm match here */
port_pin_toggle_output_level(LED_0_PIN);
- Clear the alarm match, so that future alarms may occur.
rtc_calendar_clear_alarm_match(&rtc_instance, RTC_CALENDAR_ALARM_0);