PiImageStreamer
Loading...
Searching...
No Matches
SWE4211RPi::LgpioGPIO Class Reference
Inheritance diagram for SWE4211RPi::LgpioGPIO:
Collaboration diagram for SWE4211RPi::LgpioGPIO:

Public Member Functions

 LgpioGPIO (int number, DIRECTION dir, VALUE val=GPIO_LOW)
 
virtual ~LgpioGPIO ()
 
virtual void setValue (GPIO::VALUE)
 
virtual GPIO::VALUE getValue ()
 
virtual void enableEdgeInterrupt (EDGE edgeType)
 
virtual void handleInterruptDrivenGPIOPin ()
 
virtual void handleInterruptDrivenGPIOPin2 (lgGpioAlert_p evt)
 
- Public Member Functions inherited from SWE4211RPi::GPIO
virtual int waitForEdge (int maxWait)
 
virtual struct timespec getRisingISRTimestamp ()
 
virtual struct timespec getFallingISRTimestamp ()
 
virtual void setCallbackMethod (CallbackType methodCallback)
 
virtual void callBackThreadHandler ()
 
virtual int getPinNumber ()
 

Static Public Member Functions

static void freeGPIOInstance (LgpioGPIO &instance)
 
- Static Public Member Functions inherited from SWE4211RPi::GPIO
static GPIO & getInstance (int number, DIRECTION dir, VALUE vale=GPIO_LOW)
 
static void freeInstance (GPIO &instance)
 

Protected Attributes

int number
 
- Protected Attributes inherited from SWE4211RPi::GPIO
int number =0
 
int instanceCount = 0
 
std::mutex mtx
 
std::condition_variable cv
 
std::condition_variable ccv
 
CallbackType methodCallback =nullptr
 
struct timespec isrRisingTimestamp
 
struct timespec isrFallingTimestamp
 

Static Private Attributes

static int initialized
 

Additional Inherited Members

- Public Types inherited from SWE4211RPi::GPIO
enum  DIRECTION { GPIO_IN , GPIO_OUT }
 
enum  VALUE { GPIO_LOW = 0 , GPIO_HIGH = 1 }
 
enum  EDGE { GPIO_NONE , GPIO_RISING , GPIO_FALLING , GPIO_BOTH }
 
- Static Public Attributes inherited from SWE4211RPi::GPIO
static GPIO * gpio_instances [NUMBER_OF_GPIO_PINS+1]
 
static GenericThreadInfo * threadInstances [NUMBER_OF_GPIO_PINS+1]
 

Constructor & Destructor Documentation

◆ LgpioGPIO()

SWE4211RPi::LgpioGPIO::LgpioGPIO ( int  number,
DIRECTION  dir,
VALUE  val = GPIO_LOW 
)

This is the constructor for an instance of a GPIO class.

Parameters
numberThis is the Raspberry Pi GPIO Number.
dirThis is the direction for the GPIO pin, either input or output.
valThis is the default value for the GPIO pin.

◆ ~LgpioGPIO()

virtual SWE4211RPi::LgpioGPIO::~LgpioGPIO ( )
virtual

This is the destructor for the class, which will clean up the existing instance.

Member Function Documentation

◆ enableEdgeInterrupt()

virtual void SWE4211RPi::LgpioGPIO::enableEdgeInterrupt ( EDGE  edgeType)
virtual

This method will enable an interrupt to be processed based upon edges. In doing this, callbacks can be made based upon the GPIO pin changing state and methods can block for IO purposes.

Parameters
edgeTypeThis is the edge type that is to be processed as an interrupt.

Implements SWE4211RPi::GPIO.

◆ getValue()

virtual GPIO::VALUE SWE4211RPi::LgpioGPIO::getValue ( )
virtual

This method will return the current state of this GPIO pin.

Returns
The return will be high or low depending on the state of the pin.

Implements SWE4211RPi::GPIO.

◆ handleInterruptDrivenGPIOPin()

virtual void SWE4211RPi::LgpioGPIO::handleInterruptDrivenGPIOPin ( )
virtual

This method will be invoked if an interrupt is enabled whenever a transition in pin value occurs.

Implements SWE4211RPi::GPIO.

◆ handleInterruptDrivenGPIOPin2()

virtual void SWE4211RPi::LgpioGPIO::handleInterruptDrivenGPIOPin2 ( lgGpioAlert_p  evt)
virtual

This method will be invoked if an interrupt is enabled whenever a transition in pin value occurs.

◆ setValue()

virtual void SWE4211RPi::LgpioGPIO::setValue ( GPIO::VALUE  )
virtual

This method will drive an output pin to the appropriate value.

Parameters
Thisis the value that is to be written to the pin.

Implements SWE4211RPi::GPIO.

Member Data Documentation

◆ initialized

int SWE4211RPi::LgpioGPIO::initialized
staticprivate

This attribute indicates whether any GPIO has been instantiated. The first GPIO to be instantiated will also setup the wiringPi devices. Subsequent instantiations will not do so.

◆ number

int SWE4211RPi::LgpioGPIO::number
protected

This is the GPIO pin number for the given pin.


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