View Source Soleil.MCP7940 (soleil v0.1.1)
Microchip MCP7940 RTC implementation for NervesTime.
To configure NervesTime to use this module, update the :nerves_time
application
environment like this:
config :nerves_time, rtc: Soleil.MCP7940
Check the logs for error message if the RTC doesn't appear to work.
See the datasheet for implementation details
Summary
Functions
@spec alarm_enabled?(Circuits.I2C.bus()) :: boolean() | {:error, any()}
@spec alarm_flag?(Circuits.I2C.bus()) :: boolean() | {:error, any()}
@spec clear_alarm(Circuits.I2C.bus()) :: :ok | {:error, any()}
@spec get_alarm(Circuits.I2C.bus()) :: {:ok, NaiveDateTime.t()} | {:error, any()}
@spec read_time(Circuits.I2C.bus()) :: {:ok, NaiveDateTime.t()} | {:error, any()}
@spec set_alarm(Circuits.I2C.bus(), NaiveDateTime.t()) :: :ok | {:error, any()}
@spec set_alarm_enabled(Circuits.I2C.bus(), boolean()) :: :ok | {:error, any()}
@spec write_time(Circuits.I2C.bus(), NaiveDateTime.t()) :: :ok | {:error, any()}