#include <stdint.h>
#include "stm32h7xx.h"
Go to the source code of this file.
◆ GPIO_ALT_FUN_00
| #define GPIO_ALT_FUN_00 (0x0) |
◆ GPIO_ALT_FUN_01
| #define GPIO_ALT_FUN_01 (0x1) |
◆ GPIO_ALT_FUN_02
| #define GPIO_ALT_FUN_02 (0x2) |
◆ GPIO_ALT_FUN_03
| #define GPIO_ALT_FUN_03 (0x3) |
◆ GPIO_ALT_FUN_04
| #define GPIO_ALT_FUN_04 (0x4) |
◆ GPIO_ALT_FUN_05
| #define GPIO_ALT_FUN_05 (0x5) |
◆ GPIO_ALT_FUN_06
| #define GPIO_ALT_FUN_06 (0x6) |
◆ GPIO_ALT_FUN_07
| #define GPIO_ALT_FUN_07 (0x7) |
◆ GPIO_ALT_FUN_08
| #define GPIO_ALT_FUN_08 (0x8) |
◆ GPIO_ALT_FUN_09
| #define GPIO_ALT_FUN_09 (0x9) |
◆ GPIO_ALT_FUN_10
| #define GPIO_ALT_FUN_10 (0xA) |
◆ GPIO_ALT_FUN_11
| #define GPIO_ALT_FUN_11 (0xB) |
◆ GPIO_ALT_FUN_12
| #define GPIO_ALT_FUN_12 (0xC) |
◆ GPIO_ALT_FUN_13
| #define GPIO_ALT_FUN_13 (0xD) |
◆ GPIO_ALT_FUN_14
| #define GPIO_ALT_FUN_14 (0xE) |
◆ GPIO_ALT_FUN_15
| #define GPIO_ALT_FUN_15 (0xF) |
◆ GPIO_ALT_MODE
| #define GPIO_ALT_MODE (0x2) |
◆ GPIO_ANALOG_MODE
| #define GPIO_ANALOG_MODE (0x3) |
◆ GPIO_IN_MODE
| #define GPIO_IN_MODE (0x0) |
◆ GPIO_OUT_MODE
| #define GPIO_OUT_MODE (0x1) |
◆ GPIO_SetPinAltFun()
| void GPIO_SetPinAltFun |
( |
GPIO_TypeDef * |
GPIOx, |
|
|
uint32_t |
Pin, |
|
|
uint32_t |
AltFun |
|
) |
| |
Set the alternate function of the pin. There are 2 registers to be addressed. It depends on the pin location and it is valid for each GPIO port.
- Pins 00-07 are in ARFL
- Pins 08-16 are in ARFH
- Parameters
-
| [in] | GPIOx | GPIO Handler |
| [in] | Pin | [e.g. pin 8 is 0b 0000 0000 0000 0000 0000 0001 0000 0000] |
| [in] | AltFun | [e.g. Alternate Function 9 is 0b 0000 0000 0000 0000 0000 0010 0000 0000] |
◆ GPIO_SetPinMode()
| void GPIO_SetPinMode |
( |
GPIO_TypeDef * |
GPIOx, |
|
|
uint32_t |
Pin, |
|
|
uint32_t |
Mode |
|
) |
| |
Set the mode of the pin. See GPIOx_MODER.
- Parameters
-
| [in] | GPIOx | GPIO Handler |
| [in] | Pin | [e.g. pin 8 is 0b 0000 0000 0000 0000 0000 0001 0000 0000] |
| [in] | Mode | [0 - Input, 1 - Output, 2 - Alternate, 3 - Analog] |