{"id":28638840,"url":"https://github.com/liebman/ds3231-rs","last_synced_at":"2025-06-12T19:08:03.918Z","repository":{"id":291458304,"uuid":"977671144","full_name":"liebman/ds3231-rs","owner":"liebman","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-08T23:27:04.000Z","size":126,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-09T00:25:59.967Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/liebman.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-04T18:14:39.000Z","updated_at":"2025-06-08T23:27:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"b7d040f9-9a6d-4c5d-8b2d-281789f4844a","html_url":"https://github.com/liebman/ds3231-rs","commit_stats":null,"previous_names":["liebman/ds3231-rs"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/liebman/ds3231-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liebman%2Fds3231-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liebman%2Fds3231-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liebman%2Fds3231-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liebman%2Fds3231-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liebman","download_url":"https://codeload.github.com/liebman/ds3231-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liebman%2Fds3231-rs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259519861,"owners_count":22870371,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-12T19:08:03.296Z","updated_at":"2025-06-12T19:08:03.909Z","avatar_url":"https://github.com/liebman.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DS3231 Real-Time Clock Driver\n\n[![Crates.io](https://img.shields.io/crates/v/ds3231.svg)](https://crates.io/crates/ds3231)\n[![Documentation](https://docs.rs/ds3231/badge.svg)](https://docs.rs/ds3231)\n[![License](https://img.shields.io/badge/license-MIT%2FApache--2.0-blue.svg)](README.md)\n[![Coverage Status](https://coveralls.io/repos/github/liebman/ds3231-rs/badge.svg?branch=main)](https://coveralls.io/github/liebman/ds3231-rs?branch=main)\n\nA platform-agnostic Rust driver for the DS3231 Real-Time Clock, built on the `embedded-hal` ecosystem.\nThe DS3231 is a low-cost, extremely accurate I²C real-time clock (RTC) with an integrated\ntemperature-compensated crystal oscillator (TCXO).\n\n- Both blocking and async I²C operation support\n- Full register access (time/date, alarms, control, status)\n- Optional logging support via `log` or `defmt`\n- No `unsafe` code\n- Comprehensive error handling\n\n## Usage\n\nAdd this to your `Cargo.toml`:\n\n```toml\n[dependencies]\nds3231 = \"0.3.0\"\n```\n\n### Blocking Example\n\n```rust\nuse ds3231::{DS3231, Config, TimeRepresentation, SquareWaveFrequency, InterruptControl, Oscillator};\n\n// Create configuration\nlet config = Config {\n    time_representation: TimeRepresentation::TwentyFourHour,\n    square_wave_frequency: SquareWaveFrequency::Hz1,\n    interrupt_control: InterruptControl::SquareWave,\n    battery_backed_square_wave: false,\n    oscillator_enable: Oscillator::Enabled,\n};\n\n// Initialize device with I2C\nlet mut rtc = DS3231::new(i2c, 0x68);\n\n// Configure the device\nrtc.configure(\u0026config)?;\n\n// Get current date/time\nlet datetime = rtc.datetime()?;\n```\n\n### Async Example\n\nEnable the async feature in your `Cargo.toml` and use with async/await:\n\n```rust\nuse ds3231::asynch::DS3231;\n\n// Initialize device\nlet mut rtc = DS3231::new(i2c, 0x68);\n\n// Configure asynchronously\nrtc.configure(\u0026config).await?;\n\n// Get current date/time asynchronously\nlet datetime = rtc.datetime().await?;\n```\n\n## Features\n\nThe crate can be compiled with the following features:\n\n- `async`: Enables async I²C support\n- `log`: Enables logging via the `log` crate\n- `defmt`: Enables logging via the `defmt` crate\n- `temperature_f32` - Enables temperature reading as f32\n\n## License\n\nLicensed under either of:\n\n- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or \u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e)\n- MIT license ([LICENSE-MIT](LICENSE-MIT) or \u003chttp://opensource.org/licenses/MIT\u003e)\n\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliebman%2Fds3231-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliebman%2Fds3231-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliebman%2Fds3231-rs/lists"}