F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
LinuxGpioDriverComponentImpl.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title LinuxGpioDriverImpl.hpp
3 // \author tcanham
4 // \brief hpp file for LinuxGpioDriver component implementation class
5 //
6 // \copyright
7 // Copyright 2009-2015, by the California Institute of Technology.
8 // ALL RIGHTS RESERVED. United States Government Sponsorship
9 // acknowledged.
10 //
11 // ======================================================================
12 
13 #ifndef LinuxGpioDriver_HPP
14 #define LinuxGpioDriver_HPP
15 
17 #include <Os/Task.hpp>
18 
19 namespace Drv {
20 
23  {
24 
25  public:
26 
27  // ----------------------------------------------------------------------
28  // Construction, initialization, and destruction
29  // ----------------------------------------------------------------------
30 
34  const char *const compName
35  );
36 
39  void init(
40  const NATIVE_INT_TYPE instance = 0
41  );
42 
46 
51 
56  GPIO_INT
57  };
58 
60  bool open(NATIVE_INT_TYPE gpio, GpioDirection direction);
61 
63  void exitThread();
64 
65  PRIVATE:
66 
67  // ----------------------------------------------------------------------
68  // Handler implementations for user-defined typed input ports
69  // ----------------------------------------------------------------------
70 
73  void gpioRead_handler(
74  const NATIVE_INT_TYPE portNum,
75  Fw::Logic &state
76  );
77 
80  void gpioWrite_handler(
81  const NATIVE_INT_TYPE portNum,
82  const Fw::Logic& state
83  );
84 
86  NATIVE_INT_TYPE m_gpio;
87 
89  GpioDirection m_direction;
90 
92  static void intTaskEntry(void * ptr);
93 
95  Os::Task m_intTask;
97  NATIVE_INT_TYPE m_fd;
99  bool m_quitThread;
100 
101  };
102 
103 } // end namespace Drv
104 
105 #endif
PlatformIntType NATIVE_INT_TYPE
Definition: BasicTypes.h:51
Auto-generated base for LinuxGpioDriver component.
bool open(NATIVE_INT_TYPE gpio, GpioDirection direction)
open GPIO
Os::Task::Status startIntTask(Os::Task::ParamType priority=Os::Task::TASK_DEFAULT, Os::Task::ParamType stackSize=Os::Task::TASK_DEFAULT, Os::Task::ParamType cpuAffinity=Os::Task::TASK_DEFAULT)
Start interrupt task.
Logic states.
Definition: LogicEnumAc.hpp:19
void init()
Object initializer.
Definition: ObjBase.cpp:27
FwSizeType ParamType
backwards-compatible parameter type
Definition: Task.hpp:218
static constexpr FwSizeType TASK_DEFAULT
Definition: Task.hpp:28