Crates.io | ds1302 |
lib.rs | ds1302 |
version | 4.0.0 |
source | src |
created_at | 2020-11-01 10:26:19.821372 |
updated_at | 2021-12-04 09:31:50.914185 |
description | A platform agnostic driver to interface with the DS1302 real time clock-calendar |
homepage | |
repository | https://github.com/Nekspire/ds1302-rs |
max_upload_size | |
id | 307440 |
size | 57,205 |
DS1302 real time clock-calendar platform agnostic driver
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
DS1302 RTC Board - Waveshare
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
https://github.com/Nekspire/ds1302-rs/tree/master/examples
This crate uses probe-run
to run the examples.
To build examples type:
cargo build --examples
or cargo build --examples --release
To run examples type:
cargo run --example <example name>
or cargo run --example <example name> --release
The output should be like this:
Running `probe-run --chip STM32F103C8 target/thumbv7m-none-eabi/debug/examples/bluepill_ssd1306`
(HOST) INFO flashing program (36.32 KiB)
(HOST) INFO success!
Copyright © 2021 Nekspire
Dual licensed under your choice of either of:
Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
Thanks for contribution!