Crate ds1302

Source
Expand description

DS1302 real time clock-calendar platform agnostic driver

§About

The DS1302 trickle-charge timekeeping chip contains a real-time clock/calendar and 31 bytes of static RAM. It communicates with a microprocessor via a simple serial interface. The real-time clock/calendar provides seconds, minutes, hours, day, date, month, and year information. The end of the month date is automatically adjusted for months with fewer than 31 days, including corrections for leap year. The clock operates in either the 24-hour or 12-hour format with an AM/PM indicator. The chip driver is based on embedded-hal traits.

Datasheet: DS1302

§Driver features:

  • Reading/setting clock/calendar data
  • 12-hour (AM/PM) or 24-hour format
  • Changing the time format while the chip is working

NEW (4.0.0 release):

  • Programmable Trickle Charger configuration
  • 31 x 8 Battery-Backed General-Purpose RAM operations

Structs§

Calendar
Calendar information
Clock
Clock information
DS1302
DS1302 RTCC driver

Enums§

Ds
Trickle charger diode select. diode drop 0.7v or 1.4v.
Ds1302Error
DS1302 error
Hours
Hour information: 12-hour (AM/PM) or 24-hour
Mode
Hour format: 12-hour (AM/PM) or 24-hour
Rs
Trickle charger resistor select.

Traits§

Delay
For timing ds1302 uses fugit crate which only provides Duration and Instant types. It does not provide any clock or timer traits. Therefore ds1302 has its own Delay trait that provides all timing capabilities that are needed for the library. User must implement this trait for the timer by itself.