CARME-M4 BSP
V1.5
|
GPIO driver modules. More...
Modules | |
GPIO_Exported_Constants | |
GPIO_Private_Functions | |
Data Structures | |
struct | GPIO_InitTypeDef |
GPIO Init structure definition. More... | |
Macros | |
#define | IS_GPIO_ALL_PERIPH(PERIPH) |
#define | IS_GPIO_MODE(MODE) |
#define | IS_GPIO_OTYPE(OTYPE) (((OTYPE) == GPIO_OType_PP) || ((OTYPE) == GPIO_OType_OD)) |
#define | GPIO_Speed_2MHz GPIO_Low_Speed |
#define | GPIO_Speed_25MHz GPIO_Medium_Speed |
#define | GPIO_Speed_50MHz GPIO_Fast_Speed |
#define | GPIO_Speed_100MHz GPIO_High_Speed |
#define | IS_GPIO_SPEED(SPEED) |
#define | IS_GPIO_PUPD(PUPD) |
#define | IS_GPIO_BIT_ACTION(ACTION) (((ACTION) == Bit_RESET) || ((ACTION) == Bit_SET)) |
Enumerations | |
enum | GPIOMode_TypeDef { GPIO_Mode_IN = 0x00, GPIO_Mode_OUT = 0x01, GPIO_Mode_AF = 0x02, GPIO_Mode_AN = 0x03 } |
GPIO Configuration Mode enumeration. More... | |
enum | GPIOOType_TypeDef { GPIO_OType_PP = 0x00, GPIO_OType_OD = 0x01 } |
GPIO Output type enumeration. | |
enum | GPIOSpeed_TypeDef { GPIO_Low_Speed = 0x00, GPIO_Medium_Speed = 0x01, GPIO_Fast_Speed = 0x02, GPIO_High_Speed = 0x03 } |
GPIO Output Maximum frequency enumeration. More... | |
enum | GPIOPuPd_TypeDef { GPIO_PuPd_NOPULL = 0x00, GPIO_PuPd_UP = 0x01, GPIO_PuPd_DOWN = 0x02 } |
GPIO Configuration PullUp PullDown enumeration. | |
enum | BitAction { Bit_RESET = 0, Bit_SET } |
GPIO Bit SET and Bit RESET enumeration. | |
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, GPIO_InitTypeDef *GPIO_InitStruct) |
Initializes the GPIOx peripheral according to the specified parameters in the GPIO_InitStruct. More... | |
void | GPIO_StructInit (GPIO_InitTypeDef *GPIO_InitStruct) |
Fills each GPIO_InitStruct member with its default value. More... | |
void | GPIO_PinLockConfig (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin) |
Locks GPIO Pins configuration registers. 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) |
Toggles the specified GPIO pins.. More... | |
void | GPIO_PinAFConfig (GPIO_TypeDef *GPIOx, uint16_t GPIO_PinSource, uint8_t GPIO_AF) |
Changes the mapping of the specified pin. More... | |
GPIO driver modules.
#define IS_GPIO_ALL_PERIPH | ( | PERIPH | ) |
Definition at line 50 of file stm32f4xx_gpio.h.
#define IS_GPIO_MODE | ( | MODE | ) |
Definition at line 72 of file stm32f4xx_gpio.h.
#define IS_GPIO_PUPD | ( | PUPD | ) |
Definition at line 115 of file stm32f4xx_gpio.h.
#define IS_GPIO_SPEED | ( | SPEED | ) |
Definition at line 103 of file stm32f4xx_gpio.h.
enum GPIOMode_TypeDef |
GPIO Configuration Mode enumeration.
Enumerator | |
---|---|
GPIO_Mode_IN |
GPIO Input Mode |
GPIO_Mode_OUT |
GPIO Output Mode |
GPIO_Mode_AF |
GPIO Alternate function Mode |
GPIO_Mode_AN |
GPIO Analog Mode |
Definition at line 65 of file stm32f4xx_gpio.h.
enum GPIOSpeed_TypeDef |
GPIO Output Maximum frequency enumeration.
Enumerator | |
---|---|
GPIO_Low_Speed |
Low speed |
GPIO_Medium_Speed |
Medium speed |
GPIO_Fast_Speed |
Fast speed |
GPIO_High_Speed |
High speed |
Definition at line 89 of file stm32f4xx_gpio.h.
void GPIO_DeInit | ( | GPIO_TypeDef * | GPIOx | ) |
De-initializes the GPIOx peripheral registers to their default reset values.
GPIOx | where x can be (A..K) to select the GPIO peripheral for STM32F405xx/407xx and STM32F415xx/417xx devices x can be (A..I) to select the GPIO peripheral for STM32F42xxx/43xxx devices. x can be (A, B, C, D and H) to select the GPIO peripheral for STM32F401xx devices. |
None |
Definition at line 127 of file stm32f4xx_gpio.c.
void GPIO_Init | ( | GPIO_TypeDef * | GPIOx, |
GPIO_InitTypeDef * | GPIO_InitStruct | ||
) |
Initializes the GPIOx peripheral according to the specified parameters in the GPIO_InitStruct.
GPIOx | where x can be (A..K) to select the GPIO peripheral for STM32F405xx/407xx and STM32F415xx/417xx devices x can be (A..I) to select the GPIO peripheral for STM32F42xxx/43xxx devices. x can be (A, B, C, D and H) to select the GPIO peripheral for STM32F401xx devices. |
GPIO_InitStruct | pointer to a GPIO_InitTypeDef structure that contains the configuration information for the specified GPIO peripheral. |
None |
Definition at line 202 of file stm32f4xx_gpio.c.
void GPIO_PinAFConfig | ( | GPIO_TypeDef * | GPIOx, |
uint16_t | GPIO_PinSource, | ||
uint8_t | GPIO_AF | ||
) |
Changes the mapping of the specified pin.
GPIOx | where x can be (A..K) to select the GPIO peripheral for STM32F405xx/407xx and STM32F415xx/417xx devices x can be (A..I) to select the GPIO peripheral for STM32F42xxx/43xxx devices. x can be (A, B, C, D and H) to select the GPIO peripheral for STM32F401xx devices. |
GPIO_PinSource | specifies the pin for the Alternate function. This parameter can be GPIO_PinSourcex where x can be (0..15). |
GPIO_AFSelection | selects the pin to used as Alternate function. This parameter can be one of the following values:
|
None |
Definition at line 579 of file stm32f4xx_gpio.c.
void GPIO_PinLockConfig | ( | GPIO_TypeDef * | GPIOx, |
uint16_t | GPIO_Pin | ||
) |
Locks GPIO Pins configuration registers.
GPIOx | where x can be (A..K) to select the GPIO peripheral for STM32F405xx/407xx and STM32F415xx/417xx devices x can be (A..I) to select the GPIO peripheral for STM32F42xxx/43xxx devices. x can be (A, B, C, D and H) to select the GPIO peripheral for STM32F401xx devices. |
GPIO_Pin | specifies the port bit to be locked. This parameter can be any combination of GPIO_Pin_x where x can be (0..15). |
None |
Definition at line 277 of file stm32f4xx_gpio.c.
uint16_t GPIO_ReadInputData | ( | GPIO_TypeDef * | GPIOx | ) |
Reads the specified GPIO input data port.
GPIOx | where x can be (A..K) to select the GPIO peripheral for STM32F405xx/407xx and STM32F415xx/417xx devices x can be (A..I) to select the GPIO peripheral for STM32F42xxx/43xxx devices. x can be (A, B, C, D and H) to select the GPIO peripheral for STM32F401xx devices. |
GPIO | input data port value. |
Definition at line 349 of file stm32f4xx_gpio.c.
uint8_t GPIO_ReadInputDataBit | ( | GPIO_TypeDef * | GPIOx, |
uint16_t | GPIO_Pin | ||
) |
Reads the specified input port pin.
GPIOx | where x can be (A..K) to select the GPIO peripheral for STM32F405xx/407xx and STM32F415xx/417xx devices x can be (A..I) to select the GPIO peripheral for STM32F42xxx/43xxx devices. x can be (A, B, C, D and H) to select the GPIO peripheral for STM32F401xx devices. |
GPIO_Pin | specifies the port bit to read. This parameter can be GPIO_Pin_x where x can be (0..15). |
The | input port pin value. |
Definition at line 323 of file stm32f4xx_gpio.c.
uint16_t GPIO_ReadOutputData | ( | GPIO_TypeDef * | GPIOx | ) |
Reads the specified GPIO output data port.
GPIOx | where x can be (A..K) to select the GPIO peripheral for STM32F405xx/407xx and STM32F415xx/417xx devices x can be (A..I) to select the GPIO peripheral for STM32F42xxx/43xxx devices. x can be (A, B, C, D and H) to select the GPIO peripheral for STM32F401xx devices. |
GPIO | output data port value. |
Definition at line 392 of file stm32f4xx_gpio.c.
uint8_t GPIO_ReadOutputDataBit | ( | GPIO_TypeDef * | GPIOx, |
uint16_t | GPIO_Pin | ||
) |
Reads the specified output data port bit.
GPIOx | where x can be (A..K) to select the GPIO peripheral for STM32F405xx/407xx and STM32F415xx/417xx devices x can be (A..I) to select the GPIO peripheral for STM32F42xxx/43xxx devices. x can be (A, B, C, D and H) to select the GPIO peripheral for STM32F401xx devices. |
GPIO_Pin | specifies the port bit to read. This parameter can be GPIO_Pin_x where x can be (0..15). |
The | output port pin value. |
Definition at line 366 of file stm32f4xx_gpio.c.
void GPIO_ResetBits | ( | GPIO_TypeDef * | GPIOx, |
uint16_t | GPIO_Pin | ||
) |
Clears the selected data port bits.
GPIOx | where x can be (A..K) to select the GPIO peripheral for STM32F405xx/407xx and STM32F415xx/417xx devices x can be (A..I) to select the GPIO peripheral for STM32F42xxx/43xxx devices. x can be (A, B, C, D and H) to select the GPIO peripheral for STM32F401xx devices. |
GPIO_Pin | specifies the port bits to be written. This parameter can be any combination of GPIO_Pin_x where x can be (0..15). |
None |
Definition at line 433 of file stm32f4xx_gpio.c.
void GPIO_SetBits | ( | GPIO_TypeDef * | GPIOx, |
uint16_t | GPIO_Pin | ||
) |
Sets the selected data port bits.
GPIOx | where x can be (A..K) to select the GPIO peripheral for STM32F405xx/407xx and STM32F415xx/417xx devices x can be (A..I) to select the GPIO peripheral for STM32F42xxx/43xxx devices. x can be (A, B, C, D and H) to select the GPIO peripheral for STM32F401xx devices. |
GPIO_Pin | specifies the port bits to be written. This parameter can be any combination of GPIO_Pin_x where x can be (0..15). |
None |
Definition at line 412 of file stm32f4xx_gpio.c.
void GPIO_StructInit | ( | GPIO_InitTypeDef * | GPIO_InitStruct | ) |
Fills each GPIO_InitStruct member with its default value.
GPIO_InitStruct | : pointer to a GPIO_InitTypeDef structure which will be initialized. |
None |
Definition at line 254 of file stm32f4xx_gpio.c.
void GPIO_ToggleBits | ( | GPIO_TypeDef * | GPIOx, |
uint16_t | GPIO_Pin | ||
) |
Toggles the specified GPIO pins..
GPIOx | where x can be (A..K) to select the GPIO peripheral for STM32F405xx/407xx and STM32F415xx/417xx devices x can be (A..I) to select the GPIO peripheral for STM32F42xxx/43xxx devices. x can be (A, B, C, D and H) to select the GPIO peripheral for STM32F401xx devices. |
GPIO_Pin | Specifies the pins to be toggled. |
None |
Definition at line 496 of file stm32f4xx_gpio.c.
void GPIO_Write | ( | GPIO_TypeDef * | GPIOx, |
uint16_t | PortVal | ||
) |
Writes data to the specified GPIO data port.
GPIOx | where x can be (A..K) to select the GPIO peripheral for STM32F405xx/407xx and STM32F415xx/417xx devices x can be (A..I) to select the GPIO peripheral for STM32F42xxx/43xxx devices. x can be (A, B, C, D and H) to select the GPIO peripheral for STM32F401xx devices. |
PortVal | specifies the value to be written to the port output data register. |
None |
Definition at line 480 of file stm32f4xx_gpio.c.
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..K) to select the GPIO peripheral for STM32F405xx/407xx and STM32F415xx/417xx devices x can be (A..I) to select the GPIO peripheral for STM32F42xxx/43xxx devices. x can be (A, B, C, D and H) to select the GPIO peripheral for STM32F401xx devices. |
GPIO_Pin | specifies the port bit to be written. This parameter can be one of GPIO_Pin_x where x can be (0..15). |
BitVal | specifies the value to be written to the selected bit. This parameter can be one of the BitAction enum values:
|
None |
Definition at line 455 of file stm32f4xx_gpio.c.