STM32F4 Standard Peripheral bibliotheek
1.0
ST Microelectronics bibliotheek documentatie voor de STM32F4 Standard Peripheral Library
|
GPIO driver modules. More...
Modules | |
GPIO_Exported_Constants | |
GPIO_Private_Functions | |
Data Structures | |
struct | GPIO_InitTypeDef |
GPIO Init structure definition. More... | |
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_Speed_2MHz = 0x00, GPIO_Speed_25MHz = 0x01, GPIO_Speed_50MHz = 0x02, GPIO_Speed_100MHz = 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) |
Deinitializes 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 | ) |
#define IS_GPIO_MODE | ( | MODE | ) |
#define IS_GPIO_PUPD | ( | PUPD | ) |
#define IS_GPIO_SPEED | ( | SPEED | ) |
enum GPIOMode_TypeDef |
enum GPIOSpeed_TypeDef |
void GPIO_DeInit | ( | GPIO_TypeDef * | GPIOx | ) |
Deinitializes the GPIOx peripheral registers to their default reset values.
GPIOx,: | where x can be (A..I) to select the GPIO peripheral. |
None |
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..I) to select the GPIO peripheral. |
GPIO_InitStruct,: | pointer to a GPIO_InitTypeDef structure that contains the configuration information for the specified GPIO peripheral. |
None |
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..I) to select the GPIO peripheral. |
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 |
void GPIO_PinLockConfig | ( | GPIO_TypeDef * | GPIOx, |
uint16_t | GPIO_Pin | ||
) |
Locks GPIO Pins configuration registers.
GPIOx,: | where x can be (A..I) to select the GPIO peripheral. |
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 |
uint16_t GPIO_ReadInputData | ( | GPIO_TypeDef * | GPIOx | ) |
Reads the specified GPIO input data port.
GPIOx,: | where x can be (A..I) 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..I) 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..15). |
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..I) 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..I) 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..15). |
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..I) 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..15). |
None |
void GPIO_SetBits | ( | GPIO_TypeDef * | GPIOx, |
uint16_t | GPIO_Pin | ||
) |
Sets the selected data port bits.
GPIOx,: | where x can be (A..I) 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..15). |
None |
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 |
void GPIO_ToggleBits | ( | GPIO_TypeDef * | GPIOx, |
uint16_t | GPIO_Pin | ||
) |
Toggles the specified GPIO pins..
GPIOx,: | where x can be (A..I) to select the GPIO peripheral. |
GPIO_Pin,: | Specifies the pins to be toggled. |
None |
void GPIO_Write | ( | GPIO_TypeDef * | GPIOx, |
uint16_t | PortVal | ||
) |
Writes data to the specified GPIO data port.
GPIOx,: | where x can be (A..I) 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..I) 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..15). |
BitVal,: | specifies the value to be written to the selected bit. This parameter can be one of the BitAction enum values:
|
None |