View Source NervesTime.RTC.DS3231 (nerves_time_rtc_ds3231 v0.1.3)

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

@type flag() :: 0 | 1

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

Functions

Link to this function

get_alarm(i2c, address, alarm_num)

View Source

Reads an alarm register.

Link to this function

get_control(i2c, address)

View Source

Reads the control register.

Link to this function

get_status(i2c, address)

View Source

Reads the status register.

Link to this function

get_temperature(i2c, address)

View Source

Reads the temperature register.

Link to this function

set_alarm(i2c, address, a1)

View Source

Writes an alarm register.

Link to this function

set_control(i2c, address, control)

View Source

Writes the control register.

Link to this function

set_status(i2c, address, status)

View Source

Writes the status register.