Dataflow Runtime API  3.1.1.0
Public Member Functions | Static Public Member Functions | List of all members
imt::base::os::linux::Gpio Class Referencefinal

Provides GPIO functions accessible via the platform / os specific API. More...

#include <Imt.Base.OS.Linux/Gpio.h>

Public Member Functions

 Gpio ()=delete
 Deleted default constructor. More...
 
 Gpio (std::unique_ptr< GpioData > &&gpioData)
 Constructor. More...
 
 ~Gpio ()
 Destructor. More...
 
 Gpio (const Gpio &)=default
 Rule of five. More...
 
 Gpio (Gpio &&)=default
 
Gpiooperator= (const Gpio &)=default
 
Gpiooperator= (Gpio &&)=default
 
void set (bool value)
 Sets an output to the desired state. More...
 
bool isSet ()
 True if the GPIO is set, false if reset. More...
 
void waitForChange ()
 Waits for a gpio state change. More...
 

Static Public Member Functions

static std::unique_ptr< GpioopenOutput (const std::string &deviceName, uint32_t pinNumber, bool initialValue)
 Opens the given gpio. More...
 
static std::unique_ptr< GpioopenInput (const std::string &deviceName, uint32_t pinNumber)
 Opens the given gpio. More...
 

Detailed Description

Provides GPIO functions accessible via the platform / os specific API.

Constructor & Destructor Documentation

◆ Gpio() [1/4]

imt::base::os::linux::Gpio::Gpio ( )
delete

Deleted default constructor.

◆ Gpio() [2/4]

imt::base::os::linux::Gpio::Gpio ( std::unique_ptr< GpioData > &&  gpioData)
explicit

Constructor.

Parameters
gpioDataThe gpio data used to access the gpio pin

◆ ~Gpio()

imt::base::os::linux::Gpio::~Gpio ( )

Destructor.

◆ Gpio() [3/4]

imt::base::os::linux::Gpio::Gpio ( const Gpio )
default

Rule of five.

◆ Gpio() [4/4]

imt::base::os::linux::Gpio::Gpio ( Gpio &&  )
default

Member Function Documentation

◆ isSet()

bool imt::base::os::linux::Gpio::isSet ( )

True if the GPIO is set, false if reset.

◆ openInput()

static std::unique_ptr<Gpio> imt::base::os::linux::Gpio::openInput ( const std::string &  deviceName,
uint32_t  pinNumber 
)
static

Opens the given gpio.

The optional may be empty if opening the gpio has failed

Parameters
deviceNameThe name of the gpio device
pinNumberThe name of the gpio pin

◆ openOutput()

static std::unique_ptr<Gpio> imt::base::os::linux::Gpio::openOutput ( const std::string &  deviceName,
uint32_t  pinNumber,
bool  initialValue 
)
static

Opens the given gpio.

The optional may be empty if opening the gpio has failed

Parameters
deviceNameThe name of the gpio device
pinNumberThe name of the gpio pin
initialValueThe initial output value

◆ operator=() [1/2]

Gpio& imt::base::os::linux::Gpio::operator= ( const Gpio )
default

◆ operator=() [2/2]

Gpio& imt::base::os::linux::Gpio::operator= ( Gpio &&  )
default

◆ set()

void imt::base::os::linux::Gpio::set ( bool  value)

Sets an output to the desired state.

No effect if the ioType has been set to IoType::INPUT.

Parameters
valueTrue to set the output, false to reset.

◆ waitForChange()

void imt::base::os::linux::Gpio::waitForChange ( )

Waits for a gpio state change.


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