In cycx3_sensor.c, how to use function I2C_SensorRead

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Minwan
Level 1
Level 1
10 sign-ins 5 replies posted 5 sign-ins

Hi,

I want to  use function I2C_SensorRead  to verify that the data was successfully written to the register. But I have no ideal how to use it and how to provide register address and see the value of register.

And why the warning occur?

Minwan_0-1625494900156.png

 

Best regards,

ZhangWan

 

0 Likes
1 Solution
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hello ZhangWan,

The function I2C_SensorRead accepts three parameters. The description of each parameter is given below:

1. regAddr: This is a 16 bit parameter. This parameter is used to specify the register address of the image sensor from which read needs to be done.

2. count: This parameter is used to specify the size of I2C transfer in bytes.

3. *buf: This is the pointer to the buffer that will hold the data after read operation.

The I2C_SensorRead can be used in the same way as I2C_SensorWrite. 

For removing the warning, please change the I2C_SensorWrite calls as follows:

I2C_SensorWrite (configSettings[regCounter].regAddr, 1, rwBuffer);

Best Regards,
Jayakrishna

View solution in original post

0 Likes
1 Reply
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hello ZhangWan,

The function I2C_SensorRead accepts three parameters. The description of each parameter is given below:

1. regAddr: This is a 16 bit parameter. This parameter is used to specify the register address of the image sensor from which read needs to be done.

2. count: This parameter is used to specify the size of I2C transfer in bytes.

3. *buf: This is the pointer to the buffer that will hold the data after read operation.

The I2C_SensorRead can be used in the same way as I2C_SensorWrite. 

For removing the warning, please change the I2C_SensorWrite calls as follows:

I2C_SensorWrite (configSettings[regCounter].regAddr, 1, rwBuffer);

Best Regards,
Jayakrishna
0 Likes