Inter-integrated circuit interface (I2C)
13.1.2 I2C_InitTypeDef
I2C_InitTypeDef is defined in the stm32f30x_i2c.h
Data Fields
uint32_t I2C_Timing
uint32_t I2C_AnalogFilter
uint32_t I2C_DigitalFilter
uint32_t I2C_Mode
uint32_t I2C_OwnAddress1
uint32_t I2C_Ack
uint32_t I2C_AcknowledgedAddress
Field Documentation
uint32_t I2C_InitTypeDef::I2C_Timing
Specifies the I2C_TIMINGR_register value. This parameter calculated by
referring to I2C initialization section in Reference manual
uint32_t I2C_InitTypeDef::I2C_AnalogFilter
Enables or disables analog noise filter. This parameter can be a value of
I2C_Analog_Filter
uint32_t I2C_InitTypeDef::I2C_DigitalFilter
Configures the digital noise filter. This parameter can be a number between 0x00
and 0x0F
uint32_t I2C_InitTypeDef::I2C_Mode
Specifies the I2C mode. This parameter can be a value of I2C_mode
uint32_t I2C_InitTypeDef::I2C_OwnAddress1
Specifies the device own address 1. This parameter can be a 7-bit or 10-bit
address
uint32_t I2C_InitTypeDef::I2C_Ack
Enables or disables the acknowledgement. This parameter can be a value of
I2C_acknowledgement
uint32_t I2C_InitTypeDef::I2C_AcknowledgedAddress
Specifies if 7-bit or 10-bit address is acknowledged. This parameter can be a
value of I2C_acknowledged_address
13.2 I2C Firmware driver API description
The following section lists the various functions of the I2C library.
13.2.1 How to use this driver
1. Enable peripheral clock using RCC_APB1PeriphClockCmd(RCC_APB1Periph_I2Cx,
ENABLE) function for I2C1 or I2C2.
2. Enable SDA, SCL and SMBA (when used) GPIO clocks using
RCC_AHBPeriphClockCmd() function.
3. Peripherals alternate function: