STM32F0 Standard Peripheral bibliotheek  1.0
ST Microelectronics standard peripheral bibliotheek documentatie voor de STM32F0 familie
 All Data Structures Files Functions Variables Enumerations Enumerator Groups
SMBUS management functions

SMBUS management functions. More...

Functions

void I2C_SMBusAlertCmd (I2C_TypeDef *I2Cx, FunctionalState NewState)
 Enables or disables I2C SMBus alert. More...
 
void I2C_ClockTimeoutCmd (I2C_TypeDef *I2Cx, FunctionalState NewState)
 Enables or disables I2C Clock Timeout (SCL Timeout detection). More...
 
void I2C_ExtendedClockTimeoutCmd (I2C_TypeDef *I2Cx, FunctionalState NewState)
 Enables or disables I2C Extended Clock Timeout (SCL cumulative Timeout detection). More...
 
void I2C_IdleClockTimeoutCmd (I2C_TypeDef *I2Cx, FunctionalState NewState)
 Enables or disables I2C Idle Clock Timeout (Bus idle SCL and SDA high detection). More...
 
void I2C_TimeoutAConfig (I2C_TypeDef *I2Cx, uint16_t Timeout)
 Configures the I2C Bus Timeout A (SCL Timeout when TIDLE = 0 or Bus idle SCL and SDA high when TIDLE = 1). More...
 
void I2C_TimeoutBConfig (I2C_TypeDef *I2Cx, uint16_t Timeout)
 Configures the I2C Bus Timeout B (SCL cumulative Timeout). More...
 
void I2C_CalculatePEC (I2C_TypeDef *I2Cx, FunctionalState NewState)
 Enables or disables I2C PEC calculation. More...
 
void I2C_PECRequestCmd (I2C_TypeDef *I2Cx, FunctionalState NewState)
 Enables or disables I2C PEC transmission/reception request. More...
 
uint8_t I2C_GetPEC (I2C_TypeDef *I2Cx)
 Returns the I2C PEC. More...
 

Detailed Description

SMBUS management functions.

 ===============================================================================
                      ##### SMBUS management functions #####
 ===============================================================================  
    [..] This section provides a set of functions that handles SMBus communication
         and timeouts detection.

    [..] The SMBus Device default address (0b1100 001) is enabled by calling I2C_Init()
         function and setting I2C_Mode member of I2C_InitTypeDef() structure to 
         I2C_Mode_SMBusDevice.

    [..] 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.

Function Documentation

void I2C_CalculatePEC ( I2C_TypeDef *  I2Cx,
FunctionalState  NewState 
)

Enables or disables I2C PEC calculation.

Parameters
I2Cx,:where x can be 1 to select the I2C peripheral.
NewState,:new state of the I2Cx PEC calculation. This parameter can be: ENABLE or DISABLE.
Return values
None
void I2C_ClockTimeoutCmd ( I2C_TypeDef *  I2Cx,
FunctionalState  NewState 
)

Enables or disables I2C Clock Timeout (SCL Timeout detection).

Parameters
I2Cx,:where x can be 1 to select the I2C peripheral.
NewState,:new state of the I2Cx clock Timeout. This parameter can be: ENABLE or DISABLE.
Return values
None
void I2C_ExtendedClockTimeoutCmd ( I2C_TypeDef *  I2Cx,
FunctionalState  NewState 
)

Enables or disables I2C Extended Clock Timeout (SCL cumulative Timeout detection).

Parameters
I2Cx,:where x can be 1 to select the I2C peripheral.
NewState,:new state of the I2Cx Extended clock Timeout. This parameter can be: ENABLE or DISABLE.
Return values
None
uint8_t I2C_GetPEC ( I2C_TypeDef *  I2Cx)

Returns the I2C PEC.

Parameters
I2Cx,:where x can be 1 to select the I2C peripheral.
Return values
Thevalue of the PEC .
void I2C_IdleClockTimeoutCmd ( I2C_TypeDef *  I2Cx,
FunctionalState  NewState 
)

Enables or disables I2C Idle Clock Timeout (Bus idle SCL and SDA high detection).

Parameters
I2Cx,:where x can be 1 to select the I2C peripheral.
NewState,:new state of the I2Cx Idle clock Timeout. This parameter can be: ENABLE or DISABLE.
Return values
None
void I2C_PECRequestCmd ( I2C_TypeDef *  I2Cx,
FunctionalState  NewState 
)

Enables or disables I2C PEC transmission/reception request.

Parameters
I2Cx,:where x can be 1 to select the I2C peripheral.
NewState,:new state of the I2Cx PEC request. This parameter can be: ENABLE or DISABLE.
Return values
None
void I2C_SMBusAlertCmd ( I2C_TypeDef *  I2Cx,
FunctionalState  NewState 
)

Enables or disables I2C SMBus alert.

Parameters
I2Cx,:where x can be 1 to select the I2C peripheral.
NewState,:new state of the I2Cx SMBus alert. This parameter can be: ENABLE or DISABLE.
Return values
None
void I2C_TimeoutAConfig ( I2C_TypeDef *  I2Cx,
uint16_t  Timeout 
)

Configures the I2C Bus Timeout A (SCL Timeout when TIDLE = 0 or Bus idle SCL and SDA high when TIDLE = 1).

Parameters
I2Cx,:where x can be 1 to select the I2C peripheral.
Timeout,:specifies the TimeoutA to be programmed.
Return values
None
void I2C_TimeoutBConfig ( I2C_TypeDef *  I2Cx,
uint16_t  Timeout 
)

Configures the I2C Bus Timeout B (SCL cumulative Timeout).

Parameters
I2Cx,:where x can be 1 to select the I2C peripheral.
Timeout,:specifies the TimeoutB to be programmed.
Return values
None