12#include <driver/gpio.h>
13#include <freertos/FreeRTOS.h>
43 static constexpr const char* TAG =
"HAL::GPIO";
46 mutable SemaphoreHandle_t mutex;
48 struct saved_config_entry_t {
53 std::vector<saved_config_entry_t> registered_entries;
56 explicit Controller();
70 static Controller _instance;
void enable_interrupts() const
Installs the ETS_GPIO_INTR_SOURCE ISR service to enable per-pin interrupts.
Definition gpio.cpp:40
void set_level(gpio_num_t gpio_pin, level_t level) const
Sets the level of the given GPIO pin.
Definition gpio.cpp:110
void add(const pin_config_t &entry)
Configures a new GPIO pin using the given config.
Definition gpio.cpp:57
fast_gpio_path_t get_fast_path_data(gpio_num_t gpio_pin) const
Gets data like the pin bit mask and necessary register addresses to address a pin directly for things...
Definition gpio.cpp:153
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:131
static Controller & get_instance()
Gets the controller instance.
Definition gpio.h:69
void shutdown()
Resets all pins and shuts down the controller.
Definition gpio.cpp:45
Controller(const Controller &)=delete
log_source
Definition log_sources.h:12
@ LOG_SOURCE_HAL_GPIO
Definition log_sources.h:15
A namespace containing all components of the GPIO hardware abstraction layer.
Definition gpio.h:19
level_t
Definition gpio.h:20
@ LOW
Definition gpio.h:21
@ HIGH
Definition gpio.h:22
volatile uint32_t * set_register
Definition gpio.h:33
uint32_t pin_mask
Definition gpio.h:35
volatile uint32_t * clear_register
Definition gpio.h:34
gpio_pull_mode_t pull_mode
Definition gpio.h:28
gpio_int_type_t intr_type
Definition gpio.h:29
gpio_mode_t mode
Definition gpio.h:27
gpio_num_t gpio_pin
Definition gpio.h:26