STM32F4xx HAL Documentation
Hardware Abstraction Layer for STM32F4 familiy
โ€ขAll Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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.
 
HAL_StatusTypeDef HAL_I2C_DeInit (I2C_HandleTypeDef *hi2c)
 DeInitialize the I2C peripheral.
 
void HAL_I2C_MspInit (I2C_HandleTypeDef *hi2c)
 Initialize the I2C MSP.
 
void HAL_I2C_MspDeInit (I2C_HandleTypeDef *hi2c)
 DeInitialize the I2C MSP.
 

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_Init()

HAL_StatusTypeDef HAL_I2C_Init ( I2C_HandleTypeDef * hi2c)

#include <stm32f4xx_hal_i2c.h>

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.

References __HAL_I2C_DISABLE, __HAL_I2C_ENABLE, I2C_InitTypeDef::AddressingMode, assert_param, I2C_InitTypeDef::ClockSpeed, I2C_InitTypeDef::DualAddressMode, I2C_InitTypeDef::DutyCycle, I2C_HandleTypeDef::ErrorCode, I2C_InitTypeDef::GeneralCallMode, HAL_ERROR, HAL_I2C_AbortCpltCallback(), HAL_I2C_AddrCallback(), HAL_I2C_ERROR_NONE, HAL_I2C_ErrorCallback(), HAL_I2C_ListenCpltCallback(), HAL_I2C_MasterRxCpltCallback(), HAL_I2C_MasterTxCpltCallback(), HAL_I2C_MemRxCpltCallback(), HAL_I2C_MemTxCpltCallback(), HAL_I2C_MODE_NONE, HAL_I2C_MspInit(), HAL_I2C_SlaveRxCpltCallback(), HAL_I2C_SlaveTxCpltCallback(), HAL_I2C_STATE_BUSY, HAL_I2C_STATE_READY, HAL_I2C_STATE_RESET, HAL_OK, HAL_RCC_GetPCLK1Freq(), HAL_UNLOCKED, I2C_FREQRANGE, I2C_MIN_PCLK_FREQ, I2C_RISE_TIME, I2C_SPEED, I2C_STATE_NONE, I2C_HandleTypeDef::Init, I2C_HandleTypeDef::Instance, IS_I2C_ADDRESSING_MODE, IS_I2C_CLOCK_SPEED, IS_I2C_DUAL_ADDRESS, IS_I2C_DUTY_CYCLE, IS_I2C_GENERAL_CALL, IS_I2C_NO_STRETCH, IS_I2C_OWN_ADDRESS1, IS_I2C_OWN_ADDRESS2, I2C_HandleTypeDef::Lock, I2C_HandleTypeDef::Mode, I2C_InitTypeDef::NoStretchMode, I2C_InitTypeDef::OwnAddress1, I2C_InitTypeDef::OwnAddress2, I2C_HandleTypeDef::PreviousState, and I2C_HandleTypeDef::State.

โ—† HAL_I2C_DeInit()

HAL_StatusTypeDef HAL_I2C_DeInit ( I2C_HandleTypeDef * hi2c)

#include <stm32f4xx_hal_i2c.h>

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.

References __HAL_I2C_DISABLE, __HAL_UNLOCK, assert_param, I2C_HandleTypeDef::ErrorCode, HAL_ERROR, HAL_I2C_ERROR_NONE, HAL_I2C_MODE_NONE, HAL_I2C_MspDeInit(), HAL_I2C_STATE_BUSY, HAL_I2C_STATE_RESET, HAL_OK, I2C_STATE_NONE, I2C_HandleTypeDef::Instance, I2C_HandleTypeDef::Mode, I2C_HandleTypeDef::PreviousState, and I2C_HandleTypeDef::State.

โ—† HAL_I2C_MspInit()

__weak void HAL_I2C_MspInit ( I2C_HandleTypeDef * hi2c)

#include <stm32f4xx_hal_i2c.h>

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.

References UNUSED.

Referenced by HAL_I2C_Init().

โ—† HAL_I2C_MspDeInit()

__weak void HAL_I2C_MspDeInit ( I2C_HandleTypeDef * hi2c)

#include <stm32f4xx_hal_i2c.h>

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.

References UNUSED.

Referenced by HAL_I2C_DeInit().