I2C implementation in Nrf NCS SDK 1.7.1

Hi,

We want to explore I2C examples in nCS SDK 1.7.1

Can you please enlist all the examples having I2C implementation.

also want to add I'm referring to I2C API's mentioned in this link & i2c.h from this path in nCS 1.7.1 (\nCS\v1.7.1\zephyr\include\drivers)

https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/peripherals/i2c.html 

kindly suggest the sample example we should refer for the I2C peripheral development.

Thank you,

Parents Reply
  • Hi Priyanka,

    This tutorial helped significantly, thank you very much for helping, 

    We want to know 3 things about data transfer and configuration in i2c.

    1. Changing clock frequency

    if we need to change clock frequency is it sufficient to pass respective speed configurations in configure as shown below, or can you please share inputs for changing clock frequency in I2C?

    i2c_configure(m_i2c_dev, I2C_SPEED_SET(I2C_SPEED_FAST) | I2C_MODE_MASTER);

    2. I want to have multiple slave configuration and single master in I2C, I am attaching overlay file of master having multiple slave configurations & slave overlay which will be common across all the slave device, created as per my understanding, please provide your inputs what all configurations are needed for having multiple slave configuration. I am using very same slave example mentioned here in this Guide

    3. I want to transfer 16 bit data through i2c bus I am referring to following api i2c_write

    int i2c_write(const struct device *dev, const uint8_t *bufuint32_t num_bytes, uint16_t addr)
    if we see buf Memory pool from which the data is transferred it is uint8_t, I want to know common practice nordic recommendation to transfer 16 bit data and a values having signed int.
    Thank you,
     

Children
Related