Skip to content

Commit fc41427

Browse files
committed
feat(I3C): add dual HAL V1/V2 support
Signed-off-by: Aymane Bahssain <aymane.bahssain@st.com>
1 parent b26bd94 commit fc41427

6 files changed

Lines changed: 1327 additions & 188 deletions

File tree

‎cores/arduino/stm32/stm32yyxx_hal_conf.h‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,16 @@
5454
#define USE_HAL_I2S_MODULE 1U
5555
#endif
5656

57+
#if defined(HAL_I3C_MODULE_DISABLED)
58+
#if defined(USE_HAL_I3C_MODULE)
59+
#undef USE_HAL_I3C_MODULE
60+
#endif
61+
#define USE_HAL_I3C_MODULE 0U
62+
#else
63+
#define USE_HAL_I3C_MODULE 1U
64+
#define USE_HAL_I3C_GET_LAST_ERRORS 0U
65+
#endif
66+
5767
#if defined(HAL_RTC_MODULE_DISABLED)
5868
#if defined(USE_HAL_RTC_MODULE)
5969
#undef USE_HAL_RTC_MODULE

‎libraries/I3C/examples/Controller_Target/TargetReceive/TargetReceive.ino‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ void setup() {
3030
Serial.print("DA = 0x");
3131
Serial.println(I3C.address(), HEX);
3232

33-
HAL_I3C_FlushAllFifo(I3C.halHandle());
33+
int rc = I3C.flushAllFifos();
34+
Serial.print("flushAllFifos rc = ");
35+
Serial.println(rc);
3436

35-
int rc = I3C.receive(rxBuf, sizeof(rxBuf), 10000);
37+
rc = I3C.receive(rxBuf, sizeof(rxBuf), 10000);
3638
Serial.print("receive rc = ");
3739
Serial.println(rc);
3840

0 commit comments

Comments
 (0)