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 
48  return CAPACITY;
49  }
50 
53  U8* getBuffAddr() override {
54  return m_buff;
55  }
56 
59  const U8* getBuffAddr() const override {
60  return m_buff;
61  }
62 
63  private:
64 
65  // ----------------------------------------------------------------------
66  // Private member variables
67  // ----------------------------------------------------------------------
68 
69  U8 m_buff[CAPACITY];
70 
71  };
72 
76 
77  public:
78 
79  // ----------------------------------------------------------------------
80  // Public constructors for I2cRequestPortSerializer
81  // ----------------------------------------------------------------------
82 
85 
86  public:
87 
88  // ----------------------------------------------------------------------
89  // Public member functions for I2cRequestPortSerializer
90  // ----------------------------------------------------------------------
91 
94  Fw::SerialBufferBase& _buffer
95  );
96 
97  public:
98 
99  // ----------------------------------------------------------------------
100  // Public static functions for I2cRequestPortSerializer
101  // ----------------------------------------------------------------------
102 
105  U32 addr,
106  Fw::Buffer& buffer,
107  Fw::SerialBufferBase& _buffer
108  );
109 
110  public:
111 
112  // ----------------------------------------------------------------------
113  // Public member variables for I2cRequestPortSerializer
114  // ----------------------------------------------------------------------
115 
116  U32 m_addr;
118 
119  };
120 
121 #if !FW_DIRECT_PORT_CALLS
122 
126  public Fw::InputPortBase
127  {
128 
129  public:
130 
131  // ----------------------------------------------------------------------
132  // Public types for InputI2cRequestPort
133  // ----------------------------------------------------------------------
134 
136  typedef void (*CompFuncPtr)(
137  Fw::PassiveComponentBase* callComp,
138  FwIndexType portNum,
139  U32 addr,
140  Fw::Buffer& buffer
141  );
142 
143  public:
144 
145  // ----------------------------------------------------------------------
146  // Public constructors for InputI2cRequestPort
147  // ----------------------------------------------------------------------
148 
151 
152  public:
153 
154  // ----------------------------------------------------------------------
155  // Public member functions for InputI2cRequestPort
156  // ----------------------------------------------------------------------
157 
159  void init();
160 
162  void addCallComp(
163  Fw::PassiveComponentBase* callComp,
164  CompFuncPtr funcPtr
165  );
166 
168  void invoke(
169  U32 addr,
170  Fw::Buffer& buffer
171  );
172 
173  private:
174 
175  // ----------------------------------------------------------------------
176  // Private member functions for InputI2cRequestPort
177  // ----------------------------------------------------------------------
178 
179 #if FW_PORT_SERIALIZATION == 1
180 
183  Fw::SerializeStatus invokeSerial(
184  Fw::LinearBufferBase& _buffer
185  );
186 
187 #endif
188 
189  private:
190 
191  // ----------------------------------------------------------------------
192  // Private member variables for InputI2cRequestPort
193  // ----------------------------------------------------------------------
194 
196  CompFuncPtr m_func;
197 
198  };
199 
203  public Fw::OutputPortBase
204  {
205 
206  public:
207 
208  // ----------------------------------------------------------------------
209  // Public constructors for OutputI2cRequestPort
210  // ----------------------------------------------------------------------
211 
214 
215  public:
216 
217  // ----------------------------------------------------------------------
218  // Public member functions for OutputI2cRequestPort
219  // ----------------------------------------------------------------------
220 
222  void init();
223 
225  void addCallPort(
226  InputI2cRequestPort* callPort
227  );
228 
230  void invoke(
231  U32 addr,
232  Fw::Buffer& buffer
233  ) const;
234 
235  private:
236 
237  // ----------------------------------------------------------------------
238  // Private member variables for OutputI2cRequestPort
239  // ----------------------------------------------------------------------
240 
242  InputI2cRequestPort* m_port;
243 
244  };
245 
246 #endif
247 
248 }
249 
250 #endif
void(* CompFuncPtr)(Fw::PassiveComponentBase *callComp, FwIndexType portNum, U32 addr, Fw::Buffer &buffer)
The port callback function type.
PlatformSizeType FwSizeType
static constexpr FwSizeType CAPACITY
Size of Fw::Buffer when serialized.
Definition: Buffer.hpp:64
Fw::SerializeStatus deserializePortArgs(Fw::SerialBufferBase &_buffer)
Deserialze port arguments into members.
const U8 * getBuffAddr() const override
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.
Fw::Serializable::SizeType getCapacity() const override
FwSizeType SizeType
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
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.