RTCC.getTime

Name

 * RTCC.getTime

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

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
rtccTime RTCC.getTime(void)


 * Parameters:
 * [None]


 * Returns/Output:
 * the current time value read from the RTC Time Value Register (RTCTIME) in bcd format in data type rtccTime, which is defined as :-

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; To be used the returned value will probably need to be converted from BCD to a decimal format using RTCC.convertTime.