Skip to content

I2C address used in STM32-i2c drivers #296

Open
@Blast545

Description

@Blast545

Hello, when using I2C boards to communicate in "Master_Request_Write" and "Master_Request_Read" functions, the I2C address used is taken using the following function:

Address_to_use := UInt8 (Addr) and 2#1#;

This takes the upper 7 bits of the Addr. I think the standard is using the lower 7 bits of the address field, at least for most of "open source" sensors/boards, most of them come with the address written in the lower 7 bits in hexadecimal.

So, it is not like the library it is not working at this point, but it does not follow what I think is an I2C standard. I think there could be two approaches to "solve" this issue:

  1. Maybe writing an additional description in the I2C functions that the user should be using: Master_Transmit, Master_Receive, Mem_Write and Mem_Read. Maybe putting this info in the description of the package?

  2. Changing the function to shift_left the register address before taking the and/or operations, and updating the I2C address of the already written components. I think this one will require as well some sort of informative text, as some people working already with these libraries might be used to the current state of the library.

Let me know what you think, and thanks for your time!

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions