STM32F4xx_HAL_Driver  1.8.3
Initialization and de-initialization functions

Initialization and Configuration functions. More...

+ Collaboration diagram for Initialization and de-initialization functions:

Functions

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. More...
 
HAL_StatusTypeDef HAL_I2C_DeInit (I2C_HandleTypeDef *hi2c)
 DeInitialize the I2C peripheral. More...
 
void HAL_I2C_MspInit (I2C_HandleTypeDef *hi2c)
 Initialize the I2C MSP. More...
 
void HAL_I2C_MspDeInit (I2C_HandleTypeDef *hi2c)
 DeInitialize the I2C MSP. More...
 
HAL_StatusTypeDef HAL_I2C_RegisterCallback (I2C_HandleTypeDef *hi2c, HAL_I2C_CallbackIDTypeDef CallbackID, pI2C_CallbackTypeDef pCallback)
 Register a User I2C Callback To be used instead of the weak predefined callback. More...
 
HAL_StatusTypeDef HAL_I2C_UnRegisterCallback (I2C_HandleTypeDef *hi2c, HAL_I2C_CallbackIDTypeDef CallbackID)
 Unregister an I2C Callback I2C callback is redirected to the weak predefined callback. More...
 
HAL_StatusTypeDef HAL_I2C_RegisterAddrCallback (I2C_HandleTypeDef *hi2c, pI2C_AddrCallbackTypeDef pCallback)
 Register the Slave Address Match I2C Callback To be used instead of the weak HAL_I2C_AddrCallback() predefined callback. More...
 
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. More...
 

Detailed Description

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.

Function Documentation

◆ HAL_I2C_DeInit()

HAL_StatusTypeDef HAL_I2C_DeInit ( I2C_HandleTypeDef *  hi2c)

DeInitialize the I2C peripheral.

Parameters
hi2cPointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C.
Return values
HALstatus

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
hi2cPointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C.
Return values
HALstatus

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
hi2cPointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C.
Return values
None

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
hi2cPointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C.
Return values
None

Definition at line 606 of file stm32f4xx_hal_i2c.c.

◆ HAL_I2C_RegisterAddrCallback()

HAL_StatusTypeDef HAL_I2C_RegisterAddrCallback ( I2C_HandleTypeDef *  hi2c,
pI2C_AddrCallbackTypeDef  pCallback 
)

Register the Slave Address Match I2C Callback To be used instead of the weak HAL_I2C_AddrCallback() predefined callback.

Parameters
hi2cPointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C.
pCallbackpointer to the Address Match Callback function
Return values
HALstatus

Definition at line 888 of file stm32f4xx_hal_i2c.c.

◆ HAL_I2C_RegisterCallback()

HAL_StatusTypeDef HAL_I2C_RegisterCallback ( I2C_HandleTypeDef *  hi2c,
HAL_I2C_CallbackIDTypeDef  CallbackID,
pI2C_CallbackTypeDef  pCallback 
)

Register a User I2C Callback To be used instead of the weak predefined callback.

Parameters
hi2cPointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C.
CallbackIDID of the callback to be registered This parameter can be one of the following values:
pCallbackpointer to the Callback function
Return values
HALstatus

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
hi2cPointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C.
Return values
HALstatus

Definition at line 927 of file stm32f4xx_hal_i2c.c.

◆ HAL_I2C_UnRegisterCallback()

HAL_StatusTypeDef HAL_I2C_UnRegisterCallback ( I2C_HandleTypeDef *  hi2c,
HAL_I2C_CallbackIDTypeDef  CallbackID 
)

Unregister an I2C Callback I2C callback is redirected to the weak predefined callback.

Parameters
hi2cPointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C.
CallbackIDID 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
HALstatus

Definition at line 781 of file stm32f4xx_hal_i2c.c.