1.10.20.6 1.11.20.6 1.12.21.6 1.13.19.6 1.14.14.6 1.15.15.6 1.16.21.6 1.17.17.6 1.18.17.6 1.19.17.6 1.20.21.6 1.21.22.6 1.22.23.6 1.23.22.6 1.24.19.6 RTCC_AlarmSet Function
C
bool RTCC_AlarmSet(struct tm *alarmTime, RTC_ALARM_MASK alarmFreq);
Summary
Sets the alarm time and date in the RTCC peripheral.
Description
This functions sets the alarm time and date in the RTCC peripheral.
Precondition
The RTCC_Initialize() function should have been called to initialize the RTCC peripheral.
Parameters
Param | Description |
---|---|
alarmTime | Structure which holds the alarm time and date information. |
alarmFreq | This parameter of type RTC_ALARM_MASK. Used to specify the recurrence of alarm. |
Returns
Always return true. Discard the return value at the application level. This return is to satisfy the function signature requirement of drivers which uses different RTC PLIBs.
Example
struct tm alarm_time; //15-01-2018 12:00:20 Monday alarm_time.tm_hour = 23; alarm_time.tm_min = 59; alarm_time.tm_sec = 55; alarm_time.tm_year = 18; alarm_time.tm_mon = 12; alarm_time.tm_mday = 31; alarm_time.tm_wday = 1; RTCC_AlarmSet(&alarm_time, RTC_ALARM_MASK_SECOND);
Remarks
This function checks RTCSYNC before writing into RTCTIME and RTCDATE registers. Thus no separate check for the bit is needed.