STM32L486xx HAL User Manual
Functions
I2C Private Functions
I2C

Functions

static void I2C_DMAMasterTransmitCplt (DMA_HandleTypeDef *hdma)
 DMA I2C master transmit process complete callback.
static void I2C_DMAMasterReceiveCplt (DMA_HandleTypeDef *hdma)
 DMA I2C master receive process complete callback.
static void I2C_DMASlaveTransmitCplt (DMA_HandleTypeDef *hdma)
 DMA I2C slave transmit process complete callback.
static void I2C_DMASlaveReceiveCplt (DMA_HandleTypeDef *hdma)
 DMA I2C slave receive process complete callback.
static void I2C_DMAError (DMA_HandleTypeDef *hdma)
 DMA I2C communication error callback.
static void I2C_DMAAbort (DMA_HandleTypeDef *hdma)
 DMA I2C communication abort callback (To be called at end of DMA Abort procedure).
static void I2C_ITAddrCplt (I2C_HandleTypeDef *hi2c, uint32_t ITFlags)
 I2C Address complete process callback.
static void I2C_ITMasterSequentialCplt (I2C_HandleTypeDef *hi2c)
 I2C Master sequential complete process.
static void I2C_ITSlaveSequentialCplt (I2C_HandleTypeDef *hi2c)
 I2C Slave sequential complete process.
static void I2C_ITMasterCplt (I2C_HandleTypeDef *hi2c, uint32_t ITFlags)
 I2C Master complete process.
static void I2C_ITSlaveCplt (I2C_HandleTypeDef *hi2c, uint32_t ITFlags)
 I2C Slave complete process.
static void I2C_ITListenCplt (I2C_HandleTypeDef *hi2c, uint32_t ITFlags)
 I2C Listen complete process.
static void I2C_ITError (I2C_HandleTypeDef *hi2c, uint32_t ErrorCode)
 I2C interrupts error process.
static HAL_StatusTypeDef I2C_RequestMemoryWrite (I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint32_t Timeout, uint32_t Tickstart)
 Master sends target device address followed by internal memory address for write request.
static HAL_StatusTypeDef I2C_RequestMemoryRead (I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint32_t Timeout, uint32_t Tickstart)
 Master sends target device address followed by internal memory address for read request.
static HAL_StatusTypeDef I2C_Master_ISR_IT (struct __I2C_HandleTypeDef *hi2c, uint32_t ITFlags, uint32_t ITSources)
 Interrupt Sub-Routine which handle the Interrupt Flags Master Mode with Interrupt.
static HAL_StatusTypeDef I2C_Slave_ISR_IT (struct __I2C_HandleTypeDef *hi2c, uint32_t ITFlags, uint32_t ITSources)
 Interrupt Sub-Routine which handle the Interrupt Flags Slave Mode with Interrupt.
static HAL_StatusTypeDef I2C_Master_ISR_DMA (struct __I2C_HandleTypeDef *hi2c, uint32_t ITFlags, uint32_t ITSources)
 Interrupt Sub-Routine which handle the Interrupt Flags Master Mode with DMA.
static HAL_StatusTypeDef I2C_Slave_ISR_DMA (struct __I2C_HandleTypeDef *hi2c, uint32_t ITFlags, uint32_t ITSources)
 Interrupt Sub-Routine which handle the Interrupt Flags Slave Mode with DMA.
static HAL_StatusTypeDef I2C_WaitOnFlagUntilTimeout (I2C_HandleTypeDef *hi2c, uint32_t Flag, FlagStatus Status, uint32_t Timeout, uint32_t Tickstart)
 This function handles I2C Communication Timeout.
static HAL_StatusTypeDef I2C_WaitOnTXISFlagUntilTimeout (I2C_HandleTypeDef *hi2c, uint32_t Timeout, uint32_t Tickstart)
 This function handles I2C Communication Timeout for specific usage of TXIS flag.
static HAL_StatusTypeDef I2C_WaitOnRXNEFlagUntilTimeout (I2C_HandleTypeDef *hi2c, uint32_t Timeout, uint32_t Tickstart)
 This function handles I2C Communication Timeout for specific usage of RXNE flag.
static HAL_StatusTypeDef I2C_WaitOnSTOPFlagUntilTimeout (I2C_HandleTypeDef *hi2c, uint32_t Timeout, uint32_t Tickstart)
 This function handles I2C Communication Timeout for specific usage of STOP flag.
static HAL_StatusTypeDef I2C_IsAcknowledgeFailed (I2C_HandleTypeDef *hi2c, uint32_t Timeout, uint32_t Tickstart)
 This function handles Acknowledge failed detection during an I2C Communication.
static void I2C_Enable_IRQ (I2C_HandleTypeDef *hi2c, uint16_t InterruptRequest)
 Manage the enabling of Interrupts.
static void I2C_Disable_IRQ (I2C_HandleTypeDef *hi2c, uint16_t InterruptRequest)
 Manage the disabling of Interrupts.
static void I2C_Flush_TXDR (I2C_HandleTypeDef *hi2c)
 I2C Tx data register flush process.
static void I2C_TransferConfig (I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t Size, uint32_t Mode, uint32_t Request)
 Handles I2Cx communication when starting transfer or during transfer (TC or TCR flag are set).

Function Documentation

static void I2C_Disable_IRQ ( I2C_HandleTypeDef hi2c,
uint16_t  InterruptRequest 
) [static]
static void I2C_DMAAbort ( DMA_HandleTypeDef hdma) [static]
static void I2C_DMAError ( DMA_HandleTypeDef hdma) [static]
static void I2C_DMAMasterReceiveCplt ( DMA_HandleTypeDef hdma) [static]
static void I2C_DMAMasterTransmitCplt ( DMA_HandleTypeDef hdma) [static]
static void I2C_DMASlaveReceiveCplt ( DMA_HandleTypeDef hdma) [static]

DMA I2C slave receive process complete callback.

Parameters:
hdmaDMA handle
Return values:
None

Definition at line 5762 of file stm32l4xx_hal_i2c.c.

References I2C_GET_DMA_REMAIN_DATA, I2C_ITSlaveSequentialCplt(), I2C_NO_OPTION_FRAME, __I2C_HandleTypeDef::Instance, and __I2C_HandleTypeDef::XferOptions.

Referenced by HAL_I2C_Slave_Receive_DMA(), and HAL_I2C_Slave_Sequential_Receive_DMA().

static void I2C_DMASlaveTransmitCplt ( DMA_HandleTypeDef hdma) [static]

DMA I2C slave transmit process complete callback.

Parameters:
hdmaDMA handle
Return values:
None

Definition at line 5688 of file stm32l4xx_hal_i2c.c.

References I2C_FIRST_FRAME, I2C_ITSlaveSequentialCplt(), I2C_NEXT_FRAME, __I2C_HandleTypeDef::Instance, and __I2C_HandleTypeDef::XferOptions.

Referenced by HAL_I2C_Slave_Sequential_Transmit_DMA(), and HAL_I2C_Slave_Transmit_DMA().

static void I2C_Enable_IRQ ( I2C_HandleTypeDef hi2c,
uint16_t  InterruptRequest 
) [static]
static void I2C_Flush_TXDR ( I2C_HandleTypeDef hi2c) [static]

I2C Tx data register flush process.

Parameters:
hi2cI2C handle.
Return values:
None

Definition at line 5619 of file stm32l4xx_hal_i2c.c.

References __HAL_I2C_CLEAR_FLAG, __HAL_I2C_GET_FLAG, I2C_FLAG_TXE, I2C_FLAG_TXIS, and __I2C_HandleTypeDef::Instance.

Referenced by I2C_IsAcknowledgeFailed(), I2C_ITMasterCplt(), I2C_ITSlaveCplt(), I2C_Master_ISR_DMA(), I2C_Master_ISR_IT(), I2C_Slave_ISR_DMA(), and I2C_Slave_ISR_IT().

static HAL_StatusTypeDef I2C_IsAcknowledgeFailed ( I2C_HandleTypeDef hi2c,
uint32_t  Timeout,
uint32_t  Tickstart 
) [static]

This function handles Acknowledge failed detection during an I2C Communication.

Parameters:
hi2cPointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C.
TimeoutTimeout duration
TickstartTick start value
Return values:
HALstatus

Definition at line 6012 of file stm32l4xx_hal_i2c.c.

References __HAL_I2C_CLEAR_FLAG, __HAL_I2C_GET_FLAG, __I2C_HandleTypeDef::ErrorCode, HAL_GetTick(), HAL_I2C_ERROR_AF, HAL_I2C_MODE_NONE, HAL_I2C_STATE_READY, I2C_FLAG_AF, I2C_FLAG_STOPF, I2C_Flush_TXDR(), I2C_RESET_CR2, __I2C_HandleTypeDef::Mode, and __I2C_HandleTypeDef::State.

Referenced by I2C_WaitOnRXNEFlagUntilTimeout(), I2C_WaitOnSTOPFlagUntilTimeout(), and I2C_WaitOnTXISFlagUntilTimeout().

static void I2C_ITAddrCplt ( I2C_HandleTypeDef hi2c,
uint32_t  ITFlags 
) [static]
static void I2C_ITError ( I2C_HandleTypeDef hi2c,
uint32_t  ErrorCode 
) [static]
static void I2C_ITListenCplt ( I2C_HandleTypeDef hi2c,
uint32_t  ITFlags 
) [static]
static void I2C_ITMasterCplt ( I2C_HandleTypeDef hi2c,
uint32_t  ITFlags 
) [static]
static void I2C_ITMasterSequentialCplt ( I2C_HandleTypeDef hi2c) [static]
static void I2C_ITSlaveCplt ( I2C_HandleTypeDef hi2c,
uint32_t  ITFlags 
) [static]
static void I2C_ITSlaveSequentialCplt ( I2C_HandleTypeDef hi2c) [static]
static HAL_StatusTypeDef I2C_Master_ISR_DMA ( struct __I2C_HandleTypeDef hi2c,
uint32_t  ITFlags,
uint32_t  ITSources 
) [static]
static HAL_StatusTypeDef I2C_Master_ISR_IT ( struct __I2C_HandleTypeDef hi2c,
uint32_t  ITFlags,
uint32_t  ITSources 
) [static]
static HAL_StatusTypeDef I2C_RequestMemoryRead ( I2C_HandleTypeDef hi2c,
uint16_t  DevAddress,
uint16_t  MemAddress,
uint16_t  MemAddSize,
uint32_t  Timeout,
uint32_t  Tickstart 
) [static]

Master sends target device address followed by internal memory address for read request.

Parameters:
hi2cPointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C.
DevAddressTarget device address: The device 7 bits address value in datasheet must be shifted to the left before calling the interface
MemAddressInternal memory address
MemAddSizeSize of internal memory address
TimeoutTimeout duration
TickstartTick start value
Return values:
HALstatus

Definition at line 4962 of file stm32l4xx_hal_i2c.c.

References __I2C_HandleTypeDef::ErrorCode, HAL_I2C_ERROR_AF, I2C_FLAG_TC, I2C_GENERATE_START_WRITE, I2C_MEM_ADD_LSB, I2C_MEM_ADD_MSB, I2C_MEMADD_SIZE_8BIT, I2C_SOFTEND_MODE, I2C_TransferConfig(), I2C_WaitOnFlagUntilTimeout(), I2C_WaitOnTXISFlagUntilTimeout(), and __I2C_HandleTypeDef::Instance.

Referenced by HAL_I2C_Mem_Read(), HAL_I2C_Mem_Read_DMA(), and HAL_I2C_Mem_Read_IT().

static HAL_StatusTypeDef I2C_RequestMemoryWrite ( I2C_HandleTypeDef hi2c,
uint16_t  DevAddress,
uint16_t  MemAddress,
uint16_t  MemAddSize,
uint32_t  Timeout,
uint32_t  Tickstart 
) [static]

Master sends target device address followed by internal memory address for write request.

Parameters:
hi2cPointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C.
DevAddressTarget device address: The device 7 bits address value in datasheet must be shifted to the left before calling the interface
MemAddressInternal memory address
MemAddSizeSize of internal memory address
TimeoutTimeout duration
TickstartTick start value
Return values:
HALstatus

Definition at line 4895 of file stm32l4xx_hal_i2c.c.

References __I2C_HandleTypeDef::ErrorCode, HAL_I2C_ERROR_AF, I2C_FLAG_TCR, I2C_GENERATE_START_WRITE, I2C_MEM_ADD_LSB, I2C_MEM_ADD_MSB, I2C_MEMADD_SIZE_8BIT, I2C_RELOAD_MODE, I2C_TransferConfig(), I2C_WaitOnFlagUntilTimeout(), I2C_WaitOnTXISFlagUntilTimeout(), and __I2C_HandleTypeDef::Instance.

Referenced by HAL_I2C_Mem_Write(), HAL_I2C_Mem_Write_DMA(), and HAL_I2C_Mem_Write_IT().

static HAL_StatusTypeDef I2C_Slave_ISR_DMA ( struct __I2C_HandleTypeDef hi2c,
uint32_t  ITFlags,
uint32_t  ITSources 
) [static]
static HAL_StatusTypeDef I2C_Slave_ISR_IT ( struct __I2C_HandleTypeDef hi2c,
uint32_t  ITFlags,
uint32_t  ITSources 
) [static]
static void I2C_TransferConfig ( I2C_HandleTypeDef hi2c,
uint16_t  DevAddress,
uint8_t  Size,
uint32_t  Mode,
uint32_t  Request 
) [static]

Handles I2Cx communication when starting transfer or during transfer (TC or TCR flag are set).

Parameters:
hi2cI2C handle.
DevAddressSpecifies the slave address to be programmed.
SizeSpecifies the number of bytes to be programmed. This parameter must be a value between 0 and 255.
ModeNew state of the I2C START condition generation. This parameter can be one of the following values:
RequestNew state of the I2C START condition generation. This parameter can be one of the following values:
Return values:
None

Definition at line 6078 of file stm32l4xx_hal_i2c.c.

References assert_param, __I2C_HandleTypeDef::Instance, IS_TRANSFER_MODE, and IS_TRANSFER_REQUEST.

Referenced by HAL_I2C_Master_Abort_IT(), HAL_I2C_Master_Receive(), HAL_I2C_Master_Receive_DMA(), HAL_I2C_Master_Receive_IT(), HAL_I2C_Master_Sequential_Receive_DMA(), HAL_I2C_Master_Sequential_Receive_IT(), HAL_I2C_Master_Sequential_Transmit_DMA(), HAL_I2C_Master_Sequential_Transmit_IT(), HAL_I2C_Master_Transmit(), HAL_I2C_Master_Transmit_DMA(), HAL_I2C_Master_Transmit_IT(), HAL_I2C_Mem_Read(), HAL_I2C_Mem_Read_DMA(), HAL_I2C_Mem_Read_IT(), HAL_I2C_Mem_Write(), HAL_I2C_Mem_Write_DMA(), HAL_I2C_Mem_Write_IT(), I2C_Master_ISR_DMA(), I2C_Master_ISR_IT(), I2C_RequestMemoryRead(), and I2C_RequestMemoryWrite().

static HAL_StatusTypeDef I2C_WaitOnFlagUntilTimeout ( I2C_HandleTypeDef hi2c,
uint32_t  Flag,
FlagStatus  Status,
uint32_t  Timeout,
uint32_t  Tickstart 
) [static]

This function handles I2C Communication Timeout.

Parameters:
hi2cPointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C.
FlagSpecifies the I2C flag to check.
StatusThe new Flag status (SET or RESET).
TimeoutTimeout duration
TickstartTick start value
Return values:
HALstatus

Definition at line 5849 of file stm32l4xx_hal_i2c.c.

References __HAL_I2C_GET_FLAG, HAL_GetTick(), HAL_I2C_MODE_NONE, HAL_I2C_STATE_READY, __I2C_HandleTypeDef::Mode, and __I2C_HandleTypeDef::State.

Referenced by HAL_I2C_IsDeviceReady(), HAL_I2C_Master_Receive(), HAL_I2C_Master_Transmit(), HAL_I2C_Mem_Read(), HAL_I2C_Mem_Write(), HAL_I2C_Slave_Receive(), HAL_I2C_Slave_Transmit(), I2C_RequestMemoryRead(), and I2C_RequestMemoryWrite().

static HAL_StatusTypeDef I2C_WaitOnRXNEFlagUntilTimeout ( I2C_HandleTypeDef hi2c,
uint32_t  Timeout,
uint32_t  Tickstart 
) [static]

This function handles I2C Communication Timeout for specific usage of RXNE flag.

Parameters:
hi2cPointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C.
TimeoutTimeout duration
TickstartTick start value
Return values:
HALstatus

Definition at line 5949 of file stm32l4xx_hal_i2c.c.

References __HAL_I2C_CLEAR_FLAG, __HAL_I2C_GET_FLAG, __I2C_HandleTypeDef::ErrorCode, HAL_GetTick(), HAL_I2C_ERROR_NONE, HAL_I2C_ERROR_TIMEOUT, HAL_I2C_MODE_NONE, HAL_I2C_STATE_READY, I2C_FLAG_RXNE, I2C_FLAG_STOPF, I2C_IsAcknowledgeFailed(), I2C_RESET_CR2, __I2C_HandleTypeDef::Mode, __I2C_HandleTypeDef::State, and __I2C_HandleTypeDef::XferSize.

Referenced by HAL_I2C_Master_Receive(), and HAL_I2C_Slave_Receive().

static HAL_StatusTypeDef I2C_WaitOnSTOPFlagUntilTimeout ( I2C_HandleTypeDef hi2c,
uint32_t  Timeout,
uint32_t  Tickstart 
) [static]

This function handles I2C Communication Timeout for specific usage of STOP flag.

Parameters:
hi2cPointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C.
TimeoutTimeout duration
TickstartTick start value
Return values:
HALstatus

Definition at line 5915 of file stm32l4xx_hal_i2c.c.

References __HAL_I2C_GET_FLAG, __I2C_HandleTypeDef::ErrorCode, HAL_GetTick(), HAL_I2C_ERROR_TIMEOUT, HAL_I2C_MODE_NONE, HAL_I2C_STATE_READY, I2C_FLAG_STOPF, I2C_IsAcknowledgeFailed(), __I2C_HandleTypeDef::Mode, and __I2C_HandleTypeDef::State.

Referenced by HAL_I2C_Master_Receive(), HAL_I2C_Master_Transmit(), HAL_I2C_Mem_Read(), HAL_I2C_Mem_Write(), HAL_I2C_Slave_Receive(), and HAL_I2C_Slave_Transmit().

static HAL_StatusTypeDef I2C_WaitOnTXISFlagUntilTimeout ( I2C_HandleTypeDef hi2c,
uint32_t  Timeout,
uint32_t  Tickstart 
) [static]

This function handles I2C Communication Timeout for specific usage of TXIS flag.

Parameters:
hi2cPointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C.
TimeoutTimeout duration
TickstartTick start value
Return values:
HALstatus

Definition at line 5878 of file stm32l4xx_hal_i2c.c.

References __HAL_I2C_GET_FLAG, __I2C_HandleTypeDef::ErrorCode, HAL_GetTick(), HAL_I2C_ERROR_TIMEOUT, HAL_I2C_MODE_NONE, HAL_I2C_STATE_READY, I2C_FLAG_TXIS, I2C_IsAcknowledgeFailed(), __I2C_HandleTypeDef::Mode, and __I2C_HandleTypeDef::State.

Referenced by HAL_I2C_Master_Transmit(), HAL_I2C_Mem_Write(), HAL_I2C_Slave_Transmit(), I2C_RequestMemoryRead(), and I2C_RequestMemoryWrite().