Initialization and Configuration functions.
More...
Initialization and Configuration functions.
===============================================================================
##### Initialization and de-initialization functions #####
===============================================================================
[..] This subsection provides a set of functions allowing to initialize and
deinitialize the I2Cx peripheral:
(+) User must Implement HAL_I2C_MspInit() function in which he configures
all related peripherals resources (CLOCK, GPIO, DMA, IT and NVIC).
(+) Call the function HAL_I2C_Init() to configure the selected device with
the selected configuration:
(++) Communication Speed
(++) Duty cycle
(++) Addressing mode
(++) Own Address 1
(++) Dual Addressing mode
(++) Own Address 2
(++) General call mode
(++) Nostretch mode
(+) Call the function HAL_I2C_DeInit() to restore the default configuration
of the selected I2Cx peripheral.
◆ HAL_I2C_DeInit()
HAL_StatusTypeDef HAL_I2C_DeInit |
( |
I2C_HandleTypeDef * |
hi2c | ) |
|
DeInitialize the I2C peripheral.
- Parameters
-
hi2c | Pointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C. |
- Return values
-
Definition at line 560 of file stm32f4xx_hal_i2c.c.
◆ HAL_I2C_Init()
HAL_StatusTypeDef HAL_I2C_Init |
( |
I2C_HandleTypeDef * |
hi2c | ) |
|
Initializes the I2C according to the specified parameters in the I2C_InitTypeDef and initialize the associated handle.
- Parameters
-
hi2c | Pointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C. |
- Return values
-
Definition at line 445 of file stm32f4xx_hal_i2c.c.
◆ HAL_I2C_MspDeInit()
__weak void HAL_I2C_MspDeInit |
( |
I2C_HandleTypeDef * |
hi2c | ) |
|
DeInitialize the I2C MSP.
- Parameters
-
hi2c | Pointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C. |
- Return values
-
Definition at line 622 of file stm32f4xx_hal_i2c.c.
◆ HAL_I2C_MspInit()
__weak void HAL_I2C_MspInit |
( |
I2C_HandleTypeDef * |
hi2c | ) |
|
Initialize the I2C MSP.
- Parameters
-
hi2c | Pointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C. |
- Return values
-
Definition at line 606 of file stm32f4xx_hal_i2c.c.
◆ HAL_I2C_RegisterAddrCallback()
Register the Slave Address Match I2C Callback To be used instead of the weak HAL_I2C_AddrCallback() predefined callback.
- Parameters
-
hi2c | Pointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C. |
pCallback | pointer to the Address Match Callback function |
- Return values
-
Definition at line 888 of file stm32f4xx_hal_i2c.c.
◆ HAL_I2C_RegisterCallback()
Register a User I2C Callback To be used instead of the weak predefined callback.
- Parameters
-
hi2c | Pointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C. |
CallbackID | ID of the callback to be registered This parameter can be one of the following values:
|
pCallback | pointer to the Callback function |
- Return values
-
Definition at line 654 of file stm32f4xx_hal_i2c.c.
◆ HAL_I2C_UnRegisterAddrCallback()
HAL_StatusTypeDef HAL_I2C_UnRegisterAddrCallback |
( |
I2C_HandleTypeDef * |
hi2c | ) |
|
UnRegister the Slave Address Match I2C Callback Info Ready I2C Callback is redirected to the weak HAL_I2C_AddrCallback() predefined callback.
- Parameters
-
hi2c | Pointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C. |
- Return values
-
Definition at line 927 of file stm32f4xx_hal_i2c.c.
◆ HAL_I2C_UnRegisterCallback()
Unregister an I2C Callback I2C callback is redirected to the weak predefined callback.
- Parameters
-
hi2c | Pointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C. |
CallbackID | ID of the callback to be unregistered This parameter can be one of the following values: This parameter can be one of the following values:
|
- Return values
-
Definition at line 781 of file stm32f4xx_hal_i2c.c.