This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

I2C example code for nrf5340

Hi ,

my environment details:

  • nrf connect sdk
  • nrf5340 dk
  • segger embedded studio

I have seen I2C example code in below path

\v1.5.0\zephyr\samples\drivers\i2c_fujitsu_fram

please let me know where can I update I2C pin numbers (SDA and SCL) and share with me if you have any more example codes on I2C.

Thanks & Regards,

Srinivas Rao.

Parents
  • Hello Srinivas,

    You can find some sensor examples in ../zephyr/samples/sensor.

    I would recommend you have a look at the BME280 sample. It includes overlay files in the board folder, which are used to connect the sensor to an I2C peripheral. With such an overlay file you can modify all attributes of each peripheral of your devicetree, such as updating the SDA/SCL pins.

    The syntax is the same as in ../bme280/<your_build_folder>/zephyr/zephyr.dts.

    If you want to read more about that, you can follow this link.

    I hope this will help you!

    Regards,

    Markus

Reply
  • Hello Srinivas,

    You can find some sensor examples in ../zephyr/samples/sensor.

    I would recommend you have a look at the BME280 sample. It includes overlay files in the board folder, which are used to connect the sensor to an I2C peripheral. With such an overlay file you can modify all attributes of each peripheral of your devicetree, such as updating the SDA/SCL pins.

    The syntax is the same as in ../bme280/<your_build_folder>/zephyr/zephyr.dts.

    If you want to read more about that, you can follow this link.

    I hope this will help you!

    Regards,

    Markus

Children
Related