STM32F4 Standard Peripheral bibliotheek  1.0
ST Microelectronics bibliotheek documentatie voor de STM32F4 Standard Peripheral Library
 All Data Structures Files Functions Variables Enumerations Enumerator Groups
PEC management functions

PEC management functions. More...

Functions

void I2C_TransmitPEC (I2C_TypeDef *I2Cx, FunctionalState NewState)
 Enables or disables the specified I2C PEC transfer. More...
 
void I2C_PECPositionConfig (I2C_TypeDef *I2Cx, uint16_t I2C_PECPosition)
 Selects the specified I2C PEC position. More...
 
void I2C_CalculatePEC (I2C_TypeDef *I2Cx, FunctionalState NewState)
 Enables or disables the PEC value calculation of the transferred bytes. More...
 
uint8_t I2C_GetPEC (I2C_TypeDef *I2Cx)
 Returns the PEC value for the specified I2C. More...
 

Detailed Description

PEC management functions.

 ===============================================================================
                         PEC management functions
 ===============================================================================  

Function Documentation

void I2C_CalculatePEC ( I2C_TypeDef *  I2Cx,
FunctionalState  NewState 
)

Enables or disables the PEC value calculation of the transferred bytes.

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

Returns the PEC value for the specified I2C.

Parameters
I2Cx,:where x can be 1, 2 or 3 to select the I2C peripheral.
Return values
ThePEC value.
void I2C_PECPositionConfig ( I2C_TypeDef *  I2Cx,
uint16_t  I2C_PECPosition 
)

Selects the specified I2C PEC position.

Parameters
I2Cx,:where x can be 1, 2 or 3 to select the I2C peripheral.
I2C_PECPosition,:specifies the PEC position. This parameter can be one of the following values:
  • I2C_PECPosition_Next: indicates that the next byte is PEC
  • I2C_PECPosition_Current: indicates that current byte is PEC
Note
This function configures the same bit (POS) as I2C_NACKPositionConfig() but is intended to be used in SMBUS mode while I2C_NACKPositionConfig() is intended to used in I2C mode.
Return values
None
void I2C_TransmitPEC ( I2C_TypeDef *  I2Cx,
FunctionalState  NewState 
)

Enables or disables the specified I2C PEC transfer.

Parameters
I2Cx,:where x can be 1, 2 or 3 to select the I2C peripheral.
NewState,:new state of the I2C PEC transmission. This parameter can be: ENABLE or DISABLE.
Return values
None