Boboter
Loading...
Searching...
No Matches
HAL::GPIO::Controller Class Reference

The GPIO hardware abstraction layer's control class. More...

#include <gpio.h>

Public Member Functions

 Controller (const Controller &)=delete
Controller & operator= (const Controller &)=delete
void shutdown ()
 Resets all pins and shuts down the controller.
void add (const pin_config_t &entry)
 Configures a new GPIO pin using the given config.
void set_level (gpio_num_t gpio_pin, level_t level) const
 Sets the level of the given GPIO pin.
level_t get_level (gpio_num_t gpio_pin) const
 Gets the level of the given GPIO pin.

Static Public Member Functions

static Controller & get_instance ()
 Gets the controller instance.

Detailed Description

The GPIO hardware abstraction layer's control class.

Constructor & Destructor Documentation

◆ Controller()

HAL::GPIO::Controller::Controller ( const Controller & )
delete

Member Function Documentation

◆ add()

void HAL::GPIO::Controller::add ( const pin_config_t & entry)

Configures a new GPIO pin using the given config.

Parameters
entryThe GPIO config entry to configure

◆ get_instance()

Controller & HAL::GPIO::Controller::get_instance ( )
inlinestatic

Gets the controller instance.

Note
The instance will be created on the first call of this function
Returns
Reference to the controller object

◆ get_level()

level_t HAL::GPIO::Controller::get_level ( gpio_num_t gpio_pin) const
nodiscard

Gets the level of the given GPIO pin.

Returns
The current level of the given pin
Parameters
gpio_pinThe pin of which to get the level

◆ operator=()

Controller & HAL::GPIO::Controller::operator= ( const Controller & )
delete

◆ set_level()

void HAL::GPIO::Controller::set_level ( gpio_num_t gpio_pin,
level_t level ) const

Sets the level of the given GPIO pin.

Parameters
gpio_pinThe pin of which to set the level
levelThe level to set the given pin to

◆ shutdown()

void HAL::GPIO::Controller::shutdown ( )

Resets all pins and shuts down the controller.


The documentation for this class was generated from the following files: