|
MG32L003 Standard Peripherals Firmware Library
|
I2C driver modules. More...
Modules | |
| I2C_Exported_Constants | |
| I2C_Private_Functions | |
Data Structures | |
| struct | I2C_InitTypeDef |
| I2C Initial Configuration Structure definition. More... | |
Enumerations | |
| enum | I2CStatus { I2C_ERROR = 0, I2C_OK = 1, I2C_SUCCESS = 2, I2C_WAITING = 3 } |
| I2CStatus enum definition. More... | |
Functions | |
| void | I2C_DeInit (void) |
| Deinitializes the I2C peripheral registers to their default reset values. More... | |
| void | I2C_Init (I2C_InitTypeDef *I2C_InitStruct) |
| Initializes the I2C peripheral according to the specified parameters in the I2C_InitStruct. More... | |
| void | I2C_SlaveAddressConfig (uint32_t SlaveAddress) |
| Configures the I2C slave address. More... | |
| void | I2C_HighSpeedModeCmd (FunctionalState NewState) |
| Configures I2C high speed mode. More... | |
| void | I2C_SwitchStatus (uint8_t I2C_STA, uint8_t I2C_STO, uint8_t I2C_AA) |
| Writes I2C CR register for switching I2C bus status. More... | |
| void | I2C_Start (FunctionalState NewState) |
| Sets or clears I2C peripheral start status. More... | |
| void | I2C_Stop (FunctionalState NewState) |
| Sets or clears I2C peripheral stop status. More... | |
| void | I2C_ACK (FunctionalState NewState) |
| Sets or clears I2C peripheral ACK status. More... | |
| void | I2C_Cmd (FunctionalState NewState) |
| Enables or disables I2C peripheral. More... | |
| void | I2C_AckGeneralCallCmd (FunctionalState NewState) |
| Enables or disables the general ack. More... | |
| void | I2C_ReceiveByte (uint8_t *pData) |
| Reads data from data register. More... | |
| void | I2C_WriteByte (uint8_t I2C_DataCmd) |
| Write one byte data. More... | |
| void | I2C_WriteAddress (uint8_t Address, uint8_t I2C_Direction) |
| Write the slave address byte by the direction. More... | |
| I2CStatus | I2C_CheckFlag (uint32_t *I2C_Flag) |
| Gets the last I2C module status flag. More... | |
| ITStatus | I2C_GetITStatus (void) |
| Checks whether I2C interrupt has occurred or not. More... | |
| void | I2C_ClearITPendingBit (void) |
| Clears I2C interrupt pending bit. More... | |
I2C driver modules.
| enum I2CStatus |
| void I2C_ACK | ( | FunctionalState | NewState | ) |
Sets or clears I2C peripheral ACK status.
| NewState | The new state of the I2C ack status. This parameter can be: ENABLE or DISABLE. |
| None |
| void I2C_AckGeneralCallCmd | ( | FunctionalState | NewState | ) |
Enables or disables the general ack.
| NewState | The new state of the general ack function. This parameter can be: ENABLE or DISABLE. |
| None |
| I2CStatus I2C_CheckFlag | ( | uint32_t * | I2C_Flag | ) |
Gets the last I2C module status flag.
| None |
| An | I2C Status enumeration value:
|
| void I2C_ClearITPendingBit | ( | void | ) |
Clears I2C interrupt pending bit.
| None |
| None |
| void I2C_Cmd | ( | FunctionalState | NewState | ) |
Enables or disables I2C peripheral.
| NewState | The new state of the I2C peripheral. This parameter can be: ENABLE or DISABLE. |
| None |
| void I2C_DeInit | ( | void | ) |
Deinitializes the I2C peripheral registers to their default reset values.
| None |
| None |
| ITStatus I2C_GetITStatus | ( | void | ) |
Checks whether I2C interrupt has occurred or not.
| None |
| The | new state of I2C_IT (SET or RESET). |
| void I2C_HighSpeedModeCmd | ( | FunctionalState | NewState | ) |
Configures I2C high speed mode.
| NewState | The new state of the I2C high speed mode. This parameter can be: ENABLE or DISABLE. |
| None |
| void I2C_Init | ( | I2C_InitTypeDef * | I2C_InitStruct | ) |
Initializes the I2C peripheral according to the specified parameters in the I2C_InitStruct.
| I2C_InitStruct | Pointer to I2C initialization structure. |
| None |
| void I2C_ReceiveByte | ( | uint8_t * | pData | ) |
Reads data from data register.
| pData | pointer to reveive date buffer. |
| None |
| void I2C_SlaveAddressConfig | ( | uint32_t | SlaveAddress | ) |
Configures the I2C slave address.
| SlaveAddress | specifies the I2C slave address. |
| None |
| void I2C_Start | ( | FunctionalState | NewState | ) |
Sets or clears I2C peripheral start status.
| NewState | The new state of the I2C start status. This parameter can be: ENABLE or DISABLE. |
| None |
| void I2C_Stop | ( | FunctionalState | NewState | ) |
Sets or clears I2C peripheral stop status.
| NewState | The new state of the I2C stop status. This parameter can be: ENABLE or DISABLE. |
| None |
| void I2C_SwitchStatus | ( | uint8_t | I2C_STA, |
| uint8_t | I2C_STO, | ||
| uint8_t | I2C_AA | ||
| ) |
Writes I2C CR register for switching I2C bus status.
| I2C_STA | The new state of the I2C start status. This parameter can be: I2C_STA_0 or I2C_STA_1. |
| I2C_STO | The new state of the I2C stop status. This parameter can be: I2C_STO_0 or I2C_STO_1. |
| I2C_AA | The new state of the I2C ack status. This parameter can be: I2C_AA_0 or I2C_AA_1. |
| None |
| void I2C_WriteAddress | ( | uint8_t | Address, |
| uint8_t | I2C_Direction | ||
| ) |
Write the slave address byte by the direction.
| Address | specifies the slave address to write. |
| I2C_Direction | specifies whether the I2C device will be a Transmitter or a Receiver. This parameter can be one of the following values
|
| None |
| void I2C_WriteByte | ( | uint8_t | I2C_DataCmd | ) |
Write one byte data.
| I2C_DataCmd | the data and command to send. |
| None. |