Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Space_Invaders_Demo neopixels gpio_test_stm32f3_discovery gpio_test_systimer ... more
SMBUS management functions
[I2C_Private_Functions]
SMBUS management functions. More...
Functions | |
void | I2C_SMBusAlertCmd (I2C_TypeDef *I2Cx, FunctionalState NewState) |
Enables or disables I2C SMBus alert. | |
void | I2C_ClockTimeoutCmd (I2C_TypeDef *I2Cx, FunctionalState NewState) |
Enables or disables I2C Clock Timeout (SCL Timeout detection). | |
void | I2C_ExtendedClockTimeoutCmd (I2C_TypeDef *I2Cx, FunctionalState NewState) |
Enables or disables I2C Extended Clock Timeout (SCL cumulative Timeout detection). | |
void | I2C_IdleClockTimeoutCmd (I2C_TypeDef *I2Cx, FunctionalState NewState) |
Enables or disables I2C Idle Clock Timeout (Bus idle SCL and SDA high detection). | |
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). | |
void | I2C_TimeoutBConfig (I2C_TypeDef *I2Cx, uint16_t Timeout) |
Configures the I2C Bus Timeout B (SCL cumulative Timeout). | |
void | I2C_CalculatePEC (I2C_TypeDef *I2Cx, FunctionalState NewState) |
Enables or disables I2C PEC calculation. | |
void | I2C_PECRequestCmd (I2C_TypeDef *I2Cx, FunctionalState NewState) |
Enables or disables I2C PEC transmission/reception request. | |
uint8_t | I2C_GetPEC (I2C_TypeDef *I2Cx) |
Returns the I2C PEC. |
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 or 2 to select the I2C peripheral. NewState,: new state of the I2Cx PEC calculation. This parameter can be: ENABLE or DISABLE.
- Return values:
-
None
Definition at line 1107 of file stm32f30x_i2c.c.
void I2C_ClockTimeoutCmd | ( | I2C_TypeDef * | I2Cx, |
FunctionalState | NewState | ||
) |
Enables or disables I2C Clock Timeout (SCL Timeout detection).
- Parameters:
-
I2Cx,: where x can be 1 or 2 to select the I2C peripheral. NewState,: new state of the I2Cx clock Timeout. This parameter can be: ENABLE or DISABLE.
- Return values:
-
None
Definition at line 976 of file stm32f30x_i2c.c.
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 or 2 to select the I2C peripheral. NewState,: new state of the I2Cx Extended clock Timeout. This parameter can be: ENABLE or DISABLE.
- Return values:
-
None
Definition at line 1001 of file stm32f30x_i2c.c.
uint8_t I2C_GetPEC | ( | I2C_TypeDef * | I2Cx ) |
Returns the I2C PEC.
- Parameters:
-
I2Cx,: where x can be 1 or 2 to select the I2C peripheral.
- Return values:
-
The value of the PEC .
Definition at line 1155 of file stm32f30x_i2c.c.
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 or 2 to select the I2C peripheral. NewState,: new state of the I2Cx Idle clock Timeout. This parameter can be: ENABLE or DISABLE.
- Return values:
-
None
Definition at line 1027 of file stm32f30x_i2c.c.
void I2C_PECRequestCmd | ( | I2C_TypeDef * | I2Cx, |
FunctionalState | NewState | ||
) |
Enables or disables I2C PEC transmission/reception request.
- Parameters:
-
I2Cx,: where x can be 1 or 2 to select the I2C peripheral. NewState,: new state of the I2Cx PEC request. This parameter can be: ENABLE or DISABLE.
- Return values:
-
None
Definition at line 1132 of file stm32f30x_i2c.c.
void I2C_SMBusAlertCmd | ( | I2C_TypeDef * | I2Cx, |
FunctionalState | NewState | ||
) |
Enables or disables I2C SMBus alert.
- Parameters:
-
I2Cx,: where x can be 1 or 2 to select the I2C peripheral. NewState,: new state of the I2Cx SMBus alert. This parameter can be: ENABLE or DISABLE.
- Return values:
-
None
Definition at line 951 of file stm32f30x_i2c.c.
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 or 2 to select the I2C peripheral. Timeout,: specifies the TimeoutA to be programmed.
- Return values:
-
None
Definition at line 1052 of file stm32f30x_i2c.c.
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 or 2 to select the I2C peripheral. Timeout,: specifies the TimeoutB to be programmed.
- Return values:
-
None
Definition at line 1079 of file stm32f30x_i2c.c.
Generated on Tue Jul 12 2022 17:34:45 by
