@@ -57,7 +57,23 @@ STATIC mp_obj_t rtc_rtc_make_new(const mp_obj_type_t *type, size_t n_args, const
5757
5858//| .. attribute:: datetime
5959//|
60- //| The date and time of the RTC.
60+ //| The current date and time of the RTC as a `time.struct_time`.
61+ //|
62+ //| This must be set to the current date and time whenever the board loses power::
63+ //|
64+ //| import rtc
65+ //| import time
66+ //|
67+ //| r = rtc.RTC()
68+ //| r.datetime = rtctime.struct_time((2019, 5, 29, 15, 14, 15, 0, -1, -1))
69+ //|
70+ //|
71+ //| Once set, the RTC will automatically update this value as time passes. You can read this
72+ //| property to get a snapshot of the current time::
73+ //|
74+ //| current_time = r.datetime
75+ //| print(current_time)
76+ //| # struct_time(tm_year=2019, tm_month=5, ...)
6177//|
6278STATIC mp_obj_t rtc_rtc_obj_get_datetime (mp_obj_t self_in ) {
6379 timeutils_struct_time_t tm ;
@@ -83,9 +99,10 @@ const mp_obj_property_t rtc_rtc_datetime_obj = {
8399
84100//| .. attribute:: calibration
85101//|
86- //| The RTC calibration value.
102+ //| The RTC calibration value as an `int`.
103+ //|
87104//| A positive value speeds up the clock and a negative value slows it down.
88- //| Range and value is hardware specific, but one step is often approx. 1 ppm.
105+ //| Range and value is hardware specific, but one step is often approximately 1 ppm.
89106//|
90107STATIC mp_obj_t rtc_rtc_obj_get_calibration (mp_obj_t self_in ) {
91108 int calibration = common_hal_rtc_get_calibration ();
0 commit comments