11#include <driver/gpio.h>
12#include <freertos/FreeRTOS.h>
38 static constexpr const char* TAG =
"HAL::GPIO";
40 mutable SemaphoreHandle_t mutex;
42 struct saved_config_entry_t {
47 std::vector<saved_config_entry_t> registered_entries;
50 explicit Controller();
64 static Controller _instance;
void set_level(gpio_num_t gpio_pin, level_t level) const
Sets the level of the given GPIO pin.
Definition gpio.cpp:91
void add(const pin_config_t &entry)
Configures a new GPIO pin using the given config.
Definition gpio.cpp:45
Controller & operator=(const Controller &)=delete
level_t get_level(gpio_num_t gpio_pin) const
Gets the level of the given GPIO pin.
Definition gpio.cpp:110
static Controller & get_instance()
Gets the controller instance.
Definition gpio.h:63
void shutdown()
Resets all pins and shuts down the controller.
Definition gpio.cpp:33
Controller(const Controller &)=delete
A namespace containing all components of the GPIO hardware abstraction layer.
Definition gpio.h:17
uint64_t bitmask_t
Definition gpio.h:18
level_t
Definition gpio.h:28
@ LOW
Definition gpio.h:29
@ HIGH
Definition gpio.h:30
gpio_pull_mode_t pull_mode
Definition gpio.h:24
gpio_int_type_t intr_type
Definition gpio.h:25
gpio_mode_t mode
Definition gpio.h:23
gpio_num_t gpio_pin
Definition gpio.h:22