UTILS I3C Timing How to Use ¶
- group UTILS_I3C_How_To_Use
-
How to use the UTILS I3C Timing module ¶
Configure the I3C peripheral:
Set up the I3C hardware (clock source, GPIO, NVIC) as required for the STM32 device.
Choose the timing configuration mode:
Controller mode:
Fill a
stm32_utils_i3c_ctrl_timing_config_tstructure with the clock source frequency, desired I3C push-pull and I2C open-drain bus speeds, duty cycle, activity state, and bus type (pure I3C or mixed I3C/I2C).Call
STM32_UTILS_I3C_CTRL_ComputeTiming()to compute the values for I3C_TIMINGR0 and I3C_TIMINGR1.
Target mode:
Fill a
stm32_utils_i3c_tgt_timing_config_tstructure with the clock source frequency.Call
STM32_UTILS_I3C_TGT_ComputeTiming()to compute the value for I3C_TIMINGR1.
Select the mode based on whether the I3C peripheral operates as a controller or a target.
Apply the timing to the I3C peripheral:
Use the computed timing values to configure the I3C instance using the HAL or LL driver, or by direct register access.
For low-level or performance-critical use cases, write the computed values directly to the I3C_TIMINGR0 and I3C_TIMINGR1 registers.