Skip to content

Commit

Permalink
drivers: i3c: Support I3C driver for STM32.
Browse files Browse the repository at this point in the history
This commit introduces support for the I3C driver on STM32, enabling functionality APIs for I3C controllers.

Signed-off-by: ExaltZephyr <[email protected]>
  • Loading branch information
ExaltZephyr committed Nov 10, 2024
1 parent 27456ed commit dd18719
Show file tree
Hide file tree
Showing 9 changed files with 2,553 additions and 1 deletion.
7 changes: 7 additions & 0 deletions boards/st/nucleo_h563zi/nucleo_h563zi-common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@
status = "okay";
};

&i3c1 {
pinctrl-0 = <&i3c1_scl_pd12 &i3c1_sda_pd13>;

Check warning on line 82 in boards/st/nucleo_h563zi/nucleo_h563zi-common.dtsi

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

boards/st/nucleo_h563zi/nucleo_h563zi-common.dtsi:82 please, no spaces at the start of a line
i3c-scl-hz = <12500000>;

Check warning on line 83 in boards/st/nucleo_h563zi/nucleo_h563zi-common.dtsi

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

boards/st/nucleo_h563zi/nucleo_h563zi-common.dtsi:83 please, no spaces at the start of a line
i2c-scl-hz = <400000>;

Check warning on line 84 in boards/st/nucleo_h563zi/nucleo_h563zi-common.dtsi

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

boards/st/nucleo_h563zi/nucleo_h563zi-common.dtsi:84 please, no spaces at the start of a line
status = "okay";

Check warning on line 85 in boards/st/nucleo_h563zi/nucleo_h563zi-common.dtsi

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

boards/st/nucleo_h563zi/nucleo_h563zi-common.dtsi:85 please, no spaces at the start of a line
};

&rcc {
clocks = <&pll>;
clock-frequency = <DT_FREQ_M(240)>;
Expand Down
1 change: 1 addition & 0 deletions boards/st/nucleo_h563zi/nucleo_h563zi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ supported:
- usb_device
- rtc
- i2c
- i3c
vendor: st
5 changes: 5 additions & 0 deletions drivers/i3c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ zephyr_library_sources_ifdef(
i3c_npcx.c
)

zephyr_library_sources_ifdef(
CONFIG_I3C_STM32
i3c_stm32.c
)

zephyr_library_sources_ifdef(
CONFIG_I3C_TEST
i3c_test.c
Expand Down
1 change: 1 addition & 0 deletions drivers/i3c/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,6 @@ rsource "Kconfig.nxp"
rsource "Kconfig.cdns"
rsource "Kconfig.npcx"
rsource "Kconfig.test"
rsource "Kconfig.stm32"

endif # I3C
41 changes: 41 additions & 0 deletions drivers/i3c/Kconfig.stm32
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright (c) 2024 Your Company
#
# SPDX-License-Identifier: Apache-2.0

DT_COMPAT_STM32_I3C := st,stm32-i3c
module = I3C_STM32
module-str = i3c_stm32

source "subsys/logging/Kconfig.template.log_config"
config I3C_STM32
bool "STM32 I3C driver support"

Check warning on line 11 in drivers/i3c/Kconfig.stm32

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

drivers/i3c/Kconfig.stm32:11 please, no spaces at the start of a line
depends on DT_HAS_ST_STM32_I3C_ENABLED

Check warning on line 12 in drivers/i3c/Kconfig.stm32

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

drivers/i3c/Kconfig.stm32:12 please, no spaces at the start of a line
select USE_STM32_HAL_I3C

Check warning on line 13 in drivers/i3c/Kconfig.stm32

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

drivers/i3c/Kconfig.stm32:13 please, no spaces at the start of a line
default y

Check warning on line 14 in drivers/i3c/Kconfig.stm32

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

drivers/i3c/Kconfig.stm32:14 please, no spaces at the start of a line
help

Check warning on line 15 in drivers/i3c/Kconfig.stm32

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

drivers/i3c/Kconfig.stm32:15 please, no spaces at the start of a line
Enable support for I3C on STM32 microcontrollers.

Check warning on line 16 in drivers/i3c/Kconfig.stm32

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

drivers/i3c/Kconfig.stm32:16 please, no spaces at the start of a line

config I3C_STM32_POLL
bool "Enables I3C polling mode"
depends on I3C_STM32
default n
help
Enables polling mode for I3C on STM32 microcontrollers.

config I3C_STM32_DMA
bool "STM32 I3C DMA driver support"
depends on I3C_STM32 && DMA_STM32U5 && !I3C_STM32_POLL
help
Enables support for I3C DMA mode on STM32 microcontrollers.
This option is incompatible with I3C_STM32_POLL

config I3C_STM32_DMA_FIFO_HEAP_SIZE
int "Status FIFO and control FIFO heap"
depends on I3C_STM32_DMA
default 2048
help
Configures the heap size for dynamically allocating the regions for
storing status FIFO and control FIFO words which will be used by the DMA.
This value depends on the maximum number of messages that will be sent
during a single transfer. 2KB guarantees enough heap size for sending 256
messages on a single transfer.
Loading

0 comments on commit dd18719

Please sign in to comment.