15.2 What I
2
C Registers are provided by Witty Pi 4?
The micro controller on Witty Pi 4 works as an I
2
C slave and Raspberry Pi can read/write its registers
via I
2
C interface. Witty Pi’s software configures Witty Pi 4 by setting the I
2
C register accordingly.
The micro controller also implements an I
2
C master to access the realtime clock and temperature
sensor via internal I
2
C bus. The I
2
C registers in realtime clock and temperature sensor are all
mapped as virtual I
2
C registers in Witty Pi 4’s I
2
C slave device, so Raspberry Pi can also access
them (not always necessary though).
The temperature sensor contains 4 I
2
C registers and they are mapped to virtual registers #50~#53.
The realtime clock contains 18 I
2
C registers and they are mapped to virtual registers #54~#71.
In Raspberry Pi’s view, Witty Pi 4 provides 3 kinds of I
2
C registers:
Read-only I
2
C registers
Normal I
2
C registers
Virtual I
2
C registers
The table below shows the registers provided by Witty Pi 4. As you can see, some of them are
read-only (cannot be changed, or can only be updated by the firmware itself):
Temperature Sensor
register #1
register #2
register #3
Realtime Clock
register #1
register #2
register #3
Microcontroller
register #1
register #2
register #3
……
virtual register #50
virtual register #51
virtual register #52
virtual register #53
virtual register #54
virtual register #55
virtual register #56
……