1.34.16.2 RTC_AlarmSet Function

C

bool RTC_AlarmSet( struct tm *alarmTime, RTC_ALARM_MASK mask );

Summary

Sets up the Alarm

Description

This function is used to set up the alarm time and Alarm mask based on user input.

Precondition

None

Parameters

Param Description
alarmTime Alarm Time
mask Alarm mask to be used for notification

Returns

True if Valid Alarm Time and/or Date is configured, False otherwise.

Example

struct tm alarmTime;
//Hour
alarmTime.tm_hour = 12;
//second
alarmTime.tm_sec = 0;
//Minute
alarmTime.tm_min = 34;
//Month
alarmTime.tm_mon = 11;
//Year
alarmTime.tm_year = 2017;
//day of the month
alarmTime.tm_mday = 14;
//set up alarm for every month
RTC_AlarmSet( &alarmTime, RTC_ALARM_MASK_DDHHMISS );

Remark

The structure can be deleted once the API returns to free up the memory