Skip to content

I2C: move "Use 10-bit addressing" option to i2c_msg #3806

@zephyrbot

Description

@zephyrbot

Reported by Piotr Mienkowski:

The current support for 10-bit addressing in i2c.h file is incorrect: the "Use 10-bit addressing" configuration option defined as I2C_ADDR_10_BITS belongs to dev_config structure and is a parameter of i2c_configure() function. We treat it the same as speed, master/slave mode. i.e. it is a property which applies to all transactions performed on the bus. However, the I2C specification states: "Devices with 7-bit and 10-bit addresses can be connected to the same I2C-bus, and both 7-bit and 10-bit addressing can be used in all bus speed modes."
As such I2C_ADDR_10_BITS should be a property of i2c_msg.flags. In that case every message sent on the I2C bus can have independently set addressing mode.

(Imported from Jira ZEP-2373)

Metadata

Metadata

Assignees

Labels

EnhancementChanges/Updates/Additions to existing featuresarea: APIChanges to public APIsarea: I2Cpriority: mediumMedium impact/importance bug

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions