Kinetis SDK v.1.2 API Reference Manual  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages

This section describes the programming interface of the IRTC HAL driver. The IRTC HAL driver initializes the IRTC registers and provides functions to read or modify the IRTC registers. These are mostly invoked by the IRTC Peripheral driver.

IRTC Initialization

This function initiates a soft-reset of the IRTC module to reset the IRTC registers and configure IRTC according to user settings. It doesn't un-gate the IRTC clock.

IRTC Setting and reading the IRTC time

The HAL driver provides IRTC_HAL_SetDatetime() and IRTC_HAL_GetDatetime() functions to set and read the date and time using an instantiation of the irtc_datetime_t structure. This example describes the structure:

typedef struct IrtcDatetime
{
uint16_t year;
uint16_t month;
uint16_t day;
uint16_t weekDay;
uint16_t hour;
uint16_t minute;
uint16_t second;

IRTC Setting and reading the Alarm

The HAL driver provides IRTC_HAL_SetAlarm() and IRTC_HAL_GetAlarm() functions to set an alarm and read back the alarm time.