Skip to content

Commit 478a55f

Browse files
authored
Merge pull request #3023 from Aymane-ST/c5_i3C_support
Add STM32C5 support to I3C with dual HAL V1/V2 compatibility
2 parents 8a81c63 + 638af74 commit 478a55f

7 files changed

Lines changed: 1329 additions & 199 deletions

File tree

‎CI/build/examples/BareMinimum/BareMinimum.ino‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <SPI.h>
1616
#include <SoftwareSerial.h>
1717
#include <Wire.h>
18-
#if (defined(I3C1_BASE) || defined(I3C2_BASE)) && defined(HAL_I3C_MODULE_ENABLED)
18+
#if defined(I3C1_BASE) || defined(I3C2_BASE)
1919
#include <I3C.h>
2020
#endif
2121

@@ -137,7 +137,7 @@ void setup() {
137137
Wire.requestFrom(2, 1);
138138
Wire.end();
139139

140-
#if (defined(I3C1_BASE) || defined(I3C2_BASE)) && defined(HAL_I3C_MODULE_ENABLED)
140+
#if defined(I3C1_BASE) || defined(I3C2_BASE)
141141
// I3C
142142
I3C.setBusType(I3CBusType::Pure);
143143
I3C.setMixedBusOpenDrainFrequency(1000000U);

‎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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ void setup() {
3030
Serial.print("DA = 0x");
3131
Serial.println(I3C.address(), HEX);
3232

33-
HAL_I3C_FlushAllFifo(I3C.halHandle());
33+
Serial.printf("flushAllFifos = %s\n", (I3C.flushAllFifos()) ? "true" : "false");
3434

3535
int rc = I3C.receive(rxBuf, sizeof(rxBuf), 10000);
3636
Serial.print("receive rc = ");

0 commit comments

Comments
 (0)