Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
PersistentGpio Class Reference
Inheritance diagram for PersistentGpio:
Gpio

Public Member Functions

constexpr PersistentGpio (const Gpio *impl, const unsigned bit_ofs)
 
void restore () const
 
void write (Value new_state) const OVERRIDE
 Writes a GPIO output pin (set or clear to a specific state).
 
void set () const OVERRIDE
 Sets the GPIO output pin to high.
 
void clr () const OVERRIDE
 Clears the GPIO output pin to low.
 
Value read () const OVERRIDE
 Retrieves the current Value of a GPIO input pin.
 
void set_direction (Direction dir) const OVERRIDE
 Sets the GPIO direction.
 
Direction direction () const OVERRIDE
 Gets the GPIO direction.
 
- Public Member Functions inherited from Gpio
constexpr Gpio ()
 Constructor.
 
void write (bool new_state) const
 Writes a GPIO output pin (set or clear to a specific state).
 
bool is_set () const
 Tests the GPIO input pin to see if it is set.
 
bool is_clr () const
 Tests the GPIO input pin to see if it is clear.
 

Private Attributes

const Gpioimpl_
 Implementation of the gpio object.
 
const unsigned bit_
 Implementation of the gpio object.
 

Additional Inherited Members

- Public Types inherited from Gpio
enum  Value : bool { CLR = false , SET = true , VLOW = CLR , VHIGH = SET }
 Defines the options for GPIO level. More...
 
enum class  Direction { DINPUT , DOUTPUT }
 Defines the options for GPIO direction. More...
 

Detailed Description

Definition at line 44 of file PersistentGPIO.hxx.

Constructor & Destructor Documentation

◆ PersistentGpio()

constexpr PersistentGpio::PersistentGpio ( const Gpio impl,
const unsigned  bit_ofs 
)
inlineconstexpr

Definition at line 47 of file PersistentGPIO.hxx.

Member Function Documentation

◆ clr()

void PersistentGpio::clr ( ) const
inlinevirtual

Clears the GPIO output pin to low.

Implements Gpio.

Definition at line 69 of file PersistentGPIO.hxx.

◆ direction()

Direction PersistentGpio::direction ( ) const
inlinevirtual

Gets the GPIO direction.

Returns
INPUT or OUTPUT

Implements Gpio.

Definition at line 88 of file PersistentGPIO.hxx.

◆ read()

Value PersistentGpio::read ( ) const
inlinevirtual

Retrieves the current Value of a GPIO input pin.

Returns
SET if currently high, CLR if currently low.

Implements Gpio.

Definition at line 75 of file PersistentGPIO.hxx.

◆ restore()

void PersistentGpio::restore ( ) const
inline

Definition at line 53 of file PersistentGPIO.hxx.

◆ set()

void PersistentGpio::set ( ) const
inlinevirtual

Sets the GPIO output pin to high.

Implements Gpio.

Definition at line 63 of file PersistentGPIO.hxx.

◆ set_direction()

void PersistentGpio::set_direction ( Direction  dir) const
inlinevirtual

Sets the GPIO direction.

Parameters
dirINPUT or OUTPUT

Implements Gpio.

Definition at line 80 of file PersistentGPIO.hxx.

◆ write()

void PersistentGpio::write ( Value  new_state) const
inlinevirtual

Writes a GPIO output pin (set or clear to a specific state).

Parameters
new_statethe desired output state. See Value.

Implements Gpio.

Definition at line 57 of file PersistentGPIO.hxx.

Member Data Documentation

◆ bit_

const unsigned PersistentGpio::bit_
private

Implementation of the gpio object.

Definition at line 97 of file PersistentGPIO.hxx.

◆ impl_

const Gpio* PersistentGpio::impl_
private

Implementation of the gpio object.

Definition at line 95 of file PersistentGPIO.hxx.


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