Thunderbots Project
Loading...
Searching...
No Matches
GpioCharDev Class Reference

#include <gpio_char_dev.h>

Inheritance diagram for GpioCharDev:
Collaboration diagram for GpioCharDev:

Public Member Functions

 GpioCharDev (uint32_t gpio_number, GpioDirection direction, GpioState state, std::string char_dev_path="/dev/gpiochip0")
 
virtual ~GpioCharDev ()
 
void setValue (GpioState state) override
 
GpioState getValue () override
 

Detailed Description

GPIO with the character device interface

Available on Linux kernels 5.10 and later.

Constructor & Destructor Documentation

◆ GpioCharDev()

GpioCharDev ( uint32_t  gpio_number,
GpioDirection  direction,
GpioState  state,
std::string  char_dev_path = "/dev/gpiochip0" 
)

Communicate with GPIO pins via the new GPIO character device interface: https://www.kernel.org/doc/html/next/userspace-api/gpio/chardev.html

Parameters
gpio_numberThe gpio number
directionThe direction of the gpio
stateThe initial state of the gpio
char_dev_pathThe path to the gpio character device

◆ ~GpioCharDev()

~GpioCharDev ( )
virtual

Destructor

Member Function Documentation

◆ getValue()

GpioState getValue ( )
overridevirtual

Get the current state of the gpio

Implements Gpio.

◆ setValue()

void setValue ( GpioState  state)
overridevirtual

Set the value to the provided state

Parameters
stateThe state

Implements Gpio.


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