F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
I2cPortAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title I2cPortAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for I2c port
5 // ======================================================================
6 
7 #ifndef Drv_I2cPortAc_HPP
8 #define Drv_I2cPortAc_HPP
9 
11 #include "Fw/Buffer/Buffer.hpp"
12 #include "Fw/FPrimeBasicTypes.hpp"
13 #if !FW_DIRECT_PORT_CALLS
17 #endif
18 
19 namespace Drv {
20 
21 #if !FW_DIRECT_PORT_CALLS
22 
24  class InputI2cPort :
25  public Fw::InputPortBase
26  {
27 
28  public:
29 
30  // ----------------------------------------------------------------------
31  // Public types for InputI2cPort
32  // ----------------------------------------------------------------------
33 
36  Fw::PassiveComponentBase* callComp,
37  FwIndexType portNum,
38  U32 addr,
39  Fw::Buffer& serBuffer
40  );
41 
42  public:
43 
44  // ----------------------------------------------------------------------
45  // Public constructors for InputI2cPort
46  // ----------------------------------------------------------------------
47 
49  InputI2cPort();
50 
51  public:
52 
53  // ----------------------------------------------------------------------
54  // Public member functions for InputI2cPort
55  // ----------------------------------------------------------------------
56 
58  void init();
59 
61  void addCallComp(
62  Fw::PassiveComponentBase* callComp,
63  CompFuncPtr funcPtr
64  );
65 
68  U32 addr,
69  Fw::Buffer& serBuffer
70  );
71 
72  private:
73 
74  // ----------------------------------------------------------------------
75  // Private member functions for InputI2cPort
76  // ----------------------------------------------------------------------
77 
78 #if FW_PORT_SERIALIZATION == 1
79 
82  Fw::SerializeStatus invokeSerial(
83  Fw::LinearBufferBase& _buffer
84  );
85 
86 #endif
87 
88  private:
89 
90  // ----------------------------------------------------------------------
91  // Private member variables for InputI2cPort
92  // ----------------------------------------------------------------------
93 
95  CompFuncPtr m_func;
96 
97  };
98 
101  public Fw::OutputPortBase
102  {
103 
104  public:
105 
106  // ----------------------------------------------------------------------
107  // Public constructors for OutputI2cPort
108  // ----------------------------------------------------------------------
109 
111  OutputI2cPort();
112 
113  public:
114 
115  // ----------------------------------------------------------------------
116  // Public member functions for OutputI2cPort
117  // ----------------------------------------------------------------------
118 
120  void init();
121 
123  void addCallPort(
124  InputI2cPort* callPort
125  );
126 
130  U32 addr,
131  Fw::Buffer& serBuffer
132  ) const;
133 
134  private:
135 
136  // ----------------------------------------------------------------------
137  // Private member variables for OutputI2cPort
138  // ----------------------------------------------------------------------
139 
141  InputI2cPort* m_port;
142 
143  };
144 
145 #endif
146 
147 }
148 
149 #endif
Drv::I2cStatus invoke(U32 addr, Fw::Buffer &serBuffer) const
Definition: I2cPortAc.cpp:120
Drv::I2cStatus invoke(U32 addr, Fw::Buffer &serBuffer)
Invoke a port interface.
Definition: I2cPortAc.cpp:51
SerializeStatus
forward declaration for string
OutputI2cPort()
Constructor.
Definition: I2cPortAc.cpp:89
InputI2cPort()
Constructor.
Definition: I2cPortAc.cpp:19
void addCallPort(InputI2cPort *callPort)
Register an input port.
Definition: I2cPortAc.cpp:107
Output I2c port.
Definition: I2cPortAc.hpp:100
void init()
Initialization function.
Definition: I2cPortAc.cpp:31
PlatformIndexType FwIndexType
void init()
Initialization function.
Definition: I2cPortAc.cpp:101
Drv::I2cStatus(* CompFuncPtr)(Fw::PassiveComponentBase *callComp, FwIndexType portNum, U32 addr, Fw::Buffer &serBuffer)
The port callback function type.
Definition: I2cPortAc.hpp:35
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: I2cPortAc.cpp:37
Input I2c port.
Definition: I2cPortAc.hpp:24