MG32F10x Standard Peripherals Firmware Library
|
Functions | |
void | I2C_DeInit (I2C_TypeDef *I2Cx) |
Deinitializes the I2Cx peripheral registers to their default reset values. More... | |
void | I2C_Init (I2C_TypeDef *I2Cx, uint32_t I2C_CON) |
Initializes the I2Cx peripheral according to the specified parameters in the I2C_InitStruct. More... | |
void | I2C_TargetAddressConfig (I2C_TypeDef *I2Cx, uint32_t TargetAddress) |
Configures the specified I2C target address. More... | |
void | I2C_OwnAddressConfig (I2C_TypeDef *I2Cx, uint16_t Address) |
Configures the specified I2C own address. More... | |
void | I2C_HighSpeedModeMasterCodeConfig (I2C_TypeDef *I2Cx, uint8_t Code) |
Configures the I2C HS mode master code. More... | |
uint32_t | I2C_GetTxAbortSource (I2C_TypeDef *I2Cx) |
Returns the transmit abort source for the specified I2C. More... | |
void | I2C_SCLStuckAtLowTimeoutConfig (I2C_TypeDef *I2Cx, uint32_t Timeout) |
Configures the specified I2C SCL stuck at low timeout. More... | |
void | I2C_SDAStuckAtLowTimeoutConfig (I2C_TypeDef *I2Cx, uint32_t Timeout) |
Configures the specified I2C SDA stuck at low timeout. More... | |
void | I2C_Cmd (I2C_TypeDef *I2Cx, FunctionalState NewState) |
Enables or disables the specified I2C peripheral. More... | |
void | I2C_SlaveDataNAckOnlyConfig (I2C_TypeDef *I2Cx, FunctionalState NewState) |
Enables or disables generate NACK after data byte received when as slave-receiver. More... | |
void | I2C_AckGeneralCallCmd (I2C_TypeDef *I2Cx, FunctionalState NewState) |
Enables or disables the General Call ACK Generate. More... | |
uint16_t | I2C_ReadData (I2C_TypeDef *I2Cx) |
Read data from Rx FIFO. More... | |
void | I2C_WriteDataCmd (I2C_TypeDef *I2Cx, uint16_t I2C_DataCmd) |
Write data and command Tx FIFO. More... | |
FlagStatus | I2C_GetFlagStatus (I2C_TypeDef *I2Cx, uint32_t I2C_FLAG) |
Checks whether the specified I2C flag is set or not. More... | |
void | I2C_ITConfig (I2C_TypeDef *I2Cx, uint16_t I2C_IT, FunctionalState NewState) |
Enables or disables the specified I2C interrupts. More... | |
ITStatus | I2C_GetRawITStatus (I2C_TypeDef *I2Cx, uint16_t I2C_IT) |
Checks whether the specified I2Cx raw interrupt status. More... | |
ITStatus | I2C_GetITStatus (I2C_TypeDef *I2Cx, uint16_t I2C_IT) |
Checks whether the specified I2Cx interrupt has occurred or not. More... | |
void | I2C_ClearITPendingBit (I2C_TypeDef *I2Cx, uint16_t I2C_IT) |
Clears the I2Cx's interrupt pending bits. More... | |
void | I2C_RxFIFOThresholdConfig (I2C_TypeDef *I2Cx, uint8_t Threshold) |
Configures the Receive FIFO threshold. More... | |
void | I2C_TxFIFOThresholdConfig (I2C_TypeDef *I2Cx, uint8_t Threshold) |
Configures the Transmit FIFO threshold. More... | |
uint8_t | I2C_GetRxFIFOLevel (I2C_TypeDef *I2Cx) |
Returns the number of valid data entries in the receive FIFO buffer. More... | |
uint8_t | I2C_GetTxFIFOLevel (I2C_TypeDef *I2Cx) |
Returns the number of valid data entries in the transmit FIFO buffer. More... | |
void | I2C_DMARxReqLevelConfig (I2C_TypeDef *I2Cx, uint8_t Level) |
Configures the DMA Rx request level. More... | |
void | I2C_DMATxReqLevelConfig (I2C_TypeDef *I2Cx, uint8_t Level) |
Configures the DMA Tx request level. More... | |
void | I2C_DMACmd (I2C_TypeDef *I2Cx, uint32_t I2C_DMAReq, FunctionalState NewState) |
Enables or disables the I2Cx's DMA interface. More... | |
void | I2C_SMBus_ITConfig (I2C_TypeDef *I2Cx, uint16_t I2C_SMBUS_IT, FunctionalState NewState) |
Enables or disables the specified SMBus interrupts. More... | |
ITStatus | I2C_SMBus_GetRawITStatus (I2C_TypeDef *I2Cx, uint16_t I2C_SMBUS_IT) |
Checks whether the specified SMBus raw interrupt status. More... | |
ITStatus | I2C_SMBus_GetITStatus (I2C_TypeDef *I2Cx, uint16_t I2C_SMBUS_IT) |
Checks whether the specified SMBus interrupt has occurred or not. More... | |
void | I2C_SMBus_ClearITPendingBit (I2C_TypeDef *I2Cx, uint16_t I2C_SMBUS_IT) |
Clears the I2Cx's interrupt pending bits. More... | |
void I2C_AckGeneralCallCmd | ( | I2C_TypeDef * | I2Cx, |
FunctionalState | NewState | ||
) |
Enables or disables the General Call ACK Generate.
I2Cx | Pointer to selected I2C peripheral. This parameter can be one of the following values: I2C1, I2C2. |
NewState | new state of the General Call ACK Generate. This parameter can be: ENABLE or DISABLE. |
void I2C_ClearITPendingBit | ( | I2C_TypeDef * | I2Cx, |
uint16_t | I2C_IT | ||
) |
Clears the I2Cx's interrupt pending bits.
I2Cx | Pointer to selected I2C peripheral. This parameter can be one of the following values: I2C1, I2C2. |
I2C_IT | specifies the interrupt pending bit to clear. This parameter can be a combination of the following values:
|
void I2C_Cmd | ( | I2C_TypeDef * | I2Cx, |
FunctionalState | NewState | ||
) |
Enables or disables the specified I2C peripheral.
I2Cx | Pointer to selected I2C peripheral. This parameter can be one of the following values: I2C1, I2C2. |
NewState | new state of the I2Cx peripheral. This parameter can be: ENABLE or DISABLE. |
void I2C_DeInit | ( | I2C_TypeDef * | I2Cx | ) |
Deinitializes the I2Cx peripheral registers to their default reset values.
I2Cx | Pointer to selected I2C peripheral. This parameter can be one of the following values: I2C1, I2C2. |
void I2C_DMACmd | ( | I2C_TypeDef * | I2Cx, |
uint32_t | I2C_DMAReq, | ||
FunctionalState | NewState | ||
) |
Enables or disables the I2Cx's DMA interface.
I2Cx | Pointer to selected I2C peripheral. This parameter can be one of the following values: I2C1, I2C2. |
I2C_DMAReq | specifies the DMA request. This parameter can be any combination of the following values:
|
NewState | new state of the DMA Request sources. This parameter can be: ENABLE or DISABLE. |
void I2C_DMARxReqLevelConfig | ( | I2C_TypeDef * | I2Cx, |
uint8_t | Level | ||
) |
Configures the DMA Rx request level.
I2Cx | Pointer to selected I2C peripheral. This parameter can be one of the following values: I2C1, I2C2. |
Level | The level of the DMA Rx request to set. |
void I2C_DMATxReqLevelConfig | ( | I2C_TypeDef * | I2Cx, |
uint8_t | Level | ||
) |
Configures the DMA Tx request level.
I2Cx | Pointer to selected I2C peripheral. This parameter can be one of the following values: I2C1, I2C2. |
Level | The level of the DMA Tx request to set. |
FlagStatus I2C_GetFlagStatus | ( | I2C_TypeDef * | I2Cx, |
uint32_t | I2C_FLAG | ||
) |
Checks whether the specified I2C flag is set or not.
I2Cx | Pointer to selected I2C peripheral. This parameter can be one of the following values: I2C1, I2C2. |
I2C_FLAG | specifies the flag to check. This parameter can be one of the following values:
|
ITStatus I2C_GetITStatus | ( | I2C_TypeDef * | I2Cx, |
uint16_t | I2C_IT | ||
) |
Checks whether the specified I2Cx interrupt has occurred or not.
I2Cx | Pointer to selected I2C peripheral. This parameter can be one of the following values: I2C1, I2C2. |
I2C_IT | specifies the I2C interrupt source to check. This parameter can be one of the following values:
|
ITStatus I2C_GetRawITStatus | ( | I2C_TypeDef * | I2Cx, |
uint16_t | I2C_IT | ||
) |
Checks whether the specified I2Cx raw interrupt status.
I2Cx | Pointer to selected I2C peripheral. This parameter can be one of the following values: I2C1, I2C2. |
I2C_IT | specifies the I2C interrupt source to check. This parameter can be one of the following values:
|
uint8_t I2C_GetRxFIFOLevel | ( | I2C_TypeDef * | I2Cx | ) |
Returns the number of valid data entries in the receive FIFO buffer.
I2Cx | Pointer to selected I2C peripheral. This parameter can be one of the following values: I2C1, I2C2. |
uint32_t I2C_GetTxAbortSource | ( | I2C_TypeDef * | I2Cx | ) |
Returns the transmit abort source for the specified I2C.
I2Cx | Pointer to selected I2C peripheral. This parameter can be one of the following values: I2C1, I2C2. |
uint8_t I2C_GetTxFIFOLevel | ( | I2C_TypeDef * | I2Cx | ) |
Returns the number of valid data entries in the transmit FIFO buffer.
I2Cx | Pointer to selected I2C peripheral. This parameter can be one of the following values: I2C1, I2C2. |
void I2C_HighSpeedModeMasterCodeConfig | ( | I2C_TypeDef * | I2Cx, |
uint8_t | Code | ||
) |
Configures the I2C HS mode master code.
I2Cx | Pointer to selected I2C peripheral. This parameter can be one of the following values: I2C2. |
Code | specifies the I2C HS mode master code. |
void I2C_Init | ( | I2C_TypeDef * | I2Cx, |
uint32_t | I2C_CON | ||
) |
Initializes the I2Cx peripheral according to the specified parameters in the I2C_InitStruct.
I2Cx | Pointer to selected I2C peripheral. This parameter can be one of the following values: I2C1, I2C2. |
I2C_CON | specifies the configuration for the specified I2C peripheral. |
void I2C_ITConfig | ( | I2C_TypeDef * | I2Cx, |
uint16_t | I2C_IT, | ||
FunctionalState | NewState | ||
) |
Enables or disables the specified I2C interrupts.
I2Cx | Pointer to selected I2C peripheral. This parameter can be one of the following values: I2C1, I2C2. |
I2C_IT | specifies the I2C interrupt source to be enabled or disabled. This parameter can be a combination of the following values:
|
NewState | new state of the specified I2C interrupt. This parameter can be: ENABLE or DISABLE. |
void I2C_OwnAddressConfig | ( | I2C_TypeDef * | I2Cx, |
uint16_t | Address | ||
) |
Configures the specified I2C own address.
I2Cx | Pointer to selected I2C peripheral. This parameter can be one of the following values: I2C1, I2C2. |
Address | specifies the I2C own address. |
uint16_t I2C_ReadData | ( | I2C_TypeDef * | I2Cx | ) |
Read data from Rx FIFO.
I2Cx | Pointer to selected I2C peripheral. This parameter can be one of the following values: I2C1, I2C2. |
void I2C_RxFIFOThresholdConfig | ( | I2C_TypeDef * | I2Cx, |
uint8_t | Threshold | ||
) |
Configures the Receive FIFO threshold.
I2Cx | Pointer to selected I2C peripheral. This parameter can be one of the following values: I2C1, I2C2. |
Threshold | The Receive FIFO threshold to set. |
The | RX_FULL interrupt will trigger when the level > Threshold. |
void I2C_SCLStuckAtLowTimeoutConfig | ( | I2C_TypeDef * | I2Cx, |
uint32_t | Timeout | ||
) |
Configures the specified I2C SCL stuck at low timeout.
I2Cx | Pointer to selected I2C peripheral. This parameter can be one of the following values: I2C1, I2C2. |
Timeout | specifies the SCL stuck at low timeout. |
void I2C_SDAStuckAtLowTimeoutConfig | ( | I2C_TypeDef * | I2Cx, |
uint32_t | Timeout | ||
) |
Configures the specified I2C SDA stuck at low timeout.
I2Cx | Pointer to selected I2C peripheral. This parameter can be one of the following values: I2C1, I2C2. |
Timeout | specifies the SDA stuck at low timeout. |
void I2C_SlaveDataNAckOnlyConfig | ( | I2C_TypeDef * | I2Cx, |
FunctionalState | NewState | ||
) |
Enables or disables generate NACK after data byte received when as slave-receiver.
I2Cx | Pointer to selected I2C peripheral. This parameter can be one of the following values: I2C1, I2C2. |
NewState | new state of generate NACK after data byte received. This parameter can be: ENABLE or DISABLE. |
void I2C_SMBus_ClearITPendingBit | ( | I2C_TypeDef * | I2Cx, |
uint16_t | I2C_SMBUS_IT | ||
) |
Clears the I2Cx's interrupt pending bits.
I2Cx | Pointer to selected I2C peripheral. This parameter can be one of the following values: I2C1. |
I2C_SMBUS_IT | specifies the interrupt pending bit to clear. This parameter can be a combination of the following values:
|
ITStatus I2C_SMBus_GetITStatus | ( | I2C_TypeDef * | I2Cx, |
uint16_t | I2C_SMBUS_IT | ||
) |
Checks whether the specified SMBus interrupt has occurred or not.
I2Cx | Pointer to selected I2C peripheral. This parameter can be one of the following values: I2C1. |
I2C_SMBUS_IT | specifies the SMBus interrupt source to check. This parameter can be one of the following values:
|
ITStatus I2C_SMBus_GetRawITStatus | ( | I2C_TypeDef * | I2Cx, |
uint16_t | I2C_SMBUS_IT | ||
) |
Checks whether the specified SMBus raw interrupt status.
I2Cx | Pointer to selected I2C peripheral. This parameter can be one of the following values: I2C1. |
I2C_SMBUS_IT | specifies the SMBus interrupt source to check. This parameter can be one of the following values:
|
void I2C_SMBus_ITConfig | ( | I2C_TypeDef * | I2Cx, |
uint16_t | I2C_SMBUS_IT, | ||
FunctionalState | NewState | ||
) |
Enables or disables the specified SMBus interrupts.
I2Cx | Pointer to selected I2C peripheral. This parameter can be one of the following values: I2C1. |
I2C_SMBUS_IT | specifies the SMBus interrupt source to be enabled or disabled. This parameter can be a combination of the following values:
|
NewState | new state of the specified SMBus interrupt. This parameter can be: ENABLE or DISABLE. |
void I2C_TargetAddressConfig | ( | I2C_TypeDef * | I2Cx, |
uint32_t | TargetAddress | ||
) |
Configures the specified I2C target address.
I2Cx | Pointer to selected I2C peripheral. This parameter can be one of the following values: I2C1, I2C2. |
TargetAddress | specifies the I2C target address. |
void I2C_TxFIFOThresholdConfig | ( | I2C_TypeDef * | I2Cx, |
uint8_t | Threshold | ||
) |
Configures the Transmit FIFO threshold.
I2Cx | Pointer to selected I2C peripheral. This parameter can be one of the following values: I2C1, I2C2. |
Threshold | The Transmit FIFO threshold to set. |
void I2C_WriteDataCmd | ( | I2C_TypeDef * | I2Cx, |
uint16_t | I2C_DataCmd | ||
) |
Write data and command Tx FIFO.
I2Cx | Pointer to selected I2C peripheral. This parameter can be one of the following values: I2C1, I2C2. |
I2C_DataCmd | the data and command to write. |