/**
**********************************************************************************************************************
* @file stm32h5xx_hal_i3c.c
* @author MCD Application Team
* @brief I3C HAL module driver.
* This file provides firmware functions to manage the following
* functionalities of the Improvement Inter Integrated Circuit (I3C) peripheral:
* + Initialization and de-initialization functions
* + IO operation functions
* + Peripheral State and Errors functions
*
**********************************************************************************************************************
* @attention
*
* Copyright (c) 2023 STMicroelectronics.
* All rights reserved.
*
* This software is licensed under terms that can be found in the LICENSE file
* in the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
**********************************************************************************************************************
@verbatim
======================================================================================================================
##### How to use this driver #####
======================================================================================================================
[..]
The I3C HAL driver can be used as follows:
(#) Declare a I3C_HandleTypeDef handle structure, for example:
I3C_HandleTypeDef hi3c;
(#) Declare a I3C_XferTypeDef transfer descriptor structure, for example:
I3C_XferTypeDef ContextBuffers;
(#)Initialize the I3C low level resources by implementing the HAL_I3C_MspInit() API:
(##) Enable the I3Cx interface clock
(##) I3C pins configuration
(+++) Enable the clock for the I3C GPIOs
(+++) Configure I3C pins as alternate function push-pull with no-pull
(##) NVIC configuration if you need to use interrupt process
(+++) Configure the I3Cx interrupt priority
(+++) Enable the NVIC I3C IRQ Channel
(##) DMA Configuration if you need to use DMA process
(+++) Declare a DMA_HandleTypeDef handle structure for
the Command Common Code (CCC) management channel
(+++) Declare a DMA_HandleTypeDef handle structure for
the transmit channel
(+++) Declare a DMA_HandleTypeDef handle structure for
the receive channel
(+++) Declare a DMA_HandleTypeDef handle structure for
the status channel
(+++) Enable the DMAx interface clock
(+++) Configure the DMA handle parameters
(+++) Configure the DMA Command Common Code (CCC) channel
(+++) Configure the DMA Tx channel
(+++) Configure the DMA Rx channel
(+++) Configure the DMA Status channel
(+++) Associate the initialized DMA handle to the hi3c DMA CCC, Tx, Rx or Status handle as necessary
(+++) Configure the priority and enable the NVIC for the transfer complete interrupt on
the DMA CCC, Tx, Rx or Status instance
(#) Configure the HAL I3C Communication Mode as Controller or Target in the hi3c Init structure.
(#) Configure the Controller Communication Bus characterics for Controller mode.
This mean, configure the parameters SDAHoldTime, WaitTime, SCLPPLowDuration,
SCLI3CHighDuration, SCLODLowDuration, SCLI2CHighDuration, BusFreeDuration,
BusIdleDuration in the LL_I3C_CtrlBusConfTypeDef structure through h3c Init structure.
(#) Configure the Target Communication Bus characterics for Target mode.
This mean, configure the parameter BusAvailableDuration in the LL_I3C_TgtBusConfTypeDef structure
through h3c Init structure.
All these parameters for Controller or Target can be configured directly in user code or
by using CubeMx generation.
To help the computation of the different parameters, the recommendation is to use CubeMx.
Those parameters can be modified after the hi3c initialization by using
HAL_I3C_Ctrl_BusCharacteristicConfig() for controller and
HAL_I3C_Tgt_BusCharacteristicConfig() for target.
(#) Initialize the I3C registers by calling the HAL_I3C_Init(), configures also the low level Hardware
(GPIO, CLOCK, NVIC...etc) by calling the customized HAL_I3C_MspInit(&hi3c) API.
(#) Configure the different FIFO parameters in I3C_FifoConfTypeDef structure as RxFifoThreshold, TxFifoThreshold
for Controller or Target mode.
And enable/disable the Control or Status FIFO only for Controller Mode.
Use HAL_I3C_SetConfigFifo() function to finalize the configuration, and HAL_I3C_GetConfigFifo() to retrieve
FIFO configuration.
Possibility to clear the FIFO configuration by using HAL_I3C_ClearConfigFifo() which reset the configuration
FIFO to their default hardware value
(#) Configure the different additional Controller configuration in I3C_CtrlConfTypeDef structure as DynamicAddr,
StallTime, HotJoinAllowed, ACKStallState, CCCStallState, TxStallState, RxStallState, HighKeeperSDA.
Use HAL_I3C_Ctrl_Config() function to finalize the Controller configuration.
(#) Configure the different additional Target configuration in I3C_TgtConfTypeDef structure as Identifier,
MIPIIdentifier, CtrlRoleRequest, HotJoinRequest, IBIRequest, IBIPayload, IBIPayloadSize, MaxReadDataSize,
MaxWriteDataSize, CtrlCapability, GroupAddrCapability, DataTurnAroundDuration, MaxReadTurnAround,
MaxDataSpeed, MaxSpeedLimitation, HandOffActivityState, HandOffDelay, PendingReadMDB.
Use HAL_I3C_Tgt_Config() function to finalize the Target configuration.
(#) Before initiate any IO operation, the application must launch an assignment of the different
Target dynamic address by using HAL_I3C_Ctrl_DynAddrAssign() in polling mode or
HAL_I3C_Ctrl_DynAddrAssign_IT() in interrupt mode.
This procedure is named Enter Dynamic Address Assignment (ENTDAA CCC command).
For the initiation of ENTDAA procedure from the controller, each target connected and powered on the I3C bus
must repond to this particular Command Common Code by sending its proper Payload (a amount of 48bits which
contain the target characteristics)
Each time a target responds to ENTDAA sequence, the application is informed through
HAL_I3C_TgtReqDynamicAddrCallback() of the reception of the target paylaod.
And then application must send a associated dynamic address through HAL_I3C_Ctrl_SetDynAddr().
This procedure in loop automatically in hardware side until a target respond to repeated ENTDAA sequence.
The application is informed of the end of the procedure at reception of HAL_I3C_CtrlDAACpltCallback().
At the end of procedure, the function HAL_I3C_Ctrl_ConfigBusDevices() must be called to store in hardware
register part the target capabilities as Dynamic address, IBI support with or without additional data byte,
Controller role request support, Controller stop transfer after IBI through I3C_DeviceConfTypeDef structure.
(#) Other action to be done, before initiate any IO operation, the application must prepare the different frame
descriptor with its associated buffer allocation in their side.
Configure the different information related to CCC transfer through I3C_CCCTypeDef structure
Configure the different information related to Private or I2C transfer through I3C_PrivateTypeDef structure
Configure the different buffer pointers and associat
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
STM32H562实现emWin 2D绘图【支持STM32H系列单片机】.zip (426个子文件)
stm32h5xx_hal_i3c.c 305KB
stm32h5xx_hal_tim.c 267KB
stm32h5xx_hal_i2c.c 253KB
stm32h5xx_hal_rcc_ex.c 218KB
stm32h5xx_hal_cryp.c 212KB
lib_str.c 200KB
stm32h5xx_hal_dma_ex.c 174KB
stm32h5xx_hal_uart.c 162KB
stm32h5xx_hal_adc.c 150KB
stm32h5xx_hal_mmc.c 140KB
stm32h5xx_hal_usart.c 136KB
stm32h5xx_hal_sd.c 128KB
stm32h5xx_hal_smartcard.c 128KB
stm32h5xx_hal_fdcan.c 123KB
stm32h5xx_hal_tim_ex.c 122KB
lib_mem.c 120KB
stm32h5xx_hal_spi.c 119KB
stm32h5xx_hal_lptim.c 119KB
stm32h5xx_hal_eth.c 116KB
cpu_core.c 112KB
os_task.c 112KB
stm32h5xx_hal_xspi.c 109KB
stm32h5xx_hal_irda.c 108KB
stm32h5xx_hal_hash.c 106KB
stm32h5xx_hal_pka.c 105KB
stm32h5xx_hal_rtc_ex.c 104KB
stm32h5xx_ll_rcc.c 98KB
stm32h5xx_hal_smbus.c 97KB
stm32h5xx_hal_fmac.c 97KB
stm32h5xx_hal_adc_ex.c 96KB
stm32h5xx_hal_sai.c 93KB
os_core.c 92KB
stm32h5xx_hal_i2s.c 88KB
stm32h5xx_hal_rtc.c 85KB
stm32h5xx_hal_hcd.c 84KB
stm32h5xx_hal_nand.c 73KB
stm32h5xx_hal_rcc.c 69KB
os_tmr.c 63KB
stm32h5xx_hal_dac.c 63KB
stm32h5xx_hal_gtzc.c 62KB
stm32h5xx_hal_flash_ex.c 61KB
stm32h5xx_hal_pssi.c 60KB
stm32h5xx_ll_dma.c 59KB
stm32h5xx_ll_sdmmc.c 59KB
stm32h5xx_hal_pcd.c 58KB
stm32h5xx_hal_dma.c 58KB
stm32h5xx_ll_tim.c 57KB
os_flag.c 56KB
stm32h5xx_ll_adc.c 52KB
stm32h5xx_hal_nor.c 52KB
stm32h5xx_hal_dcache.c 50KB
stm32h5xx_hal_cordic.c 46KB
os_mutex.c 45KB
stm32h5xx_hal_dcmi.c 45KB
stm32h5xx_hal_sdram.c 44KB
lcd_ex.c 43KB
stm32h5xx_ll_fmc.c 42KB
stm32h5xx_ll_utils.c 40KB
stm32h5xx_hal_opamp.c 40KB
os_q.c 40KB
stm32h5xx_hal_comp.c 39KB
stm32h5xx_ll_usb.c 39KB
lcd.c 39KB
stm32h5xx_ll_spi.c 38KB
os_sem.c 38KB
stm32h5xx_hal_sram.c 38KB
stm32h5xx_hal_uart_ex.c 37KB
stm32h5xx_hal_ramcfg.c 36KB
stm32h5xx_hal_otfdec.c 36KB
stm32h5xx_hal.c 35KB
stm32h5xx_hal_dac_ex.c 34KB
stm32h5xx_hal_dts.c 34KB
cpu_c.c 33KB
stm32h5xx_hal_cec.c 32KB
stm32h5xx_hal_rng.c 32KB
stm32h5xx_ll_rtc.c 30KB
os_cpu_c.c 30KB
stm32h5xx_hal_flash.c 29KB
stm32h5xx_hal_cortex.c 28KB
stm32h5xx_hal_gpio.c 27KB
stm32h5xx_hal_cryp_ex.c 27KB
stm32h5xx_hal_pwr_ex.c 27KB
stm32h5xx_hal_exti.c 25KB
GUIDRV_Template.c 24KB
stm32h5xx_hal_eth_ex.c 24KB
os_time.c 23KB
os_tick.c 23KB
lib_ascii.c 23KB
stm32h5xx_hal_pwr.c 22KB
stm32h5xx_hal_icache.c 22KB
stm32h5xx_ll_usart.c 21KB
os_stat.c 21KB
os_dbg.c 20KB
touch.c 19KB
stm32h5xx_hal_iwdg.c 18KB
stm32h5xx_hal_crc.c 17KB
stm32h5xx_hal_smartcard_ex.c 16KB
stm32h5xx_hal_usart_ex.c 16KB
os_mem.c 16KB
system_stm32h5xx.c 16KB
共 426 条
- 1
- 2
- 3
- 4
- 5
资源评论
不脱发的程序猿
- 粉丝: 26w+
- 资源: 5872
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功