NervesTime.RTC.DS3231 (nerves_time_rtc_ds3231 v0.1.2)

Copy Markdown View Source

DS3231 RTC implementation for NervesTime

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

config :nerves_time, rtc: NervesTime.RTC.DS3231

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

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.

Summary

Types

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

Functions

Reads an alarm register.

Reads the control register.

Reads the status register.

Reads the temperature register.

Writes an alarm register.

Writes the control register.

Writes the status register.

Types

flag()

@type flag() :: 0 | 1

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

Functions

get_alarm(i2c, address, alarm_num)

Reads an alarm register.

get_control(i2c, address)

Reads the control register.

get_status(i2c, address)

Reads the status register.

get_temperature(i2c, address)

Reads the temperature register.

set_alarm(i2c, address, a1)

Writes an alarm register.

set_control(i2c, address, control)

Writes the control register.

set_status(i2c, address, status)

Writes the status register.