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
7
#include "
Drv/Ports/GpioWritePortAc.hpp
"
8
#include "
Fw/Types/Assert.hpp
"
9
#include "
Fw/Types/ExternalString.hpp
"
10
11
namespace
Drv
{
12
13
// ----------------------------------------------------------------------
14
// Input Port Member functions
15
// ----------------------------------------------------------------------
16
17
InputGpioWritePort ::
18
InputGpioWritePort
() :
19
Fw
::InputPortBase(),
20
m_func(nullptr)
21
{
22
23
}
24
25
void
InputGpioWritePort ::
26
init
()
27
{
28
Fw::InputPortBase::init
();
29
}
30
31
void
InputGpioWritePort ::
32
addCallComp
(
33
Fw::PassiveComponentBase
* callComp,
34
CompFuncPtr funcPtr
35
)
36
{
37
FW_ASSERT
(callComp !=
nullptr
);
38
FW_ASSERT
(funcPtr !=
nullptr
);
39
40
this->
m_comp
= callComp;
41
this->m_func = funcPtr;
42
this->
m_connObj
= callComp;
43
}
44
45
Drv::GpioStatus
InputGpioWritePort ::
46
invoke
(
const
Fw::Logic
& state)
47
{
48
#if FW_PORT_TRACING == 1
49
this->trace();
50
#endif
51
52
FW_ASSERT
(this->
m_comp
!=
nullptr
);
53
FW_ASSERT
(this->m_func !=
nullptr
);
54
55
return
this->m_func(this->
m_comp
, this->
m_portNum
, state);
56
}
57
58
#if FW_PORT_SERIALIZATION == 1
59
60
Fw::SerializeStatus
InputGpioWritePort ::
61
invokeSerial(
Fw::SerializeBufferBase
& _buffer)
62
{
63
// For ports with a return type, invokeSerial is not used
64
(void) _buffer;
65
66
FW_ASSERT
(0);
67
return
Fw::FW_SERIALIZE_OK
;
68
}
69
70
#endif
71
72
// ----------------------------------------------------------------------
73
// Output Port Member functions
74
// ----------------------------------------------------------------------
75
76
OutputGpioWritePort ::
77
OutputGpioWritePort
() :
78
Fw
::OutputPortBase(),
79
m_port(nullptr)
80
{
81
82
}
83
84
void
OutputGpioWritePort ::
85
init
()
86
{
87
Fw::OutputPortBase::init
();
88
}
89
90
void
OutputGpioWritePort ::
91
addCallPort
(
InputGpioWritePort
* callPort)
92
{
93
FW_ASSERT
(callPort !=
nullptr
);
94
95
this->m_port = callPort;
96
this->
m_connObj
= callPort;
97
98
#if FW_PORT_SERIALIZATION == 1
99
this->m_serPort =
nullptr
;
100
#endif
101
}
102
103
Drv::GpioStatus
OutputGpioWritePort ::
104
invoke
(
const
Fw::Logic
& state)
const
105
{
106
#if FW_PORT_TRACING == 1
107
this->trace();
108
#endif
109
110
FW_ASSERT
(this->m_port !=
nullptr
);
111
return
this->m_port->
invoke
(state);
112
}
113
114
}
Fw::FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.
Definition:
Serializable.hpp:15
Drv::OutputGpioWritePort::OutputGpioWritePort
OutputGpioWritePort()
Constructor.
Definition:
GpioWritePortAc.cpp:77
Fw::PassiveComponentBase
Definition:
PassiveComponentBase.hpp:10
Fw::InputPortBase::m_portNum
FwIndexType m_portNum
Definition:
InputPortBase.hpp:27
Drv::InputGpioWritePort::init
void init()
Initialization function.
Definition:
GpioWritePortAc.cpp:26
ExternalString.hpp
Drv::OutputGpioWritePort::invoke
Drv::GpioStatus invoke(const Fw::Logic &state) const
Invoke a port interface.
Definition:
GpioWritePortAc.cpp:104
Drv::InputGpioWritePort
Input GpioWrite port.
Definition:
GpioWritePortAc.hpp:24
GpioWritePortAc.hpp
Drv::GpioStatus
Definition:
GpioStatusEnumAc.hpp:16
Fw::SerializeStatus
SerializeStatus
forward declaration for string
Definition:
Serializable.hpp:14
Drv::OutputGpioWritePort::init
void init()
Initialization function.
Definition:
GpioWritePortAc.cpp:85
Drv::InputGpioWritePort::invoke
Drv::GpioStatus invoke(const Fw::Logic &state)
Invoke a port interface.
Definition:
GpioWritePortAc.cpp:46
Fw::OutputPortBase::init
void init() override
Definition:
OutputPortBase.cpp:21
Fw::SerializeBufferBase
Definition:
Serializable.hpp:54
Drv::InputGpioWritePort::InputGpioWritePort
InputGpioWritePort()
Constructor.
Definition:
GpioWritePortAc.cpp:18
Assert.hpp
Drv::OutputGpioWritePort::addCallPort
void addCallPort(InputGpioWritePort *callPort)
Register an input port.
Definition:
GpioWritePortAc.cpp:91
Drv::InputGpioWritePort::addCallComp
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition:
GpioWritePortAc.cpp:32
Fw::InputPortBase::m_comp
PassiveComponentBase * m_comp
Definition:
InputPortBase.hpp:26
Drv
Definition:
ByteStreamDataPortAc.cpp:11
Fw::InputPortBase::init
void init() override
Definition:
InputPortBase.cpp:18
Fw::Logic
Logic states.
Definition:
LogicEnumAc.hpp:17
Fw
Definition:
FppConstantsAc.hpp:121
Fw::PortBase::m_connObj
Fw::ObjBase * m_connObj
Definition:
PortBase.hpp:33
FW_ASSERT
#define FW_ASSERT(...)
Definition:
Assert.hpp:14
Drv
Ports
GpioWritePortAc.cpp
Generated by
1.8.14