Leosac  0.8.0
Open Source Access Control
Leosac::Hardware::GPIO Class Reference

Abstraction of a GPIO device attributes. More...

#include <GPIO.hpp>

+ Inheritance diagram for Leosac::Hardware::GPIO:
+ Collaboration diagram for Leosac::Hardware::GPIO:

Public Types

enum  Direction { Direction::In = 0, Direction::Out = 1 }
 

Public Member Functions

 GPIO ()
 
virtual ~GPIO ()=default
 
uint16_t number () const
 
void number (uint16_t number)
 
Direction direction () const
 
void direction (Direction direction)
 
bool default_value () const
 
void default_value (bool default_value)
 
void validation_callback (odb::callback_event e, odb::database &) const override
 
- Public Member Functions inherited from Leosac::Hardware::Device
 Device ()
 
 Device (DeviceClass device_class)
 
virtual ~Device ()=default
 
UUID id () const
 
const std::string & name () const
 
void name (const std::string &name)
 
DeviceClass device_class () const
 
void device_class (DeviceClass d)
 
bool enabled () const
 
void enabled (bool e)
 
uint64_t odb_version () const
 

Private Attributes

uint16_t number_
 
Direction direction_
 
bool default_value_
 True to default to ON, false otherwise. More...
 

Detailed Description

Abstraction of a GPIO device attributes.

Modules that provides GPIO support may subclass this to provide additional configuration options.

Definition at line 41 of file GPIO.hpp.

Member Enumeration Documentation

◆ Direction

Enumerator
In 
Out 

Definition at line 44 of file GPIO.hpp.

Constructor & Destructor Documentation

◆ GPIO()

Leosac::Hardware::GPIO::GPIO ( )
explicit

Definition at line 28 of file GPIO.cpp.

◆ ~GPIO()

virtual Leosac::Hardware::GPIO::~GPIO ( )
virtualdefault

Member Function Documentation

◆ default_value() [1/2]

bool Leosac::Hardware::GPIO::default_value ( ) const

Definition at line 56 of file GPIO.cpp.

◆ default_value() [2/2]

void Leosac::Hardware::GPIO::default_value ( bool  default_value)

Definition at line 61 of file GPIO.cpp.

◆ direction() [1/2]

GPIO::Direction Leosac::Hardware::GPIO::direction ( ) const

Definition at line 46 of file GPIO.cpp.

◆ direction() [2/2]

void Leosac::Hardware::GPIO::direction ( GPIO::Direction  direction)

Definition at line 51 of file GPIO.cpp.

◆ number() [1/2]

uint16_t Leosac::Hardware::GPIO::number ( ) const

Definition at line 36 of file GPIO.cpp.

◆ number() [2/2]

void Leosac::Hardware::GPIO::number ( uint16_t  number)

Definition at line 41 of file GPIO.cpp.

◆ validation_callback()

void Leosac::Hardware::GPIO::validation_callback ( odb::callback_event  e,
odb::database &  db 
) const
overridevirtual

Reimplemented from Leosac::Hardware::Device.

Definition at line 66 of file GPIO.cpp.

Member Data Documentation

◆ default_value_

bool Leosac::Hardware::GPIO::default_value_
private

True to default to ON, false otherwise.

Definition at line 75 of file GPIO.hpp.

◆ direction_

Direction Leosac::Hardware::GPIO::direction_
private

Definition at line 70 of file GPIO.hpp.

◆ number_

uint16_t Leosac::Hardware::GPIO::number_
private

Definition at line 68 of file GPIO.hpp.


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