-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Add extended I2C HAL functions #3037
Conversation
return ten_bit_address ? LL_I2C_GENERATE_RESTART_10BIT_WRITE : | ||
LL_I2C_GENERATE_RESTART_7BIT_WRITE; |
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.
This could be simplified, since both values are equal, depending on how close to ST's LL you want to stick.
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.
We'd rather hide anything related to ST LL inside.
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.
Unit tests needed: can be gauge, charger or led driver.
un draft when ready |
I have fixed the functions and enums naming and have checked that the |
I've pushed bunch of small edits: docs update, const qualifier usage cleanup, fix with incorrect argument pass. In general everything looks good. We do need one last thing: unit tests, they must cover newly added features. |
I have added two unit tests, one testing the Restart and Pause / Resume features, the other testing the auto-reload feature. The first uses the LED driver, same as the existing tests. |
That was some great work, you did well ;-) |
What's new
furi_hal_i2c_tx_ext
andfuri_hal_i2c_rx_ext
, giving the user more flexibility in writing I2C drivers by giving them more choices such as sending RESTART conditions and using multiple buffers in the same transaction.furi_hal_i2c_trx
shared between all transactions instead of being duplicated.furi_hal_i2c_is_device_ready
.I tried to keep the binary size increase to a minimum but this still adds about 300 bytes to the final binary (304 in debug, 296 in compact).
Verification
To check for basic functionality, simply boot the Flipper. Non working code will cause the communication with the battery control chips and the LED driver to fail, resulting in missing battery readouts and no screen backlight.
More advanced verification must be done using a logic analyzer.
As I have not opened my Flipper, I have only checked the behavior using the external bus.
Checklist (For Reviewer)