HAL I3C Overview

Introducing I3C

group I3C_Introduction

The STM32 Hardware Abstraction Layer for I3C provides a comprehensive software interface to support the I3C communication protocol on STM32 microcontrollers. I3C (Improved Inter-Integrated Circuit) is an advanced, high-speed, and energy-efficient serial bus protocol designed to enhance and replace traditional I2C, offering features such as dynamic device management and higher data rates. While I3C maintains backward compatibility with many I2C devices, certain I2C features such as stretch mode are not supported. This HAL driver abstracts low-level hardware details, enabling configuration, data transfer, and interrupt handling, thereby accelerating development and ensuring robust, scalable embedded applications that leverage the full capabilities of the I3C bus.

Module and files

The following diagram illustrates the I3C module and its associated files.

Module and files diagram

Component diagram

The following diagram illustrates the software components involved in the I3C module. It shows the interactions between the user application, HAL drivers, low-level drivers, and the hardware components.


@startuml
<style>
componentDiagram {
   arrow {
      FontSize 8
   }
}
</style>

title I3C Software Component Diagram

package "HAL" {
    [HAL_SERVICE]
    [HAL_I3C]
    [HAL_DMA]
}

package "Low Layer" {
    [LL_I3C]
    [CMSIS]
    [I3C Interrupt routine service]
    [DMA Interrupt routine service]
}

package "HW" {
    [STM32_HW]
}

[Appli] --> [HAL_I3C] : HAL I3C API
[Appli] <-- [HAL_I3C] : I3C callback
[HAL_I3C] --> [LL_I3C] : LL I3C API
[HAL_I3C] -r-> [HAL_DMA] : Configure DMA
[HAL_I3C] -l-> [HAL_SERVICE] : HAL_GetTick
[HAL_I3C] <-- [I3C Interrupt routine service]
[HAL_I3C] <-r- [HAL_DMA]:Half transfer complete\nTransfer complete\nError
[LL_I3C] --> [CMSIS]:I3C register def
[HAL_DMA] <-d- [DMA Interrupt routine service]
[STM32_HW] -u--> [I3C Interrupt routine service]: I3Cx Irq
[STM32_HW] -u--> [DMA Interrupt routine service] : DMA Channel Irq
[STM32_HW] <-u-- [LL_I3C] : I3C registers R/W
@enduml

Configuration table

The following table lists the configuration defines for the HAL I3C module, specifying their locations, default values, and descriptions:

group I3C_Configuration_Table

15. Software configuration

15.1 Software configuration defined in stm32c5xx_hal_conf.h:

Preprocessor flags

Default value

Comment

USE_HAL_I3C_MODULE

1

Enable HAL I3C driver module

USE_HAL_I3C_REGISTER_CALLBACKS

0

Allow user-defined callbacks

USE_HAL_I3C_DMA

1

Enable DMA code inside I3C

USE_HAL_CHECK_PARAM

0

Enable runtime parameter check

USE_HAL_I3C_CLK_ENABLE_MODEL

HAL_CLK_ENABLE_NO

Enable the gating of the peripheral clock

USE_HAL_CHECK_PROCESS_STATE

0

Enable atomicity of process state check

USE_HAL_MUTEX

0

Enable semaphore creation for OS

USE_HAL_I3C_USER_DATA

0

Add user data inside HAL I3C handle

USE_HAL_I3C_GET_LAST_ERRORS

0

Enable retrieval of last process error codes

15.2 Software configuration defined in preprocessor environment:

Preprocessor flags

Default value

Comment

USE_ASSERT_DBG_PARAM

Not defined

Enable check param for HAL and LL

USE_ASSERT_DBG_STATE

Not defined

Enable check state for HAL