Cortex-M4 specific GPIO HAL interface. More...
#include "utils/gpio_types.h"
Go to the source code of this file.
Functions | |
void | hal_gpio_setmode (hal_gpio_pin pin, hal_gpio_mode mode, hal_gpio_pullup_pulldown pupd) |
Set the mode of a GPIO pin. | |
hal_gpio_mode | hal_gpio_getmode (hal_gpio_pin pin) |
Get the current mode of a GPIO pin. | |
void | hal_gpio_digitalwrite (hal_gpio_pin pin, hal_gpio_state state) |
Write a digital state to a GPIO pin. | |
hal_gpio_state | hal_gpio_digitalread (hal_gpio_pin pin) |
Read the digital state from a GPIO pin. | |
void | hal_gpio_enable_rcc (hal_gpio_pin pin) |
Enable the RCC clock for a specific GPIO pin's port. | |
void | hal_gpio_set_alternate_function (hal_gpio_pin pin, hal_gpio_alternate_function_t alt_fn) |
Set the alternate function for a GPIO pin. | |
void | hal_gpio_set_output_type (hal_gpio_pin pin, hal_gpio_output_type otyper) |
Set the output type for a GPIO pin. | |
void | hal_gpio_set_output_speed (hal_gpio_pin pin, hal_gpio_output_speed speed) |
Set the output speed for a GPIO pin. |
Cortex-M4 specific GPIO HAL interface.
This header defines the function prototypes for configuring and controlling GPIO pins on Cortex-M4 microcontrollers. Functions include setting pin modes, reading and writing digital states, enabling clocks, and configuring alternate functions, output type, and speed.
hal_gpio_state hal_gpio_digitalread | ( | hal_gpio_pin | pin | ) |
Read the digital state from a GPIO pin.
pin | The GPIO pin to read. |
Read the digital state from a GPIO pin.
pin | Pin identifier. |
void hal_gpio_digitalwrite | ( | hal_gpio_pin | pin, |
hal_gpio_state | state ) |
Write a digital state to a GPIO pin.
pin | The GPIO pin to write. |
state | The digital state to set (HIGH/LOW). |
Write a digital state to a GPIO pin.
pin | Pin identifier. |
state | Desired pin state (high or low). // Example: Set PA5 high
hal_gpio_digitalwrite(PA5, HAL_GPIO_HIGH);
void hal_gpio_digitalwrite(hal_gpio_pin pin, hal_gpio_state state) Write a digital state to a GPIO pin. Definition gpio.c:61 |
void hal_gpio_enable_rcc | ( | hal_gpio_pin | pin | ) |
Enable the RCC clock for a specific GPIO pin's port.
pin | The GPIO pin whose port clock is to be enabled. |
Enable the RCC clock for a specific GPIO pin's port.
pin | Pin identifier. |
hal_gpio_mode hal_gpio_getmode | ( | hal_gpio_pin | pin | ) |
Get the current mode of a GPIO pin.
pin | The GPIO pin to query. |
pin | Pin identifier. |
void hal_gpio_set_alternate_function | ( | hal_gpio_pin | pin, |
hal_gpio_alternate_function_t | alt_fn ) |
Set the alternate function for a GPIO pin.
pin | The GPIO pin to configure. |
alt_fn | The alternate function to assign to the pin. |
Set the alternate function for a GPIO pin.
pin | Pin identifier. |
alt_fn | Alternate function number/type. |
void hal_gpio_set_output_speed | ( | hal_gpio_pin | pin, |
hal_gpio_output_speed | speed ) |
Set the output speed for a GPIO pin.
pin | The GPIO pin to configure. |
speed | The output speed (low, medium, high, very high). |
void hal_gpio_set_output_type | ( | hal_gpio_pin | pin, |
hal_gpio_output_type | otyper ) |
Set the output type for a GPIO pin.
pin | The GPIO pin to configure. |
otyper | The output type (push-pull or open-drain). |
void hal_gpio_setmode | ( | hal_gpio_pin | pin, |
hal_gpio_mode | mode, | ||
hal_gpio_pullup_pulldown | pupd ) |
Set the mode of a GPIO pin.
pin | The GPIO pin to configure. |
mode | The desired mode (input, output, alternate function, analog). |
pupd | Pull-up/pull-down configuration for the pin. |
Set the mode of a GPIO pin.
pin | Pin identifier. |
mode | GPIO mode (input, output, alternate function, analog). |
pupd | Pull-up/pull-down configuration. |