# ds3231 Maxim DS3231 RTC driver on [libavr](https://git.blackmark.me/avr/libavr): clock and alarm read/write, alarm interrupts, oscillator-stop detection, die temperature. One source runs on every libavr chip — TWI hardware on the mega328P, open-drain software I2C on the tinies. All bus errors surface as `std::expected`. ```cpp using bus = dev::i2c<{.frequency = 100_kHz}>; using rtc = ds3231::device; auto now = rtc::read_clock(); // result (void)rtc::set_alarm1({}, ds3231::alarm1_rate::once_per_second); ``` `example/main.cpp` is the full tour. Build with a libavr checkout: ```sh LIBAVR_ROOT=/path/to/libavr cmake --preset attiny85-generated cmake --build --preset attiny85-generated ``` Presets cover attiny85/atmega328p in both libavr modes (generated and reflect). The legacy yazoalfa-based driver lives on the `master` branch. Differences from legacy: weekday-rate alarms now actually set the DY bit (the old `setAlarmHelper` always cleared it), reads/writes are single coherent bus transactions, and errors are reported instead of ignored.