Real Time Clock

Sebastian Huber sebastian.huber at embedded-brains.de
Mon May 11 11:56:33 UTC 2009


Joel Sherrill wrote:
> 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".

Where is the "RTC library driver"?  I don't see more methods except read and
write as mandatory for the standard 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.

Only two driver implement the standard interface from <rtems/rtc.h>:

c/src/lib/libbsp/shared/tod.c
c/src/lib/libcpu/bfin/clock/rtc.c

These two would need an update.

> 
> Propose away.
> 
>> Have a nice day!
>>
>>   
> 


-- 
Sebastian Huber, Embedded Brains GmbH

Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone   : +49 89 18 90 80 79-6
Fax     : +49 89 18 90 80 79-9
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the users mailing list