# `NervesTime.RTC.DS3231`
[🔗](https://github.com/nerves-time/nerves_time_rtc_ds3231/blob/v0.1.3/lib/nerves_time/rtc/ds3231.ex#L1)

DS3231 RTC implementation for NervesTime

To configure NervesTime to use this module, update the `:nerves_time` application
environment like this:

```elixir
config :nerves_time, rtc: NervesTime.RTC.DS3231
```

If not using `"i2c-1"` or the default I2C bus address, specify them like this:

```elixir
config :nerves_time, rtc: {NervesTime.RTC.DS3231, [bus_name: "i2c-2", address: 0x69]}
```

Check the logs for error messages if the RTC doesn't appear to work.

See https://datasheets.maximintegrated.com/en/ds/DS3231.pdf for implementation details.

# `flag`

```elixir
@type flag() :: 0 | 1
```

This type represents the many registers whose value is a single bit.

# `get_alarm`

Reads an alarm register.

# `get_control`

Reads the control register.

# `get_status`

Reads the status register.

# `get_temperature`

Reads the temperature register.

# `set_alarm`

Writes an alarm register.

# `set_control`

Writes the control register.

# `set_status`

Writes the status register.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
