F´ Flight Software - C/C++ Documentation
devel
A framework for building embedded system applications to NASA flight quality standards.
|
#include <Drv/LinuxGpioDriver/LinuxGpioDriver.hpp>
Public Types | |
enum | GpioConfiguration { GPIO_OUTPUT , GPIO_INPUT , GPIO_INTERRUPT_RISING_EDGE , GPIO_INTERRUPT_FALLING_EDGE , GPIO_INTERRUPT_BOTH_RISING_AND_FALLING_EDGES , MAX_GPIO_CONFIGURATION } |
configure the GPIO pin More... | |
Public Member Functions | |
LinuxGpioDriver (const char *const compName) | |
~LinuxGpioDriver () | |
Os::File::Status | open (const char *device, const U32 gpio, const GpioConfiguration &configuration, const Fw::Logic &default_state=Fw::Logic::LOW) |
open a GPIO pin for use in the system More... | |
Drv::GpioStatus | start (const FwSizeType priority=Os::Task::TASK_DEFAULT, const FwSizeType stackSize=Os::Task::TASK_DEFAULT, const FwSizeType cpuAffinity=Os::Task::TASK_DEFAULT, const PlatformUIntType identifier=static_cast< PlatformUIntType >(Os::Task::TASK_DEFAULT)) |
start interrupt detection thread More... | |
void | stop () |
stop interrupt detection thread More... | |
void | join () |
join interrupt detection thread More... | |
Public Member Functions inherited from Drv::LinuxGpioDriverComponentBase | |
void | init (FwEnumStoreType instance=0) |
Initialize LinuxGpioDriverComponentBase object. More... | |
Drv::InputGpioReadPort * | get_gpioRead_InputPort (FwIndexType portNum) |
Drv::InputGpioWritePort * | get_gpioWrite_InputPort (FwIndexType portNum) |
void | set_Log_OutputPort (FwIndexType portNum, Fw::InputLogPort *port) |
Connect port to Log[portNum]. More... | |
void | set_Time_OutputPort (FwIndexType portNum, Fw::InputTimePort *port) |
Connect port to Time[portNum]. More... | |
void | set_gpioInterrupt_OutputPort (FwIndexType portNum, Svc::InputCyclePort *port) |
Connect port to gpioInterrupt[portNum]. More... | |
Public Member Functions inherited from Fw::PassiveComponentBase | |
void | setIdBase (const U32) |
Set the ID base. More... | |
U32 | getIdBase () const |
Static Public Attributes | |
static constexpr FwSizeType | GPIO_POLL_TIMEOUT = 500 |
Definition at line 23 of file LinuxGpioDriver.hpp.
configure the GPIO pin
Configure the GPIO pin for use in this driver. Only one mode may be selected as a time.
Definition at line 42 of file LinuxGpioDriver.hpp.
Drv::LinuxGpioDriver::LinuxGpioDriver | ( | const char *const | compName | ) |
Construct object LinuxGpioDriver
compName | The component name |
Definition at line 22 of file LinuxGpioDriverCommon.cpp.
Drv::LinuxGpioDriver::~LinuxGpioDriver | ( | ) |
Destroy object LinuxGpioDriver
Definition at line 124 of file LinuxGpioDriver.cpp.
void Drv::LinuxGpioDriver::join | ( | ) |
join interrupt detection thread
Definition at line 50 of file LinuxGpioDriverCommon.cpp.
Os::File::Status Drv::LinuxGpioDriver::open | ( | const char * | device, |
const U32 | gpio, | ||
const GpioConfiguration & | configuration, | ||
const Fw::Logic & | default_state = Fw::Logic::LOW |
||
) |
open a GPIO pin for use in the system
This function opens and configures a GPIO pin. User must supply the device path and the gpio pin registered to that device. Pin configuration is also accepted and supports: input, output, and interrupts on either edge.
If the user selects output, a default state can be set with the default_state flag.
device | /dev/gpiochip* path for this pin's bank |
gpio | pin or line number on the above chip |
configuration | pin configuration |
default_state | default state when using output configuration |
Definition at line 183 of file LinuxGpioDriver.cpp.
Drv::GpioStatus Drv::LinuxGpioDriver::start | ( | const FwSizeType | priority = Os::Task::TASK_DEFAULT , |
const FwSizeType | stackSize = Os::Task::TASK_DEFAULT , |
||
const FwSizeType | cpuAffinity = Os::Task::TASK_DEFAULT , |
||
const PlatformUIntType | identifier = static_cast<PlatformUIntType>(Os::Task::TASK_DEFAULT) |
||
) |
start interrupt detection thread
Definition at line 24 of file LinuxGpioDriverCommon.cpp.
void Drv::LinuxGpioDriver::stop | ( | ) |
stop interrupt detection thread
Definition at line 45 of file LinuxGpioDriverCommon.cpp.
|
staticconstexpr |
Definition at line 25 of file LinuxGpioDriver.hpp.