Page 1 of 1

i2cdump equivalent using rp_hw.h?

Posted: Wed Jun 28, 2023 10:46 pm
by earlforeal
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.

Re: i2cdump equivalent using rp_hw.h?

Posted: Mon Jul 03, 2023 2:55 pm
by redpitaya
Hello earlforeal,

I will consult with the team and let you know.

Re: i2cdump equivalent using rp_hw.h?

Posted: Wed Jul 05, 2023 1:32 pm
by redpitaya
Hello earlforeal,

You can use the SCPI commands. Here is an example:
https://redpitaya.readthedocs.io/en/lat ... i2c-hw-api

Otherwise, you can modify the C functions behind the SCPI commands.