This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

i2c addressing

Hi,

we have 2 queries regarding i2c speed mode

1. what is difference between I2C_ADDR_10_BITS and I2C_MSG_ADDR_10_BITS in i2c.h (SDK Path: nCS\v1.8.0\zephyr\include\drivers, file attached)

2. Our slave device is having 7bit address, we couldn't find any specific configuration for 7-bit address in zephyr driver i2c.h instead we used I2C_ADDR_10_BITS only for a slave having 7-bit address, please confirm is it a right way of using I2C_ADDR_10_BITS configuration for slave device having 7-bit address.

Thank you,

 1460.i2c.h

  • Hello!

    You can find the documentation for the Zephyr I2C API here:

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

    According to the documentation, I2C_ADDR_10_BITS is deprecated and replaced by I2C_MSG_ADDR_10_BITS.

    But for your other question, I2C uses either 7 or 10 bit addressing, 7 bit being the default.

    So if you're using 7 bit addressing you should not use I2C_MSG_ADDR_10_BITS, but have the default setting instead.

    Best regards,

    Einar

  • What is the configuration of default i2c address ? now as we see for 10-bit we have I2C_ADDR_10_BITS, then what's for 7-bit address ?

    Important: Please mention more detail about the difference between I2C_MSG_ADDR_10_BITS & I2C_ADDR_10_BITS configurations, we need detailed description as in driver or in zephyr documentation we are not able to fetch detailed description

  • Hi

    The default configuration uses 7-bit addresses, which means that if you don't set I2C_MSG_ADDR_10_BITS then 7-bit addresses will be used.

    The way it is described in the documentation it seems like I2C_MSG_ADDR_10_BITS is set per message rather than in a config file.

    If you want more detail than is provided in the documentation, you can look up the definitions in the source code.

Related