Giter Club home page Giter Club logo

nerves_time_rtc_ds3231's Introduction

NervesTime.RTC.DS3231

CircleCI Hex version

NervesTime.RTC implementation for popular Maxim Integrated Extremely Accurate Real-Time Clock chip with TCXO. [An "Oldie-but-Goodie". Dallas Semiconductor was acquired by Maxim in 2001]

Features of the DS3231 device other than the time and date registers [i.e. Alarms, Interrupts, Square Wave output and Temperature measurement] are untouched by this plugin, and are therefore available to other user-written Elixir apps.

The following are supported:

Using

First add this project to your mix dependencies:

def deps do
  [
    {:nerves_time_rtc_ds3231, "~> 0.1.0"}
  ]
end

And then update your :nerves_time configuration to point to it:

config :nerves_time, rtc: NervesTime.RTC.DS3231

It's possible to override the default I2C bus and address via options:

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.

nerves_time_rtc_ds3231's People

Contributors

danielspofford avatar dependabot[bot] avatar fhunleth avatar grace-in-wonderland avatar jjcarstens avatar jsimmonds2 avatar mnishiguchi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

nerves_time_rtc_ds3231's Issues

Validate peripheral on init

Reference: #3 (comment)

The removal of the check (as implemented, not conceptually) was because how it was going about checking was not good. See PR.

--

The only comms you can have with the DS3231 is reading and writing registers. None of the registers contain a static/reliable/identifiable value to check. I think our options would be one of:

  • General read success. An I2C read against bus and address with a read length of all registers.
  • Observe counting seconds. Read seconds into initial and wait expected seconds and re-read again into actual. If abs(expected - (actual - initial)) <= epsilon then “it looks like it is keeping time”.

Neither of these will guarantee the DS3231 is actually what you are talking to.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.