I’m using the rv3028 RTC in a Pimoroni pico Explorer. I am new microprocessors and Micropython.
I have used the following code in the Thonny Shell to determine which methods are available for the rv3028 with Pimoroni Micropython.
import breakout_rtc
dir(breakout_rtc.BreakoutRTC)
I can see all the methods available but how do I explore the valid arguments for these methods. I’ve worked out several by trial and error! For example, how do I determine the valid parameters for ‘set_backup_switchover_mode’?
Does this help? extern mp_obj_t BreakoutRTC_set_backup_switchover_mode(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args); if(val < 0 || val > 3) mp_raise_ValueError("tcr out of range. Expected 0 to 3");
Thanks alphanumeric. I would never have found that. So are there four possible values? 0-3?
It’s still a mystery which setting to use.
I found this in rv3028-python library (not Micropython)…
# Switches RTC to backup battery if VCC goes below 2V # Other settings: ‘switchover_disabled’, ‘direct_switching_mode’, 'standby_mode’ rtc.set_battery_switchover(‘level_switching_mode’)
So there appear to be four options. Just not sure what they mean and which one is “0”, “1”, “2” and “3”. Any further information would be much appreciated.