RTCC.getDate

Name

 * RTCC.getDate

Description
Gets the date of the Real Time Clock and Calendar (RTCC) by reading the value from the RTC Date Value Register (RTCDATE).

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
rtccDate RTCC.getDate(void)


 * Parameters:
 * [None]


 * Returns/Output:
 * the current date value read from the RTC Date Value Register (RTCDATE) in bcd format in data type rtccDate, which is defined as :-

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-12 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;

To be used the returned value will probably need to be converted from BCD to a decimal format using RTCC.convertDate.