Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i2c_rdwr(msg) performing read only operation #91

Open
diegohernando opened this issue Jul 17, 2023 · 1 comment
Open

i2c_rdwr(msg) performing read only operation #91

diegohernando opened this issue Jul 17, 2023 · 1 comment
Labels

Comments

@diegohernando
Copy link

Hi there,

I can use i2c_rdwr(msg) method to implement a write only transaction, by passing just a msg argument create with the write method. Here I specify the i2c address, the command (reg address) and the data (flags).

I want to do something similar but just to read. I know when creating i2c_msg with read command I have to pass the i2c address and the length of the data to receive. How can I also specify the address of the register to read from? Is it by passing the flags argument too?

I'm trying to access the extended register map of a device (0xFEXX is the address of these registers). I was able to write to them, but I cannot read from them.

Many thanks in advance.

@diegohernando diegohernando changed the title i2c_rdwr(msg) perfroming read only operation i2c_rdwr(msg) performing read only operation Jul 17, 2023
@kplindegaard
Copy link
Owner

kplindegaard commented Jul 22, 2023

Hi there. I didn't understand the full context of what you intend to do... Was it to read from a specific offset you meant? If it's an 8 bit offset, there are functions available such as read_byte_data and its siblings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants