Rtc function, 9 rtc function – Solvline Eddy DK User Manual
Page 121
Eddy DK Programmer Guide
121
6.9 RTC Function
Eddy CPU provides separate RTC(Real Time Clock) in DK.
Date and time can be configured through program or with Date and rdate provided by Busybox.
Sample program ‚Eddy_Apps/test_rtc.c‛ uses RTC device so users can refer to this source for developing
programs.
RTC_SET_TIME
Function
Configures date and time in RTC device
Format
void ioctl(int fd, RTC_SET_TIME, struct tm *tm);
Parameter
fd
Handle to RTC device(‚/dev/rtc0‛)
tm
Pointer to struct that stores date and time to be
configured. Compatible with struct tm for Linux
standard time interface.
Returns
None
Notice
RTC_RD_TIME
Function
Reads date and time from RTC device
Format
void ioctl(int fd, RTC_RD_TIME, struct tm *tm);
Parameter
fd
Handle to RTC device(‚/dev/rtc0‛)
tm
Pointer to struct that will store date and time read.
Compatible with struct tm for Linux standard time
interface.
Returns
None
Notice