Core GPIO library.
More...
#include "stm32g4xx_hal.h"
#include <stdint.h>
#include <stdbool.h>
Go to the source code of this file.
|
| void | core_GPIO_init (GPIO_TypeDef *port, uint16_t pin, uint16_t dir, uint32_t pull) |
| | Initialize a GPIO pin.
|
| |
| void | core_GPIO_digital_write (GPIO_TypeDef *port, uint16_t pin, bool state) |
| | Set a digital output.
|
| |
| bool | core_GPIO_digital_read (GPIO_TypeDef *port, uint16_t pin) |
| | Read a digital input.
|
| |
| void | core_heartbeat_init (GPIO_TypeDef *port, uint16_t pin) |
| | Set a particular pin as the heartbeat LED output.
|
| |
|
void | core_GPIO_toggle_heartbeat () |
| | Toggle the heartbeat LED output.
|
| |
| void | core_GPIO_set_heartbeat (bool state) |
| | Set the state of the heartbeat LED.
|
| |
Core GPIO library.
This core library component is used to initialize and control GPIO pins.
◆ core_GPIO_digital_read()
| bool core_GPIO_digital_read |
( |
GPIO_TypeDef * | port, |
|
|
uint16_t | pin ) |
Read a digital input.
- Parameters
-
| port | GPIO port (GPIOx) |
| pin | GPIO pin (GPIO_PIN_x) |
- Returns
- The state of the pin
◆ core_GPIO_digital_write()
| void core_GPIO_digital_write |
( |
GPIO_TypeDef * | port, |
|
|
uint16_t | pin, |
|
|
bool | state ) |
Set a digital output.
- Parameters
-
| port | GPIO port (GPIOx) |
| pin | GPIO pin (GPIO_PIN_x) |
| state | The desired setting of the output |
◆ core_GPIO_init()
| void core_GPIO_init |
( |
GPIO_TypeDef * | port, |
|
|
uint16_t | pin, |
|
|
uint16_t | dir, |
|
|
uint32_t | pull ) |
Initialize a GPIO pin.
- Parameters
-
| port | Port on which the pin is located (GPIOx) |
| pin | Pin number (GPIO_PIN_x) |
| dir | Direction or pin mode (GPIO_MODE_INPUT, GPIO_MODE_OUTPUT_PP, GPIO_MODE_OUTPUT_OD, GPIO_MODE_AF_PP, GPIO_MODE_AF_OD, or GPIO_MODE_ANALOG) |
| pull | Pullup/pulldown resistor configuration (GPIO_NOPULL, GPIO_PULLUP, GPIO_PULLDOWN) |
◆ core_GPIO_set_heartbeat()
| void core_GPIO_set_heartbeat |
( |
bool | state | ) |
|
Set the state of the heartbeat LED.
- Parameters
-
| state | The desired setting of the output |
◆ core_heartbeat_init()
| void core_heartbeat_init |
( |
GPIO_TypeDef * | port, |
|
|
uint16_t | pin ) |
Set a particular pin as the heartbeat LED output.
- Parameters
-
| port | GPIO port (GPIOx) |
| pin | GPIO pin (GPIO_PIN_x) |