1. 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.
    Dismiss Notice

RTC API

Discussion in 'ARM' started by Parth86, Aug 27, 2015.

  1. Parth86

    Parth86 Member

    Joined:
    Dec 25, 2011
    Messages:
    515
    Likes:
    5
    hello

    I need help to understand following RTC API.
    Code (text):
    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 (text):
    #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 ?
     

Share This Page