-
Notifications
You must be signed in to change notification settings - Fork 710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add rv 3032 c7 support #258
base: master
Are you sure you want to change the base?
Conversation
Doxygen fix in RTC_RV3032C7.cpp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a great addition! I have a couple of small issues. These are only my personal suggestions though: I am not a maintainer of this library.
keywords.txt
Outdated
enableClkOut KEYWORD2 | ||
disableClkOut KEYWORD2 | ||
isEnabledClkOut KEYWORD2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the Arduino Library Specification, within keywords.txt
the fields should be “separated by a single true tab (not spaces)”
Oh, wait, the three keywords just above your addition already have this problem... This will have to be fixed, maybe in another pull request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, it was a copy/paste then modify... but I should have noticed that the keyword was not recognized in the Arduino GUI! I think I will correct that in the next update.
//#define DEBUG_SERIAL Serial | ||
//#define DEBUG_SERIAL SerialUSB | ||
//#ifdef DEBUG_SERIAL | ||
// #include <Arduino.h> | ||
//#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed! It will be removed in the next update, coming soon.
Thanks to edgar-bonet Co-authored-by: Edgar Bonet <[email protected]>
This commit introduces 3 new methods to get Alarm values (in line with DS3231): DateTime getAlarm(); RV3032C7AlarmMode getAlarmMode(); RV3032C7EventType getAlarmEventType(); In addition, disableAlarm() has been enhanced to properly disable alarm. RV3032C7InvalidDate has been defined to check if the alarm is disabled. Keywords added Updated the RV3032C7_alarm example to fetch alarm1. Also improved the formatting of the serial logging and added the possibility to disable the alarm.
I have a few suggestions regarding the documentation of this new class:
|
Added deconfigureAllTimers(), similar to RTC_PCF8523 disableCountdownTimer will disable the timer but leave all other settings as they are enableCountdownTimer() withouit parameters will re-enable the timer using previous settings Improved doxygen documentation
Plus fixed formatting for exiting keywords
Wrong register written, fixed
This pull request adds support for Micro Crystal AG RV-3032-C7, a new accurate I²C RTC with integrated crystal and digital temperature compensation.
The RV-3032-C7 can be used in a similar way to the the DS3231 in most applications where the RTClib would be used. This is especially interesting because the DS3231 is very difficult to source right now. As of this writing, Digikey has 10K RV-3032-C7 in stock, and the next shipment is scheduled in "just" 3 months.
As can be expected from a new chip, the RV-3032-C7 bests the DS3231 in a number of ways:
See Data sheet summary for more information: https://www.microcrystal.com/fileadmin/Media/Products/RTC/Datasheet/RV-3032-C7.pdf
Product page for the full application manual and more: https://www.microcrystal.com/en/products/real-time-clock-rtc-modules/rv-3032-c7/
This is an initial release of the RV-3032-C7 support for RTClib. It includes setting time, alarm and enabling/disabling the CLKOUT pin.
I tried to keep the API as close as possible to the DS3231 behaviour except where it would be misleading. Feedback and suggestions are of course welcomed.
Assuming the idea of including this chip in RTClib is approved, I intend to add more features, in particular:
I can add other features if there is interest.
Some features like trickle charge may be unsafe for beginners, so I am not currently planning to provide direct support for activation (they are off by default). I may provide an example if there is an interest (and then the library would work).
Tested with Arduino Uno, Arduino MKR1000, Adafruit Adafruit QT Py - SAMD21. More testing will follow.
For full disclosure, I have developed this library with an eval board provided free of charge by Micro Crystal AG, but I have no other affiliation with the company and I will not receive any form of compensation for this work.