RTCC.getAlarmTimeDate

Name

 * RTCC.getAlarmTimeDate

Description
Gets the alarm time and alarm date of the Real Time Clock and Calendar (RTCC) by reading the values from the Alarm Time Value Register (ALRMTIME) and the Alarm Date Value Register (ALRMDATE).

Note: that the behaviour of the RTCC Alarm is dependent not only on the values in the Alarm Time Value Register (ALRMTIME) and in the Alarm Date Value Register (ALRMDATE) but also the values in the RTC Alarm Control Register (RTCALRM) which are determined by other settings including the various RTCC.AlarmRepeat~ functions.

Only works for 32-bit Pinguinos with a 32,768 kHz quartz crystal which allows the use of the built-in RTCC functionality of the PIC32, such as the Olimex PIC32 Pinguino OTG.

Syntax
void RTCC.getAlarmTimeDate(rtccTime * pTm, rtccDate * pDt)


 * Parameters:
 * pTm = a pointer to a variable of data type rtccTime (see below)
 * pDt = a pointer to a variable of data type rtccDate (see below)
 * Returns/Output:
 * the current alarm time value read from the Alarm Time Value Register (ALRMTIME) in bcd format and the current alarm date value read from the Alarm Date Value Register (ALRMDATE) in bcd format are loaded into the variables identified by the pointers pTm and pDt respectively. These variables should have data types rtccTime and rtccDate respectively. The data type definitions for data types rtccTime and rtccDate are given below.

Unlike the RTCDATE Register the ALRMDATE Register does not have a location implemented for year and the year will always be read as 00.

To be used the returned values will probably need to be converted from BCD to a decimal format using RTCC.convertTime and RTCC.convertDate respectively.

Data type definition for rtccTime

typedef union { 	struct { 		unsigned char	rsvd;	// reserved for future use. should be 0 unsigned char	sec;	// BCD codification for seconds, 00-59 unsigned char	min;	// BCD codification for minutes, 00-59 unsigned char	hour;	// BCD codification for hours,  00-24 };				// field access unsigned char		b[4];	// byte access unsigned short		w[2];	// 16 bits access unsigned long		l;	// 32 bits access }rtccTime;

Data type definition for rtccDate

typedef union { 	struct { 		unsigned char	wday;	// BCD codification for day of the week, 00-06 unsigned char	mday;	// BCD codification for day of the month, 01-31 unsigned char	mon;	// BCD codification for month, 01-12D unsigned char	year;	// BCD codification for years, 00-99 };				// field access unsigned char		b[4];	// byte access unsigned short		w[2];	// 16 bits access unsigned long		l;	// 32 bits access }rtccDate;