Real Time Clock

Joel Sherrill joel.sherrill at OARcorp.com
Mon May 11 11:19:05 UTC 2009


Sebastian Huber wrote:
> Hi,
>
> I tried to write a shell command to read and set the real time clock (RTC).
> Unfortunately this is currently impossible to achieve within the cpukit.  One
> solution would be to extend the default RTC driver interface in
> cpukit/libcsupport/include/rtc.h:
>
> #define RTC_DEVICE_NAME "/dev/rtc"
>
> #define RTC_DRIVER_TABLE_ENTRY \
>   { rtc_initialize, NULL, NULL, rtc_read, rtc_write, NULL }
>
> rtems_device_driver rtc_initialize(
>   rtems_device_major_number,
>   rtems_device_minor_number,
>   void *
> );
>
> rtems_device_driver rtc_read(
>   rtems_device_major_number,
>   rtems_device_minor_number,
>   void *
> );
>
> rtems_device_driver rtc_write(
>   rtems_device_major_number,
>   rtems_device_minor_number,
>   void *
> );
>
> The read and write function would read or set the RTC with a rtems_time_of_day
> structure argument.
>   

There are a few other IOCTL-type methods in the "RTC library
driver".

I don't have a problem with adding some more standard interfaces
to the driver.  It should be possible to do it in a way that doesn't
impact any existing BSP or application.

Propose away.

> Have a nice day!
>
>   




More information about the users mailing list