PX4 Firmware
PX4 Autopilot Software http://px4.io
|
#include <linux_gpio.h>
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 |
Definition at line 46 of file linux_gpio.h.
|
strong |
Enumerator | |
---|---|
IN | |
OUT |
Definition at line 52 of file linux_gpio.h.
|
strong |
Enumerator | |
---|---|
LOW | |
HIGH |
Definition at line 57 of file linux_gpio.h.
LinuxGPIO::LinuxGPIO | ( | unsigned int | pin | ) |
Definition at line 49 of file linux_gpio.cpp.
LinuxGPIO::~LinuxGPIO | ( | ) |
Definition at line 55 of file linux_gpio.cpp.
References _fd.
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().
int LinuxGPIO::readValue | ( | ) |
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().
int LinuxGPIO::unexportPin | ( | ) |
Definition at line 126 of file linux_gpio.cpp.
References _fd, _pin, err, fd, PIN_INDEX_BUFFER_MAX, and write().
int LinuxGPIO::writeValue | ( | LinuxGPIO::Value | value | ) |
|
private |
Definition at line 70 of file linux_gpio.h.
Referenced by exportPin(), readValue(), unexportPin(), writeValue(), and ~LinuxGPIO().
|
private |
Definition at line 69 of file linux_gpio.h.
Referenced by exportPin(), readValue(), setDirection(), unexportPin(), and writeValue().