UM1581
The SMBus Host address (0b0001 000) is enabled by calling I2C_Init() function and
setting I2C_Mode member of I2C_InitTypeDef() structure to I2C_Mode_SMBusHost.
The Alert Response Address (0b0001 100) is enabled using I2C_SMBusAlertCmd()
function.
To detect cumulative SCL stretch in master and slave mode, TIMEOUTB should be
configured (in accordance to SMBus specification) using I2C_TimeoutBConfig() function
then I2C_ExtendedClockTimeoutCmd() function should be called to enable the detection.
SCL low timeout is detected by configuring TIMEOUTB using I2C_TimeoutBConfig()
function followed by the call of I2C_ClockTimeoutCmd(). When adding to this procedure
the call of I2C_IdleClockTimeoutCmd() function, Bus Idle condition (both SCL and SDA
high) is detected also.
I2C_SMBusAlertCmd()
I2C_ClockTimeoutCmd()
I2C_ExtendedClockTimeoutCmd()
I2C_IdleClockTimeoutCmd()
I2C_TimeoutAConfig()
I2C_TimeoutBConfig()
I2C_CalculatePEC()
I2C_PECRequestCmd()
I2C_GetPEC()
13.2.5
I2C registers management functions
This section provides a functions that allow user the management of I2C registers.
I2C_ReadRegister()
13.2.6
Data transfers management functions
This subsection provides a set of functions allowing to manage the I2C data transfers.
The read access of the I2C_RXDR register can be done using the I2C_ReceiveData()
function and returns the received value. Whereas a write access to the I2C_TXDR can be
done using I2C_SendData() function and stores the written data into TXDR.
I2C_SendData()
I2C_ReceiveData()
13.2.7
DMA transfers management functions
This section provides two functions that can be used only in DMA mode.
In DMA Mode, the I2C communication can be managed by 2 DMA Channel requests:
1.
I2C_DMAReq_Tx: specifies the Tx buffer DMA transfer request.
2.
I2C_DMAReq_Rx: specifies the Rx buffer DMA transfer request.
In this Mode it is advised to use the following function:
I2C_DMACmd(I2C_TypeDef* I2Cx, uint32_t I2C_DMAReq, FunctionalState
NewState);
I2C_DMACmd()
DocID023800 Rev 1
Inter-integrated circuit interface (I2C)
251/584
Need help?
Do you have a question about the STM32F31xx and is the answer not in the manual?