C Programming Example
#include <conio.h> #include "rtc_api.h"
void main() {
TimeSave_T *ts = (TimeSave_T *) malloc(sizeof(TimeSave_T)); GetTime_T *time = (GetTime_T *) malloc(sizeof(GetTime_T));
unsigned int battery; unsigned int address;
cprintf("Demo
address = Start_RTC_API(0); if (address) {
if (Get_RTC_Time(time))
cprintf(“RTC time: %u:%u:%u.%u\r\n”,
if (Last_Power_Down_RTC(ts))
cprintf("Last Power Down (Reset): %.2u/%.2u at %u:%.2u:%.2u\r\n",
if (Battery_RTC()) cprintf("Battery Status: Good\r\n");
else cprintf("Battery Status: Low\r\n");
}else cprintf("Device Driver (PCRTCDD.SYS) must be installed.\r\n"); free(ts);
free(time);
}
Documentation Number PCRTC2095 Manual | 11 |
B&B Electronics
PH (815)