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: