hello
I need help to understand following RTC API.
look part of program
how to use that API in program ? and also tell me If I want to set multiple alarm . what I have to do ?
I need help to understand following RTC API.
Code:
void RTC_SetAlarmDateAndTime(const RTC_date_time * alarmTime)
Description: Writes the time and date values as current alarm time and date.
Parameters: alarmTime: Pointer to the RTC_date_time global structure where new values of alarm time and date are stored .
Return Value: None
Void RTC GateAlarmDateAndTime (RTC_date_time*alarmTimeDate)
Description:
Reads the current alarm time and date.
Parameters:
alarmTimeDate: Pointer to the RTC_date_time structure in which alarm date and time are returned.
Return Value: None
Code:
#include <project.h>
#include <stdio.h>
/* Alarm Time: 15:44:00 */
#define ALARM_HOUR (0x04u)
#define ALARM_MIN (0x01u)
#define ALARM_SEC (0x30u)
#define ALARM_TIME_HR_MIN_SEC ((uint32)(ALARM_HOUR << HOUR_OFFSET) | \
(uint32)(ALARM_MIN << MIN_OFFSET) | \
ALARM_SEC)
/* alarm Date: 03/22/2016 */
#define ALARM_MONTH (RTC_MARCH)
#define ALARM_DAY (0x22u)
#define ALARM_YEAR (0x2016u)
#define ALARM_MONTH_DAY_YEAR ((uint32)(DATE_MONTH << RTC_MONTH_OFFSET) | \
(uint32)(DATE_DAY << RTC_DAY_OFFSET) | \
DATE_YEAR)
/* Set Alarm Date and Time */
RTC_SetAlarmDateAndTime(&alarmTimeDate);
/* Enable global interrupts */
CyGlobalIntEnable;
while(1)
{
/* Get Date and Time from RTC */
time = RTC_GetTime();
date = RTC_GetDate();
how to use that API in program ? and also tell me If I want to set multiple alarm . what I have to do ?