15.9.1.3.1 Workflow

  1. Start an infinite loop, to continuously poll for a RTC alarm match.
    while (true) {
    
  2. Check to see if a RTC alarm match has occurred.
    if (rtc_calendar_is_alarm_match(&rtc_instance, RTC_CALENDAR_ALARM_0)) {
    
  3. 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);
    
  4. Clear the alarm match, so that future alarms may occur.
    rtc_calendar_clear_alarm_match(&rtc_instance, RTC_CALENDAR_ALARM_0);