STM8L15x Standard Peripherals Drivers: PEC management functions

STM8L15x/16x Standard Peripherals Drivers

STM8L15x Standard Peripherals Drivers

PEC management functions

PEC management functions. More...

Functions

void I2C_CalculatePEC (I2C_TypeDef *I2Cx, FunctionalState NewState)
 Enables or disables PEC calculation.
uint8_t I2C_GetPEC (I2C_TypeDef *I2Cx)
 Returns PEC value.
void I2C_PECPositionConfig (I2C_TypeDef *I2Cx, I2C_PECPosition_TypeDef I2C_PECPosition)
 Selects I2C PEC position.
void I2C_TransmitPEC (I2C_TypeDef *I2Cx, FunctionalState NewState)
 Enables or disables PEC transfer.

Detailed Description

PEC management functions.

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


Function Documentation

void I2C_CalculatePEC ( I2C_TypeDef I2Cx,
FunctionalState  NewState 
)

Enables or disables PEC calculation.

Parameters:
I2Cx,:where x can be 1 to select the specified I2C peripheral.
NewState,:indicates the PEC calculation state. This parameter can be: ENABLE or DISABLE.
Return values:
None

Definition at line 723 of file stm8l15x_i2c.c.

References I2C_struct::CR1, DISABLE, I2C_CR1_ENPEC, and IS_FUNCTIONAL_STATE.

uint8_t I2C_GetPEC ( I2C_TypeDef I2Cx)

Returns PEC value.

Parameters:
I2Cx,:where x can be 1 to select the specified I2C peripheral.
None
Return values:
Thevalue of the PEC.

Definition at line 766 of file stm8l15x_i2c.c.

References I2C_struct::PECR.

void I2C_PECPositionConfig ( I2C_TypeDef I2Cx,
I2C_PECPosition_TypeDef  I2C_PECPosition 
)

Selects I2C PEC position.

Parameters:
I2Cx,:where x can be 1 to select the specified I2C peripheral.
I2C_PECPosition:PECposition. This parameter can be one of the following values:
  • I2C_PECPosition_Current: Current byte in shift register is PEC
  • I2C_PECPosition_Next: Next byte in shift register is PEC
Return values:
None

Definition at line 749 of file stm8l15x_i2c.c.

References I2C_struct::CR2, I2C_CR2_POS, and IS_I2C_PEC_POSITION.

void I2C_TransmitPEC ( I2C_TypeDef I2Cx,
FunctionalState  NewState 
)

Enables or disables PEC transfer.

Parameters:
I2Cx,:where x can be 1 to select the specified I2C peripheral.
NewState,:indicates the PEC transfer state. This parameter can be: ENABLE or DISABLE.
Return values:
None

Definition at line 699 of file stm8l15x_i2c.c.

References I2C_struct::CR2, DISABLE, I2C_CR2_PEC, and IS_FUNCTIONAL_STATE.

STM8S Firmware Library: Overview

 

 

 

For complete documentation on STM8L15x 8-bit microcontrollers platform visit www.st.com