The Driver for the PCF8563 Real-time Clock and Calendar
This is a pure MicroPython driver written by Lewis He, which can be found on
https://github.com/lewisxhe/PCF8563_PythonLibrary.
It is implemented as class
PCF8563 with the following methods:
- PCF8563(i2c:!I2C,address=None): Creates an PCF8563 instance. In the first parameter the I2C object from the machine module must be passed. address can be left undefined in which case the default PCF8563 I2C slave address (0x51) is used
- seconds(): returns seconds of current time
- minutes(): returns minutes
- hours() returns hours
- day(): returns day of the week
- date(): returns day in the month
- month(): returns months
- year(): returns year
- datetime(): returns the tuple: (year,month,date,day,hours,minutes,seconds)
- write_all(seconds=None,minutes=None,hours=None,day=None,date=None,month=None,year=None): writes the corresponding value to the pcf8563 registers if not None)
- set_datetime(dt): dt is a tuple (year, month,date,day,hours,minutes,seconds)
- write_now(): write utime.localtime() to the PCF8563 registers
- set_clk_out_frequency(frequency=CLOCK_CLK_OUT_FREQ_1_HZ): sets the clock out pin frequency (1 Hz if frequency is not specified)
- check_for alarm_interrupt() check i the alarm interrupt is set
- enable_alarm_interrupt(): enable the alarm interrupt
- disable_alarm_interrupt(): disable the alarm interrupt
- set_daily_alarm(hours=None, minutes=None, date=None,weekday=None)
--
Uli Raich - 2021-01-25
Comments