F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
SpiReadWritePortAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title SpiReadWritePortAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for SpiReadWrite port
5 // ======================================================================
6 
7 #ifndef Drv_SpiReadWritePortAc_HPP
8 #define Drv_SpiReadWritePortAc_HPP
9 
10 #include <cstdio>
11 #include <cstring>
12 
13 #include "FpConfig.hpp"
14 #include "Fw/Buffer/Buffer.hpp"
19 #include "Fw/Types/StringType.hpp"
20 
21 namespace Drv {
22 
25  public Fw::InputPortBase
26  {
27 
28  public:
29 
30  // ----------------------------------------------------------------------
31  // Constants
32  // ----------------------------------------------------------------------
33 
34  enum {
39  };
40 
41  public:
42 
43  // ----------------------------------------------------------------------
44  // Types
45  // ----------------------------------------------------------------------
46 
48  typedef void (*CompFuncPtr)(
49  Fw::PassiveComponentBase* callComp,
50  NATIVE_INT_TYPE portNum,
51  Fw::Buffer& writeBuffer,
52  Fw::Buffer& readBuffer
53  );
54 
55  public:
56 
57  // ----------------------------------------------------------------------
58  // Input Port Member functions
59  // ----------------------------------------------------------------------
60 
63 
65  void init();
66 
68  void addCallComp(
69  Fw::PassiveComponentBase* callComp,
70  CompFuncPtr funcPtr
71  );
72 
74  void invoke(
75  Fw::Buffer& writeBuffer,
76  Fw::Buffer& readBuffer
77  );
78 
79  private:
80 
81 #if FW_PORT_SERIALIZATION == 1
82 
84  Fw::SerializeStatus invokeSerial(Fw::SerializeBufferBase& _buffer);
85 
86 #endif
87 
88  private:
89 
90  // ----------------------------------------------------------------------
91  // Member variables
92  // ----------------------------------------------------------------------
93 
95  CompFuncPtr m_func;
96 
97  };
98 
101  public Fw::OutputPortBase
102  {
103 
104  public:
105 
106  // ----------------------------------------------------------------------
107  // Output Port Member functions
108  // ----------------------------------------------------------------------
109 
112 
114  void init();
115 
117  void addCallPort(
118  InputSpiReadWritePort* callPort
119  );
120 
122  void invoke(
123  Fw::Buffer& writeBuffer,
124  Fw::Buffer& readBuffer
125  );
126 
127  private:
128 
129  // ----------------------------------------------------------------------
130  // Member variables
131  // ----------------------------------------------------------------------
132 
134  InputSpiReadWritePort* m_port;
135 
136  };
137 
138 }
139 
140 #endif
PlatformIntType NATIVE_INT_TYPE
Definition: BasicTypes.h:51
C++-compatible configuration header for fprime configuration.
Declares ISF string base class.
Input SpiReadWrite port.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
@ SERIALIZED_SIZE
The size of the serial representations of the port arguments.
void(* CompFuncPtr)(Fw::PassiveComponentBase *callComp, NATIVE_INT_TYPE portNum, Fw::Buffer &writeBuffer, Fw::Buffer &readBuffer)
The port callback function type.
void init()
Initialization function.
void invoke(Fw::Buffer &writeBuffer, Fw::Buffer &readBuffer)
Invoke a port interface.
Output SpiReadWrite port.
void invoke(Fw::Buffer &writeBuffer, Fw::Buffer &readBuffer)
Invoke a port interface.
void init()
Initialization function.
void addCallPort(InputSpiReadWritePort *callPort)
Register an input port.
@ SERIALIZED_SIZE
Size of Fw::Buffer when serialized.
Definition: Buffer.hpp:48
SerializeStatus
forward declaration for string