MG32L003 Standard Peripherals Firmware Library
|
GPIO driver modules. More...
Modules | |
GPIO_Exported_Constants | |
GPIO_Private_Functions | |
Functions | |
void | GPIO_DeInit (GPIO_TypeDef *GPIOx) |
De-initializes the GPIOx peripheral registers to their default reset values. More... | |
void | GPIO_Init (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, uint32_t PinConfig) |
Initializes the GPIOx peripheral according to the PinConfig. More... | |
void | GPIO_SetAFPin (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, uint32_t Alternate) |
Configure gpio alternate function of any pins for a dedicated port. More... | |
uint8_t | GPIO_ReadInputDataBit (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin) |
Reads the specified input port pin. More... | |
uint16_t | GPIO_ReadInputData (GPIO_TypeDef *GPIOx) |
Reads the specified GPIO input data port. More... | |
uint8_t | GPIO_ReadOutputDataBit (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin) |
Reads the specified output data port bit. More... | |
uint16_t | GPIO_ReadOutputData (GPIO_TypeDef *GPIOx) |
Reads the specified GPIO output data port. More... | |
void | GPIO_SetBits (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin) |
Sets the selected data port bits. More... | |
void | GPIO_ResetBits (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin) |
Clears the selected data port bits. More... | |
void | GPIO_WriteBit (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, BitAction BitVal) |
Sets or clears the selected data port bit. More... | |
void | GPIO_Write (GPIO_TypeDef *GPIOx, uint16_t PortVal) |
Writes data to the specified GPIO data port. More... | |
void | GPIO_ToggleBits (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin) |
Toggle data value for several pin of specified port. More... | |
void | GPIO_DriveCurrentConfig (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, uint32_t Current) |
Configure the drive current of several pins for a specified port. More... | |
void | GPIO_EXTIConfig (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, uint32_t EXTI_Config) |
Handles the configuration of GPIO_Pin's EXTI. More... | |
void | GPIO_DebounceConfig (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, uint32_t DebounceConfig) |
Handles the configuration of GPIO debounce. More... | |
FlagStatus | GPIO_EXTI_GetFlagStatus (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin) |
Checks whether the specified GPIO_Pin's EXTI line flag is set or not. More... | |
void | GPIO_EXTI_ClearFlag (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin) |
Clears the GPIO_Pin's EXTI line pending flags. More... | |
ITStatus | GPIO_EXTI_GetIT (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin) |
Checks that the interrupt of the EXTI line for the specified GPIO Pin is enabled. More... | |
void | GPIO_EXTI_ClearIT (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin) |
Clears the GPIO_Pin's EXTI line pending bits. More... | |
GPIO driver modules.
#define IS_GET_GPIO_PIN | ( | PIN | ) |
#define IS_GPIO_ALL_PERIPH | ( | PERIPH | ) |
void GPIO_DebounceConfig | ( | GPIO_TypeDef * | GPIOx, |
uint16_t | GPIO_Pin, | ||
uint32_t | DebounceConfig | ||
) |
Handles the configuration of GPIO debounce.
GPIOx | Where x can be (A..D) to select the GPIO peripheral. |
GPIO_Pin | Specifies the pins to be configured. This parameter can be any combination of GPIO_Pin_x where x can be (0..7). |
DebounceConfig | The port bit configuration. This parameter must be a combination of one GPIO_DB_x flags. |
None |
void GPIO_DeInit | ( | GPIO_TypeDef * | GPIOx | ) |
De-initializes the GPIOx peripheral registers to their default reset values.
GPIOx | Where x can be (A..D) to select the GPIO peripheral. |
None |
void GPIO_DriveCurrentConfig | ( | GPIO_TypeDef * | GPIOx, |
uint16_t | GPIO_Pin, | ||
uint32_t | Current | ||
) |
Configure the drive current of several pins for a specified port.
GPIOx | Where x can be (A..D) to select the GPIO peripheral. |
GPIO_Pin | Specifies the pins to be configured. This parameter can be any combination of GPIO_Pin_x where x can be (0..7). |
Current | Specifies the drive current. This parameter can be one of the following values:
|
None |
void GPIO_EXTI_ClearFlag | ( | GPIO_TypeDef * | GPIOx, |
uint16_t | GPIO_Pin | ||
) |
Clears the GPIO_Pin's EXTI line pending flags.
GPIOx | Where x can be (A..D) to select the GPIO peripheral. |
GPIO_Pin | Specifies the pins flags to clear. This parameter can be any combination of GPIO_Pin_x where x can be (0..7). |
None |
void GPIO_EXTI_ClearIT | ( | GPIO_TypeDef * | GPIOx, |
uint16_t | GPIO_Pin | ||
) |
Clears the GPIO_Pin's EXTI line pending bits.
GPIOx | Where x can be (A..D) to select the GPIO peripheral. |
GPIO_Pin | Specifies the GPIO_Pin's EXTI lines to clear. This parameter can be any combination of GPIO_Pin_x where x can be (0..7). |
None |
FlagStatus GPIO_EXTI_GetFlagStatus | ( | GPIO_TypeDef * | GPIOx, |
uint16_t | GPIO_Pin | ||
) |
Checks whether the specified GPIO_Pin's EXTI line flag is set or not.
GPIOx | Where x can be (A..D) to select the GPIO peripheral. |
GPIO_Pin | specifies the pins flag to check. This parameter can be any combination of GPIO_Pin_x where x can be (0..7). |
The | new state of GPIO_Pin's EXTI line (SET or RESET). |
ITStatus GPIO_EXTI_GetIT | ( | GPIO_TypeDef * | GPIOx, |
uint16_t | GPIO_Pin | ||
) |
Checks that the interrupt of the EXTI line for the specified GPIO Pin is enabled.
GPIOx | Where x can be (A..D) to select the GPIO peripheral. |
GPIO_Pin | Specifies the pins to check. This parameter can be any combination of GPIO_Pin_x where x can be (0..7). |
The | new state of interrupt enabled for the GPIO_Pin's EXTI line (SET or RESET). |
void GPIO_EXTIConfig | ( | GPIO_TypeDef * | GPIOx, |
uint16_t | GPIO_Pin, | ||
uint32_t | EXTI_Config | ||
) |
Handles the configuration of GPIO_Pin's EXTI.
GPIOx | Where x can be (A..D) to select the GPIO peripheral. |
GPIO_Pin | Specifies the pins to be configured. This parameter can be any combination of GPIO_Pin_x where x can be (0..7). |
EXTI_Config | The port bit configuration. This parameter must be a combination of one GPIO_EXTI_define GPIO_EXTI_x flags. |
None |
void GPIO_Init | ( | GPIO_TypeDef * | GPIOx, |
uint16_t | GPIO_Pin, | ||
uint32_t | PinConfig | ||
) |
Initializes the GPIOx peripheral according to the PinConfig.
GPIOx | Where x can be (A..D) to select the GPIO peripheral. |
GPIO_Pin | Specifies the port bit to be initialized. This parameter can be any combination of GPIO_Pin_x where x can be (0..7). |
PinConfig | The port bit configuration. This parameter must be a combination of one GPIO_MODE_x flag, one GPIO_OTYPE_x flag, one GPIO_PUPD_x flag, one GPIO_DRV_x flag, one GPIO_SPEED_x flag and one GPIO_AFx flag. |
None |
uint16_t GPIO_ReadInputData | ( | GPIO_TypeDef * | GPIOx | ) |
Reads the specified GPIO input data port.
GPIOx | Where x can be (A..D) to select the GPIO peripheral. |
GPIO | input data port value. |
uint8_t GPIO_ReadInputDataBit | ( | GPIO_TypeDef * | GPIOx, |
uint16_t | GPIO_Pin | ||
) |
Reads the specified input port pin.
GPIOx | Where x can be (A..D) to select the GPIO peripheral. |
GPIO_Pin | Specifies the port bit to read. This parameter can be GPIO_Pin_x where x can be (0..7). |
The | input port pin value. |
uint16_t GPIO_ReadOutputData | ( | GPIO_TypeDef * | GPIOx | ) |
Reads the specified GPIO output data port.
GPIOx | Where x can be (A..D) to select the GPIO peripheral. |
GPIO | output data port value. |
uint8_t GPIO_ReadOutputDataBit | ( | GPIO_TypeDef * | GPIOx, |
uint16_t | GPIO_Pin | ||
) |
Reads the specified output data port bit.
GPIOx | Where x can be (A..D) to select the GPIO peripheral. |
GPIO_Pin | Specifies the port bit to read. This parameter can be GPIO_Pin_x where x can be (0..7). |
The | output port pin value. |
void GPIO_ResetBits | ( | GPIO_TypeDef * | GPIOx, |
uint16_t | GPIO_Pin | ||
) |
Clears the selected data port bits.
GPIOx | Where x can be (A..D) to select the GPIO peripheral. |
GPIO_Pin | Specifies the port bits to be written. This parameter can be any combination of GPIO_Pin_x where x can be (0..7). |
None |
void GPIO_SetAFPin | ( | GPIO_TypeDef * | GPIOx, |
uint16_t | GPIO_Pin, | ||
uint32_t | Alternate | ||
) |
Configure gpio alternate function of any pins for a dedicated port.
GPIOx | Where x can be (A..D) to select the GPIO peripheral. |
GPIO_Pin | Specifies the port bits to configure. This parameter can be any combination of GPIO_Pin_x where x can be (0..7). |
Alternate | This parameter can be GPIO_AFx where x can be (0..15). |
None |
void GPIO_SetBits | ( | GPIO_TypeDef * | GPIOx, |
uint16_t | GPIO_Pin | ||
) |
Sets the selected data port bits.
GPIOx | Where x can be (A..D) to select the GPIO peripheral. |
GPIO_Pin | Specifies the port bits to be written. This parameter can be any combination of GPIO_Pin_x where x can be (0..7). |
None |
void GPIO_ToggleBits | ( | GPIO_TypeDef * | GPIOx, |
uint16_t | GPIO_Pin | ||
) |
Toggle data value for several pin of specified port.
GPIOx | Where x can be (A..D) to select the GPIO peripheral. |
GPIO_Pin | Specifies the pins to be toggled. This parameter can be any combination of GPIO_Pin_x where x can be (0..7). |
None |
void GPIO_Write | ( | GPIO_TypeDef * | GPIOx, |
uint16_t | PortVal | ||
) |
Writes data to the specified GPIO data port.
GPIOx | Where x can be (A..D) to select the GPIO peripheral. |
PortVal | Specifies the value to be written to the port output data register. |
None |
void GPIO_WriteBit | ( | GPIO_TypeDef * | GPIOx, |
uint16_t | GPIO_Pin, | ||
BitAction | BitVal | ||
) |
Sets or clears the selected data port bit.
GPIOx | Where x can be (A..D) to select the GPIO peripheral. |
GPIO_Pin | Specifies the port bit to be written. This parameter can be one of GPIO_Pin_x where x can be (0..7). |
BitVal | Specifies the value to be written to the selected bit. This parameter can be one of the BitAction enum values:
|
None |