I have an RTC (DS3231) connected to a 125-14 4-input board running OS 2.0. I can see the RTC is connected to /dev/i2c-0 at address 0x68. To read the time from the RTC I can use the i2cdump command that comes with i2c-tools.
Code: Select all
root@rp-f0b477:~# i2cdump -y -r 0x00-06 0 0x68
No size specified (using byte-data access)
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
00: 32 11 55 07 0f 0c 2e 2?U???.
root@rp-f0b477:~#
Is there a library function similar to this that can be used in a C program to, say, read the RTC data into a buffer? I see some I2C related entries in the rp_hw.h header file. However, the documentation is not explicit in how to use these functions and exactly what these functions do.