F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
I2cRequestPortAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title I2cRequestPortAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for I2cRequest port
5 // ======================================================================
6 
7 #ifndef Drv_I2cRequestPortAc_HPP
8 #define Drv_I2cRequestPortAc_HPP
9 
10 #include "Fw/Buffer/Buffer.hpp"
11 #include "Fw/FPrimeBasicTypes.hpp"
13 #if !FW_DIRECT_PORT_CALLS
17 #endif
18 
19 namespace Drv {
20 
25  {
26 
27  public:
28 
29  // ----------------------------------------------------------------------
30  // Public constants for I2cRequestPortBuffer
31  // ----------------------------------------------------------------------
32 
35  static constexpr FwSizeType CAPACITY =
36  sizeof(U32) +
38 
39  public:
40 
41  // ----------------------------------------------------------------------
42  // Public member functions for I2cRequestPortBuffer
43  // ----------------------------------------------------------------------
44 
47 
48  }
49 
50  private:
51 
52  // ----------------------------------------------------------------------
53  // Private member variables
54  // ----------------------------------------------------------------------
55 
56  U8 m_buff[CAPACITY];
57 
58  };
59 
63 
64  public:
65 
66  // ----------------------------------------------------------------------
67  // Public constructors for I2cRequestPortSerializer
68  // ----------------------------------------------------------------------
69 
72 
73  public:
74 
75  // ----------------------------------------------------------------------
76  // Public member functions for I2cRequestPortSerializer
77  // ----------------------------------------------------------------------
78 
81  Fw::SerialBufferBase& _buffer
82  );
83 
84  public:
85 
86  // ----------------------------------------------------------------------
87  // Public static functions for I2cRequestPortSerializer
88  // ----------------------------------------------------------------------
89 
92  U32 addr,
93  Fw::Buffer& buffer,
94  Fw::SerialBufferBase& _buffer
95  );
96 
97  public:
98 
99  // ----------------------------------------------------------------------
100  // Public member variables for I2cRequestPortSerializer
101  // ----------------------------------------------------------------------
102 
103  U32 m_addr;
105 
106  };
107 
108 #if !FW_DIRECT_PORT_CALLS
109 
113  public Fw::InputPortBase
114  {
115 
116  public:
117 
118  // ----------------------------------------------------------------------
119  // Public types for InputI2cRequestPort
120  // ----------------------------------------------------------------------
121 
123  typedef void (*CompFuncPtr)(
124  Fw::PassiveComponentBase* callComp,
125  FwIndexType portNum,
126  U32 addr,
127  Fw::Buffer& buffer
128  );
129 
130  public:
131 
132  // ----------------------------------------------------------------------
133  // Public constructors for InputI2cRequestPort
134  // ----------------------------------------------------------------------
135 
138 
139  public:
140 
141  // ----------------------------------------------------------------------
142  // Public member functions for InputI2cRequestPort
143  // ----------------------------------------------------------------------
144 
146  void init();
147 
149  void addCallComp(
150  Fw::PassiveComponentBase* callComp,
151  CompFuncPtr funcPtr
152  );
153 
155  void invoke(
156  U32 addr,
157  Fw::Buffer& buffer
158  );
159 
160  private:
161 
162  // ----------------------------------------------------------------------
163  // Private member functions for InputI2cRequestPort
164  // ----------------------------------------------------------------------
165 
166 #if FW_PORT_SERIALIZATION == 1
167 
170  Fw::SerializeStatus invokeSerial(
171  Fw::LinearBufferBase& _buffer
172  );
173 
174 #endif
175 
176  private:
177 
178  // ----------------------------------------------------------------------
179  // Private member variables for InputI2cRequestPort
180  // ----------------------------------------------------------------------
181 
183  CompFuncPtr m_func;
184 
185  };
186 
190  public Fw::OutputPortBase
191  {
192 
193  public:
194 
195  // ----------------------------------------------------------------------
196  // Public constructors for OutputI2cRequestPort
197  // ----------------------------------------------------------------------
198 
201 
202  public:
203 
204  // ----------------------------------------------------------------------
205  // Public member functions for OutputI2cRequestPort
206  // ----------------------------------------------------------------------
207 
209  void init();
210 
212  void addCallPort(
213  InputI2cRequestPort* callPort
214  );
215 
217  void invoke(
218  U32 addr,
219  Fw::Buffer& buffer
220  ) const;
221 
222  private:
223 
224  // ----------------------------------------------------------------------
225  // Private member variables for OutputI2cRequestPort
226  // ----------------------------------------------------------------------
227 
229  InputI2cRequestPort* m_port;
230 
231  };
232 
233 #endif
234 
235 }
236 
237 #endif
void(* CompFuncPtr)(Fw::PassiveComponentBase *callComp, FwIndexType portNum, U32 addr, Fw::Buffer &buffer)
The port callback function type.
PlatformSizeType FwSizeType
static constexpr FwSizeType CAPACITY
Fw::SerializeStatus deserializePortArgs(Fw::SerialBufferBase &_buffer)
Deserialze port arguments into members.
I2cRequestPortBuffer()
Constructor.
InputI2cRequestPort()
Constructor.
SerializeStatus
forward declaration for string
static Fw::SerializeStatus serializePortArgs(U32 addr, Fw::Buffer &buffer, Fw::SerialBufferBase &_buffer)
Serialize port arguments into a buffer.
void addCallPort(InputI2cRequestPort *callPort)
Register an input port.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
void init()
Initialization function.
PlatformIndexType FwIndexType
Implementation of malloc based allocator.
void init()
Initialization function.
void invoke(U32 addr, Fw::Buffer &buffer)
Invoke a port interface.
void invoke(U32 addr, Fw::Buffer &buffer) const
Invoke a port connection.
Size of Fw::Buffer when serialized.
Definition: Buffer.hpp:70