iic can't read data but can write data

  1. Hi, I have some questions about i2c when I use
    i2c_write_read_dt(&dev_i2c,&config[0],1,&config[1],1);
    The data cannot be read correctly,
    i2c_burst_read_dt(&dev_i2c,0x08,temp_reading,sizeof(temp_reading));
    The data read will be shifted. I use nrf5340 audio dk to control max30210. How can I fix this?
    When I use this code, the data is not read correctly. I am using nrf5340 audio dk to control max30210. When I use a logic analyzer to observe the data, it seems that there is no waiting after ark when reading data. I'm not sure how to fix this issue.
Parents Reply
  • I think you are right but I don't know if Ruhe should wait for ACK when reading and then read the library I use is <zephyr/drivers/i2c.h>

    overlay 

    ```

    &i2c1 {
        clock-frequency = <I2C_BITRATE_FAST_PLUS>;
        mysensor: mysensor@40{
            compatible = "i2c-device";
            status = "okay";
            reg = < 0x40 >;
        };
    };
    ```
    regards
    refix
Children
Related