Name

CYGPKG_DEVICES_WALLCLOCK_ST_M41TXX — eCos Support for the ST M41TXX Serial Real-Time Clock

Description

This package CYGPKG_DEVICES_WALLCLOCK_ST_M41TXX provides a device driver for the wallclock device in the ST M41TXX Serial Real-Time Clock chips. This is a real-time clock, alarm and watchdog in a single package. eCos only currently supports the real-time clock function.

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.

Functionality

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 time and gmtime. The eCos C library also provides a non-standard function cyg_libc_time_settime for changing the current wallclock setting. In addition RedBoot provides a date command which interacts with the wallclock device.

Porting

M41TXX platform support is implemented via the generic I²C API, as defined by the package CYGPKG_IO_I2C. The platform HAL can just provide a cyg_i2c_device structure cyg_i2c_wallclock_m41txx. The M41TXX driver will now use I²C rx and tx operations to interact with the chip.

In addition the M41TXX device driver package CYGPKG_DEVICES_WALLCLOCK_ST_M41TXX should be included in the CDL target entry so that it gets loaded automatically whenever eCos is configured for that target.