Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

RTC API

Status
Not open for further replies.

Parth86

Member
hello

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
look part of program

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 ?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top