AnsweredAssumed Answered

Independent Real Time Clock (IRTC) for KW40Z Connectivity

Question asked by Lucian Firan on Feb 7, 2017
Latest reply on Feb 16, 2017 by Jorge Antonio Alcala Vazquez

IAR 7.50;  KW40Z_Connectivity_Software_1.0.1 (KSDK_1.3.0)

 

In Kinetis SDK v.1.3 API Reference Manual, Document Number: KSDK13APIRM Rev. 0 Sept 2015

There is a reference about IRTC

Chapter 29  Independent Real Time Clock (IRTC)
29.1 Overview
The Kinetis SDK provides both HAL and Peripheral drivers for the Independent Real Time Clock (IRTC)
block of Kinetis devices.

28.10 IRTC HAL driver
28.10.1 Overview
28.11 IRTC Peripheral Driver
28.11.1 Overview

 

The files can be found in KSDK platform release:

KSDK_1.3.0\platform\hal\src\irtc\fsl_irtc_hal.c
KSDK_1.3.0\platform\hal\inc\fsl_irtc_hal.h

 

But are not integrated (are missing) in Connectivity framework release:

KW40Z_Connectivity_Software_1.0.1\KSDK_1.3.0\platform\hal\src
KW40Z_Connectivity_Software_1.0.1\KSDK_1.3.0\platform\hal\inc

 

Can these IRTC drivers be used for MKW30Z with the Connectivity Software 1.0.1 ?

Should additional set-up be done for that ?

The IRTC lib is fully supported by this framework ?

 

Examples:

irtc_datetime_t datetimeToSet;


IRTC_DRV_Init(0);


datetimeToSet.
year = 2013;
datetimeToSet.
month = 10;
datetimeToSet.
day = 13;
datetimeToSet.
hour = 18;
datetimeToSet.
minute = 55;
datetimeToSet.
second = 30;


// set the datetime //
result = IRTC_DRV_SetDatetime(0, &datetime);


// get datetime //
IRTC_DRV_GetDatetime(0, &datetime);
printf(
"Current datetime: %04hd-%02hd-%02hd %02hd:%02hd:%02hdnrnn",
datetime.year, datetime.month, datetime.day, datetime.hour, datetime.minute, datetime.second);

 

// alarm set //

alrmTimeToSet.year = datetimeToSet.year;
alrmTimeToSet.
month = datetimeToSet.month;
alrmTimeToSet.
day = datetimeToSet.day;
alrmTimeToSet.
minute = datetimeToSet.minute + 5;
alrmTimeToSet.
second = datetimeToSet.second;
IRTC_DRV_SetAlarm(0, &alrmTimeToSet);
IRTC_DRV_SetAlarmMatchMode(0, kIRTCSecMinHourDayMonYear);
IRTC_HAL_SetIntCmd(0, kIRTCAlarmIntFlag);

 

Best Regards,

Lucian.

Outcomes