F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
GpioWritePortAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title GpioWritePortAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for GpioWrite port
5 // ======================================================================
6 
8 #include "Fw/Types/Assert.hpp"
9 
10 namespace Drv {
11 
12 #if !FW_DIRECT_PORT_CALLS
13 
14  // ----------------------------------------------------------------------
15  // Public constructors for InputGpioWritePort
16  // ----------------------------------------------------------------------
17 
20  Fw::InputPortBase(),
21  m_func(nullptr)
22  {
23 
24  }
25 
26  // ----------------------------------------------------------------------
27  // Public member functions for InputGpioWritePort
28  // ----------------------------------------------------------------------
29 
32  {
34  }
35 
38  Fw::PassiveComponentBase* callComp,
39  CompFuncPtr funcPtr
40  )
41  {
42  FW_ASSERT(callComp != nullptr);
43  FW_ASSERT(funcPtr != nullptr);
44 
45  this->m_comp = callComp;
46  this->m_func = funcPtr;
47  this->m_connObj = callComp;
48  }
49 
51  invoke(const Fw::Logic& state)
52  {
53 #if FW_PORT_TRACING == 1
54  this->trace();
55 #endif
56 
57  FW_ASSERT(this->m_comp != nullptr);
58  FW_ASSERT(this->m_func != nullptr);
59 
60  return this->m_func(this->m_comp, this->m_portNum, state);
61  }
62 
63  // ----------------------------------------------------------------------
64  // Private member functions for InputGpioWritePort
65  // ----------------------------------------------------------------------
66 
67 #if FW_PORT_SERIALIZATION == 1
68 
69  Fw::SerializeStatus InputGpioWritePort ::
70  invokeSerial(Fw::LinearBufferBase& _buffer)
71  {
72  // For ports with a return type, invokeSerial is not used
73  (void) _buffer;
74 
75  FW_ASSERT(0);
76  return Fw::FW_SERIALIZE_OK;
77  }
78 
79 #endif
80 
81  // ----------------------------------------------------------------------
82  // Public constructors for OutputGpioWritePort
83  // ----------------------------------------------------------------------
84 
87  Fw::OutputPortBase(),
88  m_port(nullptr)
89  {
90 
91  }
92 
93  // ----------------------------------------------------------------------
94  // Public member functions for OutputGpioWritePort
95  // ----------------------------------------------------------------------
96 
99  {
101  }
102 
105  {
106  FW_ASSERT(callPort != nullptr);
107 
108  this->m_port = callPort;
109  this->m_connObj = callPort;
110 
111 #if FW_PORT_SERIALIZATION == 1
112  this->m_serPort = nullptr;
113 #endif
114  }
115 
117  invoke(const Fw::Logic& state) const
118  {
119 #if FW_PORT_TRACING == 1
120  this->trace();
121 #endif
122 
123  FW_ASSERT(this->m_port != nullptr);
124  return this->m_port->invoke(state);
125  }
126 
127 #endif
128 
129 }
Serialization/Deserialization operation was successful.
OutputGpioWritePort()
Constructor.
FwIndexType m_portNum
void init()
Initialization function.
Drv::GpioStatus invoke(const Fw::Logic &state) const
Input GpioWrite port.
SerializeStatus
forward declaration for string
void init()
Initialization function.
Drv::GpioStatus invoke(const Fw::Logic &state)
Invoke a port interface.
void init() override
InputGpioWritePort()
Constructor.
void addCallPort(InputGpioWritePort *callPort)
Register an input port.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
PassiveComponentBase * m_comp
void init() override
Logic states.
Definition: LogicEnumAc.hpp:17
Implementation of malloc based allocator.
Fw::ObjBase * m_connObj
Definition: PortBase.hpp:34
#define FW_ASSERT(...)
Definition: Assert.hpp:14