Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: BSP OneHopeOnePrayer FINAL_AUDIO_RECORD AudioDemo
Fork of STM32L4xx_HAL_Driver by
Input and Output operation functions
[I2C Exported Functions]
Data transfers functions. More...
Functions | |
HAL_StatusTypeDef | HAL_I2C_Master_Transmit (I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout) |
Transmits in master mode an amount of data in blocking mode. | |
HAL_StatusTypeDef | HAL_I2C_Master_Receive (I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout) |
Receives in master mode an amount of data in blocking mode. | |
HAL_StatusTypeDef | HAL_I2C_Slave_Transmit (I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, uint32_t Timeout) |
Transmits in slave mode an amount of data in blocking mode. | |
HAL_StatusTypeDef | HAL_I2C_Slave_Receive (I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, uint32_t Timeout) |
Receive in slave mode an amount of data in blocking mode. | |
HAL_StatusTypeDef | HAL_I2C_Master_Transmit_IT (I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size) |
Transmit in master mode an amount of data in non-blocking mode with Interrupt. | |
HAL_StatusTypeDef | HAL_I2C_Master_Receive_IT (I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size) |
Receive in master mode an amount of data in non-blocking mode with Interrupt. | |
HAL_StatusTypeDef | HAL_I2C_Slave_Transmit_IT (I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size) |
Transmit in slave mode an amount of data in non-blocking mode with Interrupt. | |
HAL_StatusTypeDef | HAL_I2C_Slave_Receive_IT (I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size) |
Receive in slave mode an amount of data in non-blocking mode with Interrupt. | |
HAL_StatusTypeDef | HAL_I2C_Master_Transmit_DMA (I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size) |
Transmit in master mode an amount of data in non-blocking mode with DMA. | |
HAL_StatusTypeDef | HAL_I2C_Master_Receive_DMA (I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size) |
Receive in master mode an amount of data in non-blocking mode with DMA. | |
HAL_StatusTypeDef | HAL_I2C_Slave_Transmit_DMA (I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size) |
Transmit in slave mode an amount of data in non-blocking mode with DMA. | |
HAL_StatusTypeDef | HAL_I2C_Slave_Receive_DMA (I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size) |
Receive in slave mode an amount of data in non-blocking mode with DMA. | |
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) |
Write an amount of data in blocking mode to a specific memory address. | |
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) |
Read an amount of data in blocking mode from a specific memory address. | |
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) |
Write an amount of data in non-blocking mode with Interrupt to a specific memory address. | |
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) |
Read an amount of data in non-blocking mode with Interrupt from a specific memory address. | |
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) |
Write an amount of data in non-blocking mode with DMA to a specific memory address. | |
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) |
Reads an amount of data in non-blocking mode with DMA from a specific memory address. | |
HAL_StatusTypeDef | HAL_I2C_IsDeviceReady (I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint32_t Trials, uint32_t Timeout) |
Checks if target device is ready for communication. |
Detailed Description
Data transfers functions.
=============================================================================== ##### IO operation functions ##### =============================================================================== [..] This subsection provides a set of functions allowing to manage the I2C data transfers. (#) There are two modes of transfer: (++) Blocking mode : The communication is performed in the polling mode. The status of all data processing is returned by the same function after finishing transfer. (++) No-Blocking mode : The communication is performed using Interrupts or DMA. These functions return the status of the transfer startup. The end of the data processing will be indicated through the dedicated I2C IRQ when using Interrupt mode or the DMA IRQ when using DMA mode. (#) Blocking mode functions are : (++) HAL_I2C_Master_Transmit() (++) HAL_I2C_Master_Receive() (++) HAL_I2C_Slave_Transmit() (++) HAL_I2C_Slave_Receive() (++) HAL_I2C_Mem_Write() (++) HAL_I2C_Mem_Read() (++) HAL_I2C_IsDeviceReady() (#) No-Blocking mode functions with Interrupt are : (++) HAL_I2C_Master_Transmit_IT() (++) HAL_I2C_Master_Receive_IT() (++) HAL_I2C_Slave_Transmit_IT() (++) HAL_I2C_Slave_Receive_IT() (++) HAL_I2C_Mem_Write_IT() (++) HAL_I2C_Mem_Read_IT() (#) No-Blocking mode functions with DMA are : (++) HAL_I2C_Master_Transmit_DMA() (++) HAL_I2C_Master_Receive_DMA() (++) HAL_I2C_Slave_Transmit_DMA() (++) HAL_I2C_Slave_Receive_DMA() (++) HAL_I2C_Mem_Write_DMA() (++) HAL_I2C_Mem_Read_DMA() (#) A set of Transfer Complete Callbacks are provided in non Blocking mode: (++) HAL_I2C_MemTxCpltCallback() (++) HAL_I2C_MemRxCpltCallback() (++) HAL_I2C_MasterTxCpltCallback() (++) HAL_I2C_MasterRxCpltCallback() (++) HAL_I2C_SlaveTxCpltCallback() (++) HAL_I2C_SlaveRxCpltCallback() (++) HAL_I2C_ErrorCallback()
Function Documentation
HAL_StatusTypeDef HAL_I2C_IsDeviceReady | ( | I2C_HandleTypeDef * | hi2c, |
uint16_t | DevAddress, | ||
uint32_t | Trials, | ||
uint32_t | Timeout | ||
) |
Checks if target device is ready for communication.
- Note:
- This function is used with Memory devices
- Parameters:
-
hi2c : Pointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C. DevAddress,: Target device address Trials,: Number of trials Timeout,: Timeout duration
- Return values:
-
HAL status
Definition at line 2221 of file stm32l4xx_hal_i2c.c.
HAL_StatusTypeDef HAL_I2C_Master_Receive | ( | I2C_HandleTypeDef * | hi2c, |
uint16_t | DevAddress, | ||
uint8_t * | pData, | ||
uint16_t | Size, | ||
uint32_t | Timeout | ||
) |
Receives in master mode an amount of data in blocking mode.
- Parameters:
-
hi2c : Pointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C. DevAddress,: Target device address pData,: Pointer to data buffer Size,: Amount of data to be sent Timeout,: Timeout duration
- Return values:
-
HAL status
Definition at line 622 of file stm32l4xx_hal_i2c.c.
HAL_StatusTypeDef HAL_I2C_Master_Receive_DMA | ( | I2C_HandleTypeDef * | hi2c, |
uint16_t | DevAddress, | ||
uint8_t * | pData, | ||
uint16_t | Size | ||
) |
Receive in master mode an amount of data in non-blocking mode with DMA.
- Parameters:
-
hi2c : Pointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C. DevAddress,: Target device address pData,: Pointer to data buffer Size,: Amount of data to be sent
- Return values:
-
HAL status
Definition at line 1310 of file stm32l4xx_hal_i2c.c.
HAL_StatusTypeDef HAL_I2C_Master_Receive_IT | ( | I2C_HandleTypeDef * | hi2c, |
uint16_t | DevAddress, | ||
uint8_t * | pData, | ||
uint16_t | Size | ||
) |
Receive in master mode an amount of data in non-blocking mode with Interrupt.
- Parameters:
-
hi2c : Pointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C. DevAddress,: Target device address pData,: Pointer to data buffer Size,: Amount of data to be sent
- Return values:
-
HAL status
Definition at line 1048 of file stm32l4xx_hal_i2c.c.
HAL_StatusTypeDef HAL_I2C_Master_Transmit | ( | I2C_HandleTypeDef * | hi2c, |
uint16_t | DevAddress, | ||
uint8_t * | pData, | ||
uint16_t | Size, | ||
uint32_t | Timeout | ||
) |
Transmits in master mode an amount of data in blocking mode.
- Parameters:
-
hi2c : Pointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C. DevAddress,: Target device address pData,: Pointer to data buffer Size,: Amount of data to be sent Timeout,: Timeout duration
- Return values:
-
HAL status
Definition at line 502 of file stm32l4xx_hal_i2c.c.
HAL_StatusTypeDef HAL_I2C_Master_Transmit_DMA | ( | I2C_HandleTypeDef * | hi2c, |
uint16_t | DevAddress, | ||
uint8_t * | pData, | ||
uint16_t | Size | ||
) |
Transmit in master mode an amount of data in non-blocking mode with DMA.
- Parameters:
-
hi2c : Pointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C. DevAddress,: Target device address pData,: Pointer to data buffer Size,: Amount of data to be sent
- Return values:
-
HAL status
Definition at line 1219 of file stm32l4xx_hal_i2c.c.
HAL_StatusTypeDef HAL_I2C_Master_Transmit_IT | ( | I2C_HandleTypeDef * | hi2c, |
uint16_t | DevAddress, | ||
uint8_t * | pData, | ||
uint16_t | Size | ||
) |
Transmit in master mode an amount of data in non-blocking mode with Interrupt.
- Parameters:
-
hi2c : Pointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C. DevAddress,: Target device address pData,: Pointer to data buffer Size,: Amount of data to be sent
- Return values:
-
HAL status
Definition at line 976 of file stm32l4xx_hal_i2c.c.
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 | ||
) |
Read an amount of data in blocking mode from a specific memory address.
- Parameters:
-
hi2c : Pointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C. DevAddress,: Target device address MemAddress,: Internal memory address MemAddSize,: Size of internal memory address pData,: Pointer to data buffer Size,: Amount of data to be sent Timeout,: Timeout duration
- Return values:
-
HAL status
Definition at line 1693 of file stm32l4xx_hal_i2c.c.
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 | ||
) |
Reads an amount of data in non-blocking mode with DMA from a specific memory address.
- Parameters:
-
hi2c : Pointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C. DevAddress,: Target device address MemAddress,: Internal memory address MemAddSize,: Size of internal memory address pData,: Pointer to data buffer Size,: Amount of data to be read
- Return values:
-
HAL status
Definition at line 2122 of file stm32l4xx_hal_i2c.c.
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 | ||
) |
Read an amount of data in non-blocking mode with Interrupt from a specific memory address.
- Parameters:
-
hi2c : Pointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C. DevAddress,: Target device address MemAddress,: Internal memory address MemAddSize,: Size of internal memory address pData,: Pointer to data buffer Size,: Amount of data to be sent
- Return values:
-
HAL status
Definition at line 1922 of file stm32l4xx_hal_i2c.c.
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 | ||
) |
Write an amount of data in blocking mode to a specific memory address.
- Parameters:
-
hi2c : Pointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C. DevAddress,: Target device address MemAddress,: Internal memory address MemAddSize,: Size of internal memory address pData,: Pointer to data buffer Size,: Amount of data to be sent Timeout,: Timeout duration
- Return values:
-
HAL status
Definition at line 1550 of file stm32l4xx_hal_i2c.c.
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 | ||
) |
Write an amount of data in non-blocking mode with DMA to a specific memory address.
- Parameters:
-
hi2c : Pointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C. DevAddress,: Target device address MemAddress,: Internal memory address MemAddSize,: Size of internal memory address pData,: Pointer to data buffer Size,: Amount of data to be sent
- Return values:
-
HAL status
Definition at line 2013 of file stm32l4xx_hal_i2c.c.
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 | ||
) |
Write an amount of data in non-blocking mode with Interrupt to a specific memory address.
- Parameters:
-
hi2c : Pointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C. DevAddress,: Target device address MemAddress,: Internal memory address MemAddSize,: Size of internal memory address pData,: Pointer to data buffer Size,: Amount of data to be sent
- Return values:
-
HAL status
Definition at line 1829 of file stm32l4xx_hal_i2c.c.
HAL_StatusTypeDef HAL_I2C_Slave_Receive | ( | I2C_HandleTypeDef * | hi2c, |
uint8_t * | pData, | ||
uint16_t | Size, | ||
uint32_t | Timeout | ||
) |
Receive in slave mode an amount of data in blocking mode.
- Parameters:
-
hi2c : Pointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C. pData,: Pointer to data buffer Size,: Amount of data to be sent Timeout,: Timeout duration
- Return values:
-
HAL status
Definition at line 864 of file stm32l4xx_hal_i2c.c.
HAL_StatusTypeDef HAL_I2C_Slave_Receive_DMA | ( | I2C_HandleTypeDef * | hi2c, |
uint8_t * | pData, | ||
uint16_t | Size | ||
) |
Receive in slave mode an amount of data in non-blocking mode with DMA.
- Parameters:
-
hi2c : Pointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C. pData,: Pointer to data buffer Size,: Amount of data to be sent
- Return values:
-
HAL status
Definition at line 1476 of file stm32l4xx_hal_i2c.c.
HAL_StatusTypeDef HAL_I2C_Slave_Receive_IT | ( | I2C_HandleTypeDef * | hi2c, |
uint8_t * | pData, | ||
uint16_t | Size | ||
) |
Receive in slave mode an amount of data in non-blocking mode with Interrupt.
- Parameters:
-
hi2c : Pointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C. pData,: Pointer to data buffer Size,: Amount of data to be sent
- Return values:
-
HAL status
Definition at line 1168 of file stm32l4xx_hal_i2c.c.
HAL_StatusTypeDef HAL_I2C_Slave_Transmit | ( | I2C_HandleTypeDef * | hi2c, |
uint8_t * | pData, | ||
uint16_t | Size, | ||
uint32_t | Timeout | ||
) |
Transmits in slave mode an amount of data in blocking mode.
- Parameters:
-
hi2c : Pointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C. pData,: Pointer to data buffer Size,: Amount of data to be sent Timeout,: Timeout duration
- Return values:
-
HAL status
Definition at line 735 of file stm32l4xx_hal_i2c.c.
HAL_StatusTypeDef HAL_I2C_Slave_Transmit_DMA | ( | I2C_HandleTypeDef * | hi2c, |
uint8_t * | pData, | ||
uint16_t | Size | ||
) |
Transmit in slave mode an amount of data in non-blocking mode with DMA.
- Parameters:
-
hi2c : Pointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C. pData,: Pointer to data buffer Size,: Amount of data to be sent
- Return values:
-
HAL status
Definition at line 1390 of file stm32l4xx_hal_i2c.c.
HAL_StatusTypeDef HAL_I2C_Slave_Transmit_IT | ( | I2C_HandleTypeDef * | hi2c, |
uint8_t * | pData, | ||
uint16_t | Size | ||
) |
Transmit in slave mode an amount of data in non-blocking mode with Interrupt.
- Parameters:
-
hi2c : Pointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C. pData,: Pointer to data buffer Size,: Amount of data to be sent
- Return values:
-
HAL status
Definition at line 1118 of file stm32l4xx_hal_i2c.c.
Generated on Tue Jul 12 2022 11:35:30 by
