Skip to content

Commit dd18719

Browse files
author
ExaltZephyr
committed
drivers: i3c: Support I3C driver for STM32.
This commit introduces support for the I3C driver on STM32, enabling functionality APIs for I3C controllers. Signed-off-by: ExaltZephyr <[email protected]>
1 parent 27456ed commit dd18719

File tree

9 files changed

+2553
-1
lines changed

9 files changed

+2553
-1
lines changed

boards/st/nucleo_h563zi/nucleo_h563zi-common.dtsi

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@
7878
status = "okay";
7979
};
8080

81+
&i3c1 {
82+
pinctrl-0 = <&i3c1_scl_pd12 &i3c1_sda_pd13>;
83+
i3c-scl-hz = <12500000>;
84+
i2c-scl-hz = <400000>;
85+
status = "okay";
86+
};
87+
8188
&rcc {
8289
clocks = <&pll>;
8390
clock-frequency = <DT_FREQ_M(240)>;

boards/st/nucleo_h563zi/nucleo_h563zi.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ supported:
2525
- usb_device
2626
- rtc
2727
- i2c
28+
- i3c
2829
vendor: st

drivers/i3c/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ zephyr_library_sources_ifdef(
4141
i3c_npcx.c
4242
)
4343

44+
zephyr_library_sources_ifdef(
45+
CONFIG_I3C_STM32
46+
i3c_stm32.c
47+
)
48+
4449
zephyr_library_sources_ifdef(
4550
CONFIG_I3C_TEST
4651
i3c_test.c

drivers/i3c/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,5 +118,6 @@ rsource "Kconfig.nxp"
118118
rsource "Kconfig.cdns"
119119
rsource "Kconfig.npcx"
120120
rsource "Kconfig.test"
121+
rsource "Kconfig.stm32"
121122

122123
endif # I3C

drivers/i3c/Kconfig.stm32

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Copyright (c) 2024 Your Company
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
DT_COMPAT_STM32_I3C := st,stm32-i3c
6+
module = I3C_STM32
7+
module-str = i3c_stm32
8+
9+
source "subsys/logging/Kconfig.template.log_config"
10+
config I3C_STM32
11+
bool "STM32 I3C driver support"
12+
depends on DT_HAS_ST_STM32_I3C_ENABLED
13+
select USE_STM32_HAL_I3C
14+
default y
15+
help
16+
Enable support for I3C on STM32 microcontrollers.
17+
18+
config I3C_STM32_POLL
19+
bool "Enables I3C polling mode"
20+
depends on I3C_STM32
21+
default n
22+
help
23+
Enables polling mode for I3C on STM32 microcontrollers.
24+
25+
config I3C_STM32_DMA
26+
bool "STM32 I3C DMA driver support"
27+
depends on I3C_STM32 && DMA_STM32U5 && !I3C_STM32_POLL
28+
help
29+
Enables support for I3C DMA mode on STM32 microcontrollers.
30+
This option is incompatible with I3C_STM32_POLL
31+
32+
config I3C_STM32_DMA_FIFO_HEAP_SIZE
33+
int "Status FIFO and control FIFO heap"
34+
depends on I3C_STM32_DMA
35+
default 2048
36+
help
37+
Configures the heap size for dynamically allocating the regions for
38+
storing status FIFO and control FIFO words which will be used by the DMA.
39+
This value depends on the maximum number of messages that will be sent
40+
during a single transfer. 2KB guarantees enough heap size for sending 256
41+
messages on a single transfer.

0 commit comments

Comments
 (0)