-
Notifications
You must be signed in to change notification settings - Fork 2k
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
drivers/periph_{i2c,spi}: fix doc on initialization #21188
Conversation
Both SPI and I2C peripheral drivers *MUST NOT* be initialized by the application code / (non-peripheral) device driver, as this is done automatically be default. Some peripheral drivers have a non-idempotent initialization and initializing them twice will break things. Sadly, the doc states the exact opposite. This updates the documentation to match the implementation. In addition the special case is pointed out of disabling the automatic initialization during boot, in which case the app indeed has to do the initialization.
What about removing |
I just had a similar thought. Maybe rename the functions to If and only if This will also keep existing users that do correctly add |
Sounds perfectly reasonable to me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK.
Changes in the doc looks good. Let's rework the I2C/SPI init in a followup PR.
Contribution description
Both SPI and I2C peripheral drivers MUST NOT be initialized by the application code / (non-peripheral) device driver, as this is done automatically be default. Some peripheral drivers have a non-idempotent initialization and initializing them twice will break things.
Sadly, the doc states the exact opposite.
This updates the documentation to match the implementation. In addition the special case is pointed out of disabling the automatic initialization during boot, in which case the app indeed has to do the initialization.
Testing procedure
The CI will generate a preview of the doc that can be checked.
Issues/PRs references
Might fix #21187