Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the I2C documentation to use "controller/target" instead of "master/slave" #626

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

emshotton
Copy link

This brings the language in-line with Rev. 7.0 of the 2C-bus specification and user manual .

…aster/slave" to align with the I2C bus specification v.7
@emshotton emshotton requested a review from a team as a code owner August 26, 2024 02:59
@Dirbaio
Copy link
Member

Dirbaio commented Aug 26, 2024

I'm not convinced we should do this. As unfortunate as the master/slave names are, today the vast majority of microcontroller and i2c slave/target chips datasheets still use the master/slave terms. IMO the main goal of documentation is explaining to the user how to use the API, and making the user "mentally translate" between two sets of names when reading datasheets and our docs doesn't help that.

Also the controller/target names aren't universally agreed on either. There's also controller/peripheral (recommended by the OSHWA for SPI, but i've also seen it used for i2c), and I think I've also seen initiator/target somewhere too.

This was also discussed a bit in the weekly meeting when #396 was proposed, the conclusion was to keep master/slave names, since as long as it's in just docs (not trait/function/type name) we can easily change them to other names if/when other names become more widely used.

@emshotton
Copy link
Author

emshotton commented Aug 26, 2024

Thank you for the thoughtful reply and I want to acknowledge that naming things is a hard problem.

Interestingly the rp2040_hal uses a mix of language. It appears to use controller/peripheral when referring to the physical devices, and master/slave when referring to the devices addresses. The rp2040_pac uses master/slave when refering to the registers of the internal I2C device, but then the DW_apb_i2c IP block from Synopsys which appears to be the hardware implementation of i2c the rp2040 uses internally uses controller/target in it's public descriptions.

We are currently in a situation where there is already a range of competing terminology and confusion, and given that situation I'd argue that moving towards the language in the specification documentation that is being adopted by the hardware IP providers is a sensible move.

Personally I think it's important to move towards standardizing around this new terminology and the place individuals have agency to effect this change is in open source libraries such as this. I expect that the terminology used by IC manufactures will lag furthest behind, but will ultimately follow once changes to the spec and software libraries are made.

This change dosent include changes to the SPI terminology as I'm unfamiliar with the current state of naming conventions for that.

@amanjeev
Copy link

Personally I think it's important to move towards standardizing around this new terminology and the place individuals have agency to effect this change is in open source libraries such as this.

I second this. It will be nice to lead in this effort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants