Sei sulla pagina 1di 7

HAL User Manual

 Main Page

 Modules

 Data Structures

 Files

 Directories

Functions

Initialization and de-initialization functions

I2C Exported Functions

Initialization and Configuration functions. More...

Functions

HAL_StatusTypeDef HAL_I2C_Init (I2C_HandleTypeDef *hi2c)

Initializes the I2C according to the specified

parameters in the I2C_InitTypeDef and create the

associated handle.

HAL_StatusTypeDef HAL_I2C_DeInit (I2C_HandleTypeDef *hi2c)

DeInitializes the I2C peripheral.


__weak void HAL_I2C_MspInit (I2C_HandleTypeDef *hi2c)

I2C MSP Init.

__weak void HAL_I2C_MspDeInit (I2C_HandleTypeDef *hi2c)

I2C MSP DeInit.

Detailed Description

Initialization and Configuration functions.

==============================================

=================================

##### Initialization and de-initialization functions #####

==============================================

=================================

[..] This subsection provides a set of functions allowing to initialize

and

de-initialiaze 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 periperal.

Function Documentation

HAL_StatusTypeDef HAL_I2C_DeInit ( I2C_HandleTypeDef * hi2c )

DeInitializes the I2C peripheral.

Parameters:

: Pointer to a I2C_HandleTypeDef structure that contains the


hi2c
configuration information for the specified I2C.

Return values:

HAL status

Definition at line 394 of file stm32f1xx_hal_i2c.c.

References __HAL_I2C_DISABLE, assert_param,

I2C_HandleTypeDef::ErrorCode, HAL_I2C_ERROR_NONE,

HAL_I2C_MspDeInit(), HAL_I2C_STATE_BUSY, HAL_I2C_STATE_RESET,

I2C_HandleTypeDef::Instance, and I2C_HandleTypeDef::State.


HAL_StatusTypeDef HAL_I2C_Init ( I2C_HandleTypeDef * hi2c )

Initializes the I2C according to the specified parameters in the

I2C_InitTypeDef and create the associated handle.

Parameters:

: Pointer to a I2C_HandleTypeDef structure that contains the


hi2c
configuration information for the specified I2C.

Return values:

HAL status

Definition at line 313 of file stm32f1xx_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_I2C_ERROR_NONE,

HAL_I2C_MspInit(), HAL_I2C_STATE_BUSY, HAL_I2C_STATE_READY,

HAL_I2C_STATE_RESET, HAL_RCC_GetPCLK1Freq(), I2C_Configure_Speed(),

I2C_FREQ_RANGE, I2C_RISE_TIME, 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_InitTypeDef::NoStretchMode, I2C_InitTypeDef::OwnAddress1,

I2C_InitTypeDef::OwnAddress2, and I2C_HandleTypeDef::State.

void HAL_I2C_MspDeInit ( I2C_HandleTypeDef * hi2c )

I2C MSP DeInit.

Parameters:

: Pointer to a I2C_HandleTypeDef structure that contains the


hi2c
configuration information for the specified I2C.

Return values:

None

Definition at line 442 of file stm32f1xx_hal_i2c.c.

Referenced by HAL_I2C_DeInit().

void HAL_I2C_MspInit ( I2C_HandleTypeDef * hi2c )


I2C MSP Init.

Parameters:

: Pointer to a I2C_HandleTypeDef structure that contains the


hi2c
configuration information for the specified I2C.

Return values:

None

Definition at line 429 of file stm32f1xx_hal_i2c.c.

Referenced by HAL_I2C_Init().

Generated on Mon Jul 27 2015 14:51:57 for STM32F100xE HAL User Manual by

1.7.6.1

Potrebbero piacerti anche