10 #if FW_ENABLE_TEXT_LOGGING 32 this->m_gpioRead_InputPort[port].
init();
37 this->m_gpioRead_InputPort[port].
setPortNum(port);
39 #if FW_OBJECT_NAMES == 1 43 this->m_objName.toChar(),
46 this->m_gpioRead_InputPort[port].setObjName(portName.
toChar());
56 this->m_gpioWrite_InputPort[port].
init();
61 this->m_gpioWrite_InputPort[port].
setPortNum(port);
63 #if FW_OBJECT_NAMES == 1 67 this->m_objName.toChar(),
70 this->m_gpioWrite_InputPort[port].setObjName(portName.
toChar());
80 this->m_Log_OutputPort[port].
init();
82 #if FW_OBJECT_NAMES == 1 86 this->m_objName.toChar(),
89 this->m_Log_OutputPort[port].setObjName(portName.
toChar());
93 #if FW_ENABLE_TEXT_LOGGING == 1 97 port < static_cast<FwIndexType>(this->getNum_LogText_OutputPorts());
100 this->m_LogText_OutputPort[port].
init();
102 #if FW_OBJECT_NAMES == 1 106 this->m_objName.toChar(),
109 this->m_LogText_OutputPort[port].setObjName(portName.
toChar());
120 this->m_Time_OutputPort[port].
init();
122 #if FW_OBJECT_NAMES == 1 126 this->m_objName.toChar(),
129 this->m_Time_OutputPort[port].setObjName(portName.
toChar());
139 this->m_gpioInterrupt_OutputPort[port].
init();
141 #if FW_OBJECT_NAMES == 1 145 this->m_objName.toChar(),
148 this->m_gpioInterrupt_OutputPort[port].setObjName(portName.
toChar());
162 static_cast<FwAssertArgType>(portNum)
165 return &this->m_gpioRead_InputPort[portNum];
173 static_cast<FwAssertArgType>(portNum)
176 return &this->m_gpioWrite_InputPort[portNum];
191 static_cast<FwAssertArgType>(portNum)
197 #if FW_ENABLE_TEXT_LOGGING == 1 199 void LinuxGpioDriverComponentBase ::
200 set_LogText_OutputPort(
206 (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
207 static_cast<FwAssertArgType>(portNum)
210 this->m_LogText_OutputPort[portNum].addCallPort(port);
223 static_cast<FwAssertArgType>(portNum)
226 this->m_Time_OutputPort[portNum].
addCallPort(port);
241 static_cast<FwAssertArgType>(portNum)
244 this->m_gpioInterrupt_OutputPort[portNum].
addCallPort(port);
247 #if FW_PORT_SERIALIZATION 256 Fw::InputSerializePort* port
261 static_cast<FwAssertArgType>(portNum)
264 this->m_Log_OutputPort[portNum].registerSerialPort(port);
267 #if FW_ENABLE_TEXT_LOGGING == 1 269 void LinuxGpioDriverComponentBase ::
270 set_LogText_OutputPort(
272 Fw::InputSerializePort* port
276 (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
277 static_cast<FwAssertArgType>(portNum)
280 this->m_LogText_OutputPort[portNum].registerSerialPort(port);
288 Fw::InputSerializePort* port
293 static_cast<FwAssertArgType>(portNum)
296 this->m_Time_OutputPort[portNum].registerSerialPort(port);
301 #if FW_PORT_SERIALIZATION 310 Fw::InputSerializePort* port
315 static_cast<FwAssertArgType>(portNum)
318 this->m_gpioInterrupt_OutputPort[portNum].registerSerialPort(port);
329 Fw::PassiveComponentBase(compName)
349 static_cast<FwAssertArgType>(portNum)
352 return this->m_Log_OutputPort[portNum].
isConnected();
355 #if FW_ENABLE_TEXT_LOGGING == 1 357 bool LinuxGpioDriverComponentBase ::
358 isConnected_LogText_OutputPort(
FwIndexType portNum)
361 (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
362 static_cast<FwAssertArgType>(portNum)
365 return this->m_LogText_OutputPort[portNum].isConnected();
375 static_cast<FwAssertArgType>(portNum)
378 return this->m_Time_OutputPort[portNum].
isConnected();
390 static_cast<FwAssertArgType>(portNum)
393 return this->m_gpioInterrupt_OutputPort[portNum].
isConnected();
411 static_cast<FwAssertArgType>(portNum)
434 static_cast<FwAssertArgType>(portNum)
460 static_cast<FwAssertArgType>(portNum)
464 this->m_gpioInterrupt_OutputPort[portNum].isConnected(),
465 static_cast<FwAssertArgType>(portNum)
467 this->m_gpioInterrupt_OutputPort[portNum].
invoke(
486 if (this->m_Time_OutputPort[0].isConnected()) {
487 this->m_Time_OutputPort[0].
invoke(_logTime);
495 if (this->m_Log_OutputPort[0].isConnected()) {
499 #if FW_AMPCS_COMPATIBLE 504 static_cast<FwAssertArgType>(_status)
511 static_cast<FwAssertArgType>(_status)
517 static_cast<FwAssertArgType>(_status)
520 #if FW_AMPCS_COMPATIBLE 523 static_cast<U8>(
sizeof(U32))
527 static_cast<FwAssertArgType>(_status)
533 static_cast<FwAssertArgType>(_status)
539 static_cast<FwAssertArgType>(_status)
542 this->m_Log_OutputPort[0].
invoke(
551 #if FW_ENABLE_TEXT_LOGGING 552 if (this->m_LogText_OutputPort[0].isConnected()) {
553 #if FW_OBJECT_NAMES == 1 554 const char* _formatString =
555 "(%s) %s: Opened GPIO chip %s[%s] pin %" PRIu32
"[%s]";
557 const char* _formatString =
558 "%s: Opened GPIO chip %s[%s] pin %" PRIu32
"[%s]";
565 this->m_objName.toChar(),
574 this->m_LogText_OutputPort[0].invoke(
592 if (this->m_Time_OutputPort[0].isConnected()) {
593 this->m_Time_OutputPort[0].
invoke(_logTime);
601 if (this->m_Log_OutputPort[0].isConnected()) {
605 #if FW_AMPCS_COMPATIBLE 610 static_cast<FwAssertArgType>(_status)
617 static_cast<FwAssertArgType>(_status)
620 #if FW_AMPCS_COMPATIBLE 627 static_cast<FwAssertArgType>(_status)
633 static_cast<FwAssertArgType>(_status)
636 this->m_Log_OutputPort[0].
invoke(
645 #if FW_ENABLE_TEXT_LOGGING 646 if (this->m_LogText_OutputPort[0].isConnected()) {
647 #if FW_OBJECT_NAMES == 1 648 const char* _formatString =
649 "(%s) %s: Failed to open GPIO chip %s: %s";
651 const char* _formatString =
652 "%s: Failed to open GPIO chip %s: %s";
656 status.toString(statusStr);
662 this->m_objName.toChar(),
669 this->m_LogText_OutputPort[0].invoke(
689 if (this->m_Time_OutputPort[0].isConnected()) {
690 this->m_Time_OutputPort[0].
invoke(_logTime);
698 if (this->m_Log_OutputPort[0].isConnected()) {
702 #if FW_AMPCS_COMPATIBLE 707 static_cast<FwAssertArgType>(_status)
714 static_cast<FwAssertArgType>(_status)
717 #if FW_AMPCS_COMPATIBLE 720 static_cast<U8>(
sizeof(U32))
724 static_cast<FwAssertArgType>(_status)
730 static_cast<FwAssertArgType>(_status)
736 static_cast<FwAssertArgType>(_status)
739 #if FW_AMPCS_COMPATIBLE 746 static_cast<FwAssertArgType>(_status)
752 static_cast<FwAssertArgType>(_status)
755 this->m_Log_OutputPort[0].
invoke(
764 #if FW_ENABLE_TEXT_LOGGING 765 if (this->m_LogText_OutputPort[0].isConnected()) {
766 #if FW_OBJECT_NAMES == 1 767 const char* _formatString =
768 "(%s) %s: Failed to open GPIO chip %s pin %" PRIu32
" [%s]: %s";
770 const char* _formatString =
771 "%s: Failed to open GPIO chip %s pin %" PRIu32
" [%s]: %s";
775 status.toString(statusStr);
781 this->m_objName.toChar(),
790 this->m_LogText_OutputPort[0].invoke(
808 if (this->m_Time_OutputPort[0].isConnected()) {
809 this->m_Time_OutputPort[0].
invoke(_logTime);
817 if (this->m_Log_OutputPort[0].isConnected()) {
821 #if FW_AMPCS_COMPATIBLE 826 static_cast<FwAssertArgType>(_status)
830 #if FW_AMPCS_COMPATIBLE 833 static_cast<U8>(
sizeof(U32))
837 static_cast<FwAssertArgType>(_status)
843 static_cast<FwAssertArgType>(_status)
846 #if FW_AMPCS_COMPATIBLE 849 static_cast<U8>(
sizeof(U32))
853 static_cast<FwAssertArgType>(_status)
859 static_cast<FwAssertArgType>(_status)
862 this->m_Log_OutputPort[0].
invoke(
871 #if FW_ENABLE_TEXT_LOGGING 872 if (this->m_LogText_OutputPort[0].isConnected()) {
873 #if FW_OBJECT_NAMES == 1 874 const char* _formatString =
875 "(%s) %s: Interrupt data read expected %" PRIu32
" byes and got %" PRIu32
"";
877 const char* _formatString =
878 "%s: Interrupt data read expected %" PRIu32
" byes and got %" PRIu32
"";
885 this->m_objName.toChar(),
887 "InterruptReadError ",
892 this->m_LogText_OutputPort[0].invoke(
907 if (this->m_Time_OutputPort[0].isConnected()) {
908 this->m_Time_OutputPort[0].
invoke(_logTime);
916 if (this->m_Log_OutputPort[0].isConnected()) {
920 #if FW_AMPCS_COMPATIBLE 925 static_cast<FwAssertArgType>(_status)
929 #if FW_AMPCS_COMPATIBLE 932 static_cast<U8>(
sizeof(I32))
936 static_cast<FwAssertArgType>(_status)
942 static_cast<FwAssertArgType>(_status)
945 this->m_Log_OutputPort[0].
invoke(
954 #if FW_ENABLE_TEXT_LOGGING 955 if (this->m_LogText_OutputPort[0].isConnected()) {
956 #if FW_OBJECT_NAMES == 1 957 const char* _formatString =
958 "(%s) %s: Interrupt polling returned errno: %" PRIi32
"";
960 const char* _formatString =
961 "%s: Interrupt polling returned errno: %" PRIi32
"";
968 this->m_objName.toChar(),
974 this->m_LogText_OutputPort[0].invoke(
991 if (this->m_Time_OutputPort[0].isConnected()) {
993 this->m_Time_OutputPort[0].
invoke(_time);
1029 return compPtr->gpioWrite_handlerBase(
Serialization/Deserialization operation was successful.
void addCallPort(InputTimePort *callPort)
Register an input port.
Drv::InputGpioReadPort * get_gpioRead_InputPort(FwIndexType portNum)
bool isConnected_gpioInterrupt_OutputPort(FwIndexType portNum)
static constexpr FwIndexType getNum_Time_OutputPorts()
Drv::InputGpioWritePort * get_gpioWrite_InputPort(FwIndexType portNum)
static constexpr FwIndexType getNum_gpioRead_InputPorts()
FwIdType getIdBase() const
#define FW_LOG_STRING_MAX_SIZE
Max size of log string parameter type.
void log_WARNING_HI_InterruptReadError(U32 expected, U32 got) const
Log event InterruptReadError.
const char * toChar() const
LinuxGpioDriverComponentBase(const char *compName="")
Construct LinuxGpioDriverComponentBase object.
void set_gpioInterrupt_OutputPort(FwIndexType portNum, Svc::InputCyclePort *port)
Connect port to gpioInterrupt[portNum].
Drv::GpioStatus gpioWrite_handlerBase(FwIndexType portNum, const Fw::Logic &state)
Handler base-class function for input port gpioWrite.
static constexpr FwIndexType getNum_gpioInterrupt_OutputPorts()
virtual Drv::GpioStatus gpioWrite_handler(FwIndexType portNum, const Fw::Logic &state)=0
Handler for input port gpioWrite.
void log_WARNING_HI_OpenPinError(const Fw::StringBase &chip, U32 pin, const Fw::StringBase &pinMessage, Os::FileStatus status) const
Log event OpenPinError.
No time base has been established (Required)
virtual Drv::GpioStatus gpioRead_handler(FwIndexType portNum, Fw::Logic &state)=0
Handler for input port gpioRead.
Software diagnostic events.
void init()
Object initializer.
void set_Time_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
Drv::GpioStatus gpioRead_handlerBase(FwIndexType portNum, Fw::Logic &state)
Handler base-class function for input port gpioRead.
SerializeStatus
forward declaration for string
void addCallPort(InputCyclePort *callPort)
Register an input port.
static constexpr FwIndexType getNum_gpioWrite_InputPorts()
FwIdType FwEventIdType
The type of an event identifier.
bool isConnected_Log_OutputPort(FwIndexType portNum)
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
Auto-generated base for LinuxGpioDriver component.
void init()
Initialization function.
static constexpr FwIndexType getNum_Log_OutputPorts()
#define FW_MIN(a, b)
MIN macro.
bool isConnected_Time_OutputPort(FwIndexType portNum)
void log_WARNING_HI_OpenChipError(const Fw::StringBase &chip, Os::FileStatus status) const
Log event OpenChipError.
void invoke(Fw::Time &time) const
Invoke a port interface.
const char * toChar() const
void log_DIAGNOSTIC_OpenChip(const Fw::StringBase &chip, const Fw::StringBase &chipLabel, U32 pin, const Fw::StringBase &pinMessage) const
Log event OpenChip.
void gpioInterrupt_out(FwIndexType portNum, Os::RawTime &cycleStart)
Invoke output port gpioInterrupt.
A serious but recoverable event.
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG)
serialize 8-bit unsigned int
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
void init()
Initialization function.
void init()
Initialization function.
void set_Log_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to Log[portNum].
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port interface.
The size of the serial representation.
PlatformIndexType FwIndexType
void log_WARNING_HI_PollingError(I32 error_number) const
Log event PollingError.
void addCallPort(InputLogPort *callPort)
Register an input port.
SerializeStatus serializeTo(SerializeBufferBase &buffer, Endianness mode=Endianness::BIG) const override
serialize contents to buffer
void invoke(Os::RawTime &cycleStart) const
Invoke a port interface.
Implementation of malloc based allocator.
virtual ~LinuxGpioDriverComponentBase()
Destroy LinuxGpioDriverComponentBase object.
FPP shadow-enum representing Os::File::Status.
virtual const CHAR * toChar() const =0