18#ifndef __ST_HAL_I2C_H__
19#define __ST_HAL_I2C_H__
31#define HAL_I2C_ERROR_NONE 0x00000000U
32#define HAL_I2C_ERROR_BERR 0x00000001U
33#define HAL_I2C_ERROR_ARLO 0x00000002U
34#define HAL_I2C_ERROR_AF 0x00000004U
35#define HAL_I2C_ERROR_OVR 0x00000008U
36#define HAL_I2C_ERROR_DMA 0x00000010U
37#define HAL_I2C_ERROR_TIMEOUT 0x00000020U
38#define HAL_I2C_ERROR_SIZE 0x00000040U
39#define HAL_I2C_ERROR_DMA_PARAM 0x00000080U
40#define HAL_I2C_WRONG_START 0x00000200U
42#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)
43# define HAL_I2C_ERROR_INVALID_CALLBACK 0x00000100U
48#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)
49# define __HAL_I2C_RESET_HANDLE_STATE(__HANDLE__) \
51 (__HANDLE__)->State = HAL_I2C_STATE_RESET; \
52 (__HANDLE__)->MspInitCallback = NULL; \
53 (__HANDLE__)->MspDeInitCallback = NULL; \
56# define __HAL_I2C_RESET_HANDLE_STATE(__HANDLE__) \
57 ((__HANDLE__)->State = HAL_I2C_STATE_RESET)
96#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)
97typedef struct __I2C_HandleTypeDef {
119#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)
120 void (*MasterTxCpltCallback)(
struct __I2C_HandleTypeDef *hi2c);
121 void (*MasterRxCpltCallback)(
struct __I2C_HandleTypeDef *hi2c);
122 void (*SlaveTxCpltCallback)(
struct __I2C_HandleTypeDef *hi2c);
123 void (*SlaveRxCpltCallback)(
struct __I2C_HandleTypeDef *hi2c);
124 void (*ListenCpltCallback)(
struct __I2C_HandleTypeDef *hi2c);
125 void (*MemTxCpltCallback)(
struct __I2C_HandleTypeDef *hi2c);
126 void (*MemRxCpltCallback)(
struct __I2C_HandleTypeDef *hi2c);
127 void (*ErrorCallback)(
struct __I2C_HandleTypeDef *hi2c);
128 void (*AbortCpltCallback)(
struct __I2C_HandleTypeDef *hi2c);
129 void (*AddrCallback)(
struct __I2C_HandleTypeDef *hi2c,
131 void (*MspInitCallback)(
struct __I2C_HandleTypeDef *hi2c);
132 void (*MspDeInitCallback)(
struct __I2C_HandleTypeDef *hi2c);
136#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)
138 HAL_I2C_MASTER_TX_COMPLETE_CB_ID = 0x00U,
139 HAL_I2C_MASTER_RX_COMPLETE_CB_ID = 0x01U,
140 HAL_I2C_SLAVE_TX_COMPLETE_CB_ID = 0x02U,
141 HAL_I2C_SLAVE_RX_COMPLETE_CB_ID = 0x03U,
142 HAL_I2C_LISTEN_COMPLETE_CB_ID = 0x04U,
143 HAL_I2C_MEM_TX_COMPLETE_CB_ID = 0x05U,
144 HAL_I2C_MEM_RX_COMPLETE_CB_ID = 0x06U,
145 HAL_I2C_ERROR_CB_ID = 0x07U,
146 HAL_I2C_ABORT_CB_ID = 0x08U,
148 HAL_I2C_MSPINIT_CB_ID = 0x09U,
149 HAL_I2C_MSPDEINIT_CB_ID = 0x0AU,
150} HAL_I2C_CallbackIDTypeDef;
162#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)
168 HAL_I2C_CallbackIDTypeDef CallbackID,
169 pI2C_CallbackTypeDef pCallback);
unsigned short uint16_t
Definition lvgl.h:41
unsigned int uint32_t
Definition lvgl.h:43
unsigned char uint8_t
Definition lvgl.h:40
HAL_StatusTypeDef
Definition sthal_def.h:65
HAL_LockTypeDef
Definition sthal_def.h:72
HAL_StatusTypeDef HAL_I2C_Master_Seq_Receive_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t XferOptions)
Definition sthal_i2c.c:515
void HAL_I2C_EV_IRQHandler(I2C_HandleTypeDef *hi2c)
Definition sthal_i2c.c:575
HAL_StatusTypeDef HAL_I2C_Slave_Seq_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, uint32_t XferOptions)
Definition sthal_i2c.c:538
HAL_StatusTypeDef HAL_I2C_Mem_Write_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size)
Definition sthal_i2c.c:475
HAL_I2C_ModeTypeDef HAL_I2C_GetMode(I2C_HandleTypeDef *hi2c)
Definition sthal_i2c.c:652
HAL_StatusTypeDef HAL_I2C_Slave_Seq_Receive_IT(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, uint32_t XferOptions)
Definition sthal_i2c.c:545
void HAL_I2C_ListenCpltCallback(I2C_HandleTypeDef *hi2c)
Definition sthal_i2c.c:615
HAL_StatusTypeDef HAL_I2C_Mem_Read_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size)
Definition sthal_i2c.c:467
HAL_StatusTypeDef HAL_I2C_Master_Receive_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size)
Definition sthal_i2c.c:424
HAL_StatusTypeDef HAL_I2C_Master_Receive_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size)
Definition sthal_i2c.c:398
void HAL_I2C_MspDeInit(I2C_HandleTypeDef *hi2c)
Definition sthal_i2c.c:183
HAL_StatusTypeDef HAL_I2CEx_ConfigAnalogFilter(I2C_HandleTypeDef *hi2c, uint32_t AnalogFilter)
Definition sthal_i2c.c:662
HAL_StatusTypeDef HAL_I2C_Mem_Write(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size, uint32_t Timeout)
Definition sthal_i2c.c:443
void HAL_I2C_AddrCallback(I2C_HandleTypeDef *hi2c, uint8_t TransferDirection, uint16_t AddrMatchCode)
Definition sthal_i2c.c:604
HAL_StatusTypeDef HAL_I2CEx_ConfigDigitalFilter(I2C_HandleTypeDef *hi2c, uint32_t DigitalFilter)
Definition sthal_i2c.c:668
HAL_StatusTypeDef HAL_I2C_Slave_Receive_IT(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size)
Definition sthal_i2c.c:411
HAL_StatusTypeDef HAL_I2C_Master_Transmit_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size)
Definition sthal_i2c.c:391
void HAL_I2C_ErrorCallback(I2C_HandleTypeDef *hi2c)
Definition sthal_i2c.c:636
void HAL_I2C_MasterRxCpltCallback(I2C_HandleTypeDef *hi2c)
Definition sthal_i2c.c:586
HAL_StatusTypeDef HAL_I2C_Slave_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size)
Definition sthal_i2c.c:431
uint32_t HAL_I2C_GetError(I2C_HandleTypeDef *hi2c)
Definition sthal_i2c.c:657
HAL_StatusTypeDef HAL_I2C_Master_Seq_Transmit_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t XferOptions)
Definition sthal_i2c.c:499
HAL_StatusTypeDef HAL_I2C_Master_Receive(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout)
Definition sthal_i2c.c:371
HAL_StatusTypeDef HAL_I2C_Slave_Seq_Transmit_IT(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, uint32_t XferOptions)
Definition sthal_i2c.c:531
void HAL_I2C_ER_IRQHandler(I2C_HandleTypeDef *hi2c)
Definition sthal_i2c.c:577
HAL_StatusTypeDef HAL_I2C_Mem_Read(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size, uint32_t Timeout)
Definition sthal_i2c.c:451
void HAL_I2C_SlaveTxCpltCallback(I2C_HandleTypeDef *hi2c)
Definition sthal_i2c.c:592
HAL_StatusTypeDef HAL_I2C_Master_Seq_Receive_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t XferOptions)
Definition sthal_i2c.c:523
void HAL_I2C_MemTxCpltCallback(I2C_HandleTypeDef *hi2c)
Definition sthal_i2c.c:622
HAL_StatusTypeDef HAL_I2C_Slave_Transmit(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, uint32_t Timeout)
Definition sthal_i2c.c:378
HAL_StatusTypeDef HAL_I2C_Slave_Receive(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, uint32_t Timeout)
Definition sthal_i2c.c:385
HAL_StatusTypeDef HAL_I2C_Master_Transmit(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout)
Definition sthal_i2c.c:364
HAL_StatusTypeDef HAL_I2C_Master_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size)
Definition sthal_i2c.c:417
HAL_StatusTypeDef HAL_I2C_Init(I2C_HandleTypeDef *hi2c)
Definition sthal_i2c.c:107
void HAL_I2C_MasterTxCpltCallback(I2C_HandleTypeDef *hi2c)
Definition sthal_i2c.c:580
void HAL_I2C_AbortCpltCallback(I2C_HandleTypeDef *hi2c)
Definition sthal_i2c.c:642
HAL_StatusTypeDef HAL_I2C_Mem_Read_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size)
Definition sthal_i2c.c:484
HAL_StatusTypeDef HAL_I2C_Mem_Write_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size)
Definition sthal_i2c.c:459
HAL_StatusTypeDef HAL_I2C_Slave_Transmit_IT(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size)
Definition sthal_i2c.c:405
HAL_StatusTypeDef HAL_I2C_DeInit(I2C_HandleTypeDef *hi2c)
Definition sthal_i2c.c:148
void HAL_I2C_MspInit(I2C_HandleTypeDef *hi2c)
Definition sthal_i2c.c:177
void HAL_I2C_MemRxCpltCallback(I2C_HandleTypeDef *hi2c)
Definition sthal_i2c.c:629
HAL_StatusTypeDef HAL_I2C_Master_Seq_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t XferOptions)
Definition sthal_i2c.c:507
HAL_StatusTypeDef HAL_I2C_Master_Abort_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress)
Definition sthal_i2c.c:569
HAL_I2C_StateTypeDef HAL_I2C_GetState(I2C_HandleTypeDef *hi2c)
Definition sthal_i2c.c:647
HAL_StatusTypeDef HAL_I2C_EnableListen_IT(I2C_HandleTypeDef *hi2c)
Definition sthal_i2c.c:559
HAL_StatusTypeDef HAL_I2C_Slave_Receive_DMA(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size)
Definition sthal_i2c.c:437
HAL_StatusTypeDef HAL_I2C_IsDeviceReady(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint32_t Trials, uint32_t Timeout)
Definition sthal_i2c.c:492
void HAL_I2C_SlaveRxCpltCallback(I2C_HandleTypeDef *hi2c)
Definition sthal_i2c.c:598
HAL_StatusTypeDef HAL_I2C_Slave_Seq_Receive_DMA(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, uint32_t XferOptions)
Definition sthal_i2c.c:552
HAL_StatusTypeDef HAL_I2C_DisableListen_IT(I2C_HandleTypeDef *hi2c)
Definition sthal_i2c.c:564
HAL_I2C_ModeTypeDef
Definition sthal_i2c.h:78
@ HAL_I2C_MODE_MASTER
Definition sthal_i2c.h:80
@ HAL_I2C_MODE_MEM
Definition sthal_i2c.h:82
@ HAL_I2C_MODE_SLAVE
Definition sthal_i2c.h:81
@ HAL_I2C_MODE_NONE
Definition sthal_i2c.h:79
vsf_i2c_t I2C_TypeDef
Definition sthal_i2c.h:62
HAL_I2C_StateTypeDef
Definition sthal_i2c.h:64
@ HAL_I2C_STATE_BUSY
Definition sthal_i2c.h:67
@ HAL_I2C_STATE_LISTEN
Definition sthal_i2c.h:70
@ HAL_I2C_STATE_BUSY_TX_LISTEN
Definition sthal_i2c.h:71
@ HAL_I2C_STATE_ABORT
Definition sthal_i2c.h:73
@ HAL_I2C_STATE_TIMEOUT
Definition sthal_i2c.h:74
@ HAL_I2C_STATE_BUSY_RX
Definition sthal_i2c.h:69
@ HAL_I2C_STATE_BUSY_RX_LISTEN
Definition sthal_i2c.h:72
@ HAL_I2C_STATE_RESET
Definition sthal_i2c.h:65
@ HAL_I2C_STATE_BUSY_TX
Definition sthal_i2c.h:68
@ HAL_I2C_STATE_READY
Definition sthal_i2c.h:66
@ HAL_I2C_STATE_ERROR
Definition sthal_i2c.h:75
Definition sthal_dma.h:103
Definition sthal_i2c.h:99
volatile uint32_t EventCount
Definition sthal_i2c.h:117
volatile uint16_t XferCount
Definition sthal_i2c.h:105
uint16_t XferSize
Definition sthal_i2c.h:104
uint8_t * pBuffPtr
Definition sthal_i2c.h:103
volatile uint32_t Devaddress
Definition sthal_i2c.h:114
volatile HAL_I2C_StateTypeDef State
Definition sthal_i2c.h:111
I2C_InitTypeDef Init
Definition sthal_i2c.h:102
volatile HAL_I2C_ModeTypeDef Mode
Definition sthal_i2c.h:112
volatile uint32_t MemaddSize
Definition sthal_i2c.h:116
volatile uint32_t XferOptions
Definition sthal_i2c.h:106
DMA_HandleTypeDef * hdmarx
Definition sthal_i2c.h:109
I2C_TypeDef * Instance
Definition sthal_i2c.h:101
DMA_HandleTypeDef * hdmatx
Definition sthal_i2c.h:108
volatile uint32_t Memaddress
Definition sthal_i2c.h:115
HAL_LockTypeDef Lock
Definition sthal_i2c.h:110
volatile uint32_t ErrorCode
Definition sthal_i2c.h:113
volatile uint32_t PreviousState
Definition sthal_i2c.h:107
Definition sthal_i2c.h:85
uint32_t GeneralCallMode
Definition sthal_i2c.h:92
uint32_t NoStretchMode
Definition sthal_i2c.h:93
uint32_t ClockSpeed
Definition sthal_i2c.h:86
uint32_t AddressingMode
Definition sthal_i2c.h:89
uint32_t OwnAddress2
Definition sthal_i2c.h:91
uint32_t DutyCycle
Definition sthal_i2c.h:87
uint32_t OwnAddress1
Definition sthal_i2c.h:88
uint32_t DualAddressMode
Definition sthal_i2c.h:90
Definition vsf_template_i2c.h:334