Conversation
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Signed-off-by: Aymane Bahssain <aymane.bahssain@st.com>
fpistm
requested changes
Mar 30, 2026
Collaborator
fpistm
left a comment
There was a problem hiding this comment.
Thanks for this first version.
See my comments.
Moreover, ensure to have only one return statement per function. (MISRA compliance).
Is Wire library could/should be used to be extended with I3C support. Default I2C then add possibilities to do I3C or I2C over I3C? It seems several API is common and Wire is generic name.
/cc @cparata
Comment on lines
+4
to
+14
| #if defined(STM32H5xx) | ||
| #define I3C_BUS I3C1Bus | ||
| #define I3C_SDA_PIN PB7 | ||
| #define I3C_SCL_PIN PB6 | ||
| #elif defined(STM32U3xx) | ||
| #define I3C_BUS I3C2Bus | ||
| #define I3C_SDA_PIN PB14 | ||
| #define I3C_SCL_PIN PB13_ALT1 | ||
| #else | ||
| #error "Unsupported STM32 family" | ||
| #endif |
Collaborator
There was a problem hiding this comment.
Why not use I3CBus declared in the .cpp.
Haveing a default instance defined by the variant like it is done for Wire and SPI. Even if it is the same pins than Wire instance.
Check only if STM32 series used to build have I3C support.
Comment on lines
+8
to
+18
| #if defined(STM32H5xx) | ||
| LPS22DFSensor ps(&I3C1Bus, LPS22DF_STATIC_ADDR_7BIT, LPS22DF_DYN_ADDR_7BIT); | ||
| #define I3C_BUS I3C1Bus | ||
| #define I3C_SCL PB6 | ||
| #define I3C_SDA PB7 | ||
| #elif defined(STM32U3xx) | ||
| LPS22DFSensor ps(&I3C2Bus, LPS22DF_STATIC_ADDR_7BIT, LPS22DF_DYN_ADDR_7BIT); | ||
| #define I3C_BUS I3C2Bus | ||
| #define I3C_SCL PB13_ALT1 | ||
| #define I3C_SDA PB14 | ||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on LPS22DF pr: Aymane-ST/LPS22DF#1
Tested on Nucleo H503RB and U385RG_Q