RTC-driven framework in C/SRC/LIB/LIBBSP/SHARED/TOD.C, most of the functionality has been implemented, the entry function is Rtc_initialize (), BSP to achieve very few things.
Beagle implementation in C/SRC/LIB/LIBBSP/ARM/BEAGLE/RTC.C, provides a rtc_tbl rtc_table[] array, the size of the array is stored in the Rtc_count global variable, each RTC_ The table element is a possible RTC chip, and Rtc_initialize () invokes the probe function of each rtc_table element, and the first element that returns true is the system's RTC device. This is achieved in order to facilitate compatible products of different models of the motherboard (for example, the RTC chip discontinued, replaced by another RTC chip).
rtc_table element (RTC Device)
The RTC device must RTC_FNS 3 functions in a struct:
- Initialize: Turn on the RTC device Clock, set the bus access mode, etc.
- READ: Read time from RTC device
- Write: Put the time device into the RTC device
Rtc_initialize Call
The rtc_driver_table_entry is defined in the cpukit/libcsupport/include/rtc.h, and if the final application requires RTC, it can be configured with the Cpukit/sapi/include/confdefs.h Included in the _io_driver_address_table.
Rtems 4.11 RTC Driver (ARM, beagle)