i2cdump equivalent using rp_hw.h?

Applications, development tools, FPGA, C, WEB
Post Reply
earlforeal
Posts: 33
Joined: Thu Aug 20, 2020 9:00 pm

i2cdump equivalent using rp_hw.h?

Post by earlforeal » Wed Jun 28, 2023 10:46 pm

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.

User avatar
redpitaya
Site Admin
Posts: 912
Joined: Wed Mar 26, 2014 7:04 pm

Re: i2cdump equivalent using rp_hw.h?

Post by redpitaya » Mon Jul 03, 2023 2:55 pm

Hello earlforeal,

I will consult with the team and let you know.

User avatar
redpitaya
Site Admin
Posts: 912
Joined: Wed Mar 26, 2014 7:04 pm

Re: i2cdump equivalent using rp_hw.h?

Post by redpitaya » Wed Jul 05, 2023 1:32 pm

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.

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: No registered users and 110 guests