— eCos Support for the Intersil ISL12028 Real-Time Clock
a device driver for the wallclock device in the Intersil ISL12028
Real-Time Clock chips. These combine a real-time clock, alarm
functionality, and a bank of EEPROM in a single package. The driver
can also be used with any other chips that provide the same interface
to the clock hardware.
The package will usually be loaded into the configuration automatically whenever selecting a target which contains a compatible chip. By default it will provide the standard eCos wallclock device, although another implementation such as software emulation may be selected if desired. The only other configuration options related to this package allow users to change the compiler flags. If the application does not actually use the wallclock device, directly or indirectly, then the code should get removed automatically at link-time to ensure that the application does not suffer any unnecessary overheads.
This wallclock device driver package implements the standard
functionality required by the generic wallclock support
CYGPKG_IO_WALLCLOCK. The functionality is not
normally accessed directly. Instead it is used by the C library time
package to implement standard calls such as
gmtime. The eCos C library also provides a
changing the current wallclock setting. In addition RedBoot provides
a date command which interacts with the wallclock
The driver does not provide direct access to any of the other functionality provided by the chip. Instead if an application wishes to access the alarms or the EEPROM memory then it can do so itself, via the generic I²C API. However any such application code does need to synchronize with the wallclock driver to prevent concurrent accesses to the device. The driver exports a mutex lock to allow for this:
#include <cyg/io/wallclock/isl12028.h> extern cyg_drv_mutex_t cyg_isl12028_lock;
The mutex should be locked via
to prevent the wallclock driver from accessing the chip, and then
cyg_drv_mutex_unlock when the driver
can safely access the chip again.
The wallclock package is initialized by a static constructor with a
priority immediately after
Applications should not call any wallclock-related functions before
that constructor has run.
The ISL12028 is accessed via an I²C serial bus, and the driver assumes
the presence of the generic I²C support package
CYGPKG_IO_I2C and a suitable hardware driver. In
addition it requires that some other package, typically the platform
HAL, exports a cyg_i2c_device structure
cyg_i2c_wallclock_isl12028. The ISL12028 device
CYGPKG_DEVICES_WALLCLOCK_INTERSIL_ISL12028 can then
be included in the CDL target entry so that it gets loaded
automatically whenever eCos is configured for that target.
|2023-01-12||Open Publication License|