Commit Graph

3 Commits

Author SHA1 Message Date
Thea Flowers 4a55c48dbf
Improve documentation for `rtc`.
- Add examples for `rtc.RTC.datetime`.
- Add type for `rtc.RTC.calibration`.
- Expand on use cases for `rtc.set_time_source`.
2019-10-23 15:48:34 -07:00
Scott Shawcroft 84d4be279e
Add a table of contents reference to RTC 2018-04-16 15:00:01 -07:00
Noralf Trønnes 8d1719f190 Add rtc module
Add an rtc module that provides a singleton RTC class with
- a datetime property to set and get time if the board supports it.
- a calbration property to adjust the clock.

There's also an rtc.set_time_source() method to override this RTC object using pure python.

The time module gets 3 methods:
- time.time()
- time.localtime()
- time.mktime()

The rtc timesource is used to provide time to the time module.

lib/timeutils is used for time conversions and thus only supports dates after 2000.
2018-04-16 12:49:10 +02:00