PX4 Firmware
PX4 Autopilot Software http://px4.io
LinuxGPIO Class Reference

#include <linux_gpio.h>

Collaboration diagram for LinuxGPIO:

Public Types

enum  Direction { Direction::IN = 0, Direction::OUT = 1 }
 
enum  Value { Value::LOW = 0, Value::HIGH = 1 }
 

Public Member Functions

 LinuxGPIO (unsigned int pin)
 
 ~LinuxGPIO ()
 
int exportPin ()
 
int unexportPin ()
 
int setDirection (LinuxGPIO::Direction dir)
 
int readValue ()
 
int writeValue (LinuxGPIO::Value value)
 

Private Attributes

int _pin
 
int _fd
 

Detailed Description

Definition at line 46 of file linux_gpio.h.

Member Enumeration Documentation

◆ Direction

enum LinuxGPIO::Direction
strong
Enumerator
IN 
OUT 

Definition at line 52 of file linux_gpio.h.

◆ Value

enum LinuxGPIO::Value
strong
Enumerator
LOW 
HIGH 

Definition at line 57 of file linux_gpio.h.

Constructor & Destructor Documentation

◆ LinuxGPIO()

LinuxGPIO::LinuxGPIO ( unsigned int  pin)

Definition at line 49 of file linux_gpio.cpp.

◆ ~LinuxGPIO()

LinuxGPIO::~LinuxGPIO ( )

Definition at line 55 of file linux_gpio.cpp.

References _fd.

Member Function Documentation

◆ exportPin()

int LinuxGPIO::exportPin ( )

Definition at line 62 of file linux_gpio.cpp.

References _fd, _pin, err, fd, PIN_INDEX_BUFFER_MAX, PIN_VALUE_BUFFER_MAX, and write().

Here is the call graph for this function:

◆ readValue()

int LinuxGPIO::readValue ( )

Definition at line 203 of file linux_gpio.cpp.

References _fd, _pin, err, and read().

Here is the call graph for this function:

◆ setDirection()

int LinuxGPIO::setDirection ( LinuxGPIO::Direction  dir)

Definition at line 167 of file linux_gpio.cpp.

References _pin, err, fd, IN, PIN_DIRECTION_BUFFER_MAX, and write().

Here is the call graph for this function:

◆ unexportPin()

int LinuxGPIO::unexportPin ( )

Definition at line 126 of file linux_gpio.cpp.

References _fd, _pin, err, fd, PIN_INDEX_BUFFER_MAX, and write().

Here is the call graph for this function:

◆ writeValue()

int LinuxGPIO::writeValue ( LinuxGPIO::Value  value)

Definition at line 221 of file linux_gpio.cpp.

References _fd, _pin, err, HIGH, LOW, and write().

Here is the call graph for this function:

Member Data Documentation

◆ _fd

int LinuxGPIO::_fd
private

Definition at line 70 of file linux_gpio.h.

Referenced by exportPin(), readValue(), unexportPin(), writeValue(), and ~LinuxGPIO().

◆ _pin

int LinuxGPIO::_pin
private

Definition at line 69 of file linux_gpio.h.

Referenced by exportPin(), readValue(), setDirection(), unexportPin(), and writeValue().


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