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)
366 #if FW_ENABLE_TEXT_LOGGING == 1 369 getNum_LogText_OutputPorts()
const 401 static_cast<FwAssertArgType>(portNum)
404 return this->m_Log_OutputPort[portNum].
isConnected();
407 #if FW_ENABLE_TEXT_LOGGING == 1 409 bool LinuxGpioDriverComponentBase ::
410 isConnected_LogText_OutputPort(
FwIndexType portNum)
413 (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
414 static_cast<FwAssertArgType>(portNum)
417 return this->m_LogText_OutputPort[portNum].isConnected();
427 static_cast<FwAssertArgType>(portNum)
430 return this->m_Time_OutputPort[portNum].
isConnected();
442 static_cast<FwAssertArgType>(portNum)
445 return this->m_gpioInterrupt_OutputPort[portNum].
isConnected();
463 static_cast<FwAssertArgType>(portNum)
486 static_cast<FwAssertArgType>(portNum)
512 static_cast<FwAssertArgType>(portNum)
516 this->m_gpioInterrupt_OutputPort[portNum].isConnected(),
517 static_cast<FwAssertArgType>(portNum)
519 this->m_gpioInterrupt_OutputPort[portNum].
invoke(
538 if (this->m_Time_OutputPort[0].isConnected()) {
539 this->m_Time_OutputPort[0].
invoke(_logTime);
547 if (this->m_Log_OutputPort[0].isConnected()) {
551 #if FW_AMPCS_COMPATIBLE 553 _status = _logBuff.
serialize(static_cast<U8>(4));
556 static_cast<FwAssertArgType>(_status)
563 static_cast<FwAssertArgType>(_status)
569 static_cast<FwAssertArgType>(_status)
572 #if FW_AMPCS_COMPATIBLE 575 static_cast<U8>(
sizeof(U32))
579 static_cast<FwAssertArgType>(_status)
585 static_cast<FwAssertArgType>(_status)
591 static_cast<FwAssertArgType>(_status)
594 this->m_Log_OutputPort[0].
invoke(
603 #if FW_ENABLE_TEXT_LOGGING 604 if (this->m_LogText_OutputPort[0].isConnected()) {
605 #if FW_OBJECT_NAMES == 1 606 const char* _formatString =
607 "(%s) %s: Opened GPIO chip %s[%s] pin %" PRIu32
"[%s]";
609 const char* _formatString =
610 "%s: Opened GPIO chip %s[%s] pin %" PRIu32
"[%s]";
617 this->m_objName.toChar(),
626 this->m_LogText_OutputPort[0].invoke(
644 if (this->m_Time_OutputPort[0].isConnected()) {
645 this->m_Time_OutputPort[0].
invoke(_logTime);
653 if (this->m_Log_OutputPort[0].isConnected()) {
657 #if FW_AMPCS_COMPATIBLE 659 _status = _logBuff.
serialize(static_cast<U8>(2));
662 static_cast<FwAssertArgType>(_status)
669 static_cast<FwAssertArgType>(_status)
672 #if FW_AMPCS_COMPATIBLE 679 static_cast<FwAssertArgType>(_status)
685 static_cast<FwAssertArgType>(_status)
688 this->m_Log_OutputPort[0].
invoke(
697 #if FW_ENABLE_TEXT_LOGGING 698 if (this->m_LogText_OutputPort[0].isConnected()) {
699 #if FW_OBJECT_NAMES == 1 700 const char* _formatString =
701 "(%s) %s: Failed to open GPIO chip %s: %s";
703 const char* _formatString =
704 "%s: Failed to open GPIO chip %s: %s";
708 status.toString(statusStr);
714 this->m_objName.toChar(),
721 this->m_LogText_OutputPort[0].invoke(
741 if (this->m_Time_OutputPort[0].isConnected()) {
742 this->m_Time_OutputPort[0].
invoke(_logTime);
750 if (this->m_Log_OutputPort[0].isConnected()) {
754 #if FW_AMPCS_COMPATIBLE 756 _status = _logBuff.
serialize(static_cast<U8>(4));
759 static_cast<FwAssertArgType>(_status)
766 static_cast<FwAssertArgType>(_status)
769 #if FW_AMPCS_COMPATIBLE 772 static_cast<U8>(
sizeof(U32))
776 static_cast<FwAssertArgType>(_status)
782 static_cast<FwAssertArgType>(_status)
788 static_cast<FwAssertArgType>(_status)
791 #if FW_AMPCS_COMPATIBLE 798 static_cast<FwAssertArgType>(_status)
804 static_cast<FwAssertArgType>(_status)
807 this->m_Log_OutputPort[0].
invoke(
816 #if FW_ENABLE_TEXT_LOGGING 817 if (this->m_LogText_OutputPort[0].isConnected()) {
818 #if FW_OBJECT_NAMES == 1 819 const char* _formatString =
820 "(%s) %s: Failed to open GPIO chip %s pin %" PRIu32
" [%s]: %s";
822 const char* _formatString =
823 "%s: Failed to open GPIO chip %s pin %" PRIu32
" [%s]: %s";
827 status.toString(statusStr);
833 this->m_objName.toChar(),
842 this->m_LogText_OutputPort[0].invoke(
860 if (this->m_Time_OutputPort[0].isConnected()) {
861 this->m_Time_OutputPort[0].
invoke(_logTime);
869 if (this->m_Log_OutputPort[0].isConnected()) {
873 #if FW_AMPCS_COMPATIBLE 875 _status = _logBuff.
serialize(static_cast<U8>(2));
878 static_cast<FwAssertArgType>(_status)
882 #if FW_AMPCS_COMPATIBLE 885 static_cast<U8>(
sizeof(U32))
889 static_cast<FwAssertArgType>(_status)
895 static_cast<FwAssertArgType>(_status)
898 #if FW_AMPCS_COMPATIBLE 901 static_cast<U8>(
sizeof(U32))
905 static_cast<FwAssertArgType>(_status)
911 static_cast<FwAssertArgType>(_status)
914 this->m_Log_OutputPort[0].
invoke(
923 #if FW_ENABLE_TEXT_LOGGING 924 if (this->m_LogText_OutputPort[0].isConnected()) {
925 #if FW_OBJECT_NAMES == 1 926 const char* _formatString =
927 "(%s) %s: Interrupt data read expected %" PRIu32
" byes and got %" PRIu32
"";
929 const char* _formatString =
930 "%s: Interrupt data read expected %" PRIu32
" byes and got %" PRIu32
"";
937 this->m_objName.toChar(),
939 "InterruptReadError ",
944 this->m_LogText_OutputPort[0].invoke(
959 if (this->m_Time_OutputPort[0].isConnected()) {
960 this->m_Time_OutputPort[0].
invoke(_logTime);
968 if (this->m_Log_OutputPort[0].isConnected()) {
972 #if FW_AMPCS_COMPATIBLE 974 _status = _logBuff.
serialize(static_cast<U8>(1));
977 static_cast<FwAssertArgType>(_status)
981 #if FW_AMPCS_COMPATIBLE 984 static_cast<U8>(
sizeof(I32))
988 static_cast<FwAssertArgType>(_status)
991 _status = _logBuff.
serialize(error_number);
994 static_cast<FwAssertArgType>(_status)
997 this->m_Log_OutputPort[0].
invoke(
1006 #if FW_ENABLE_TEXT_LOGGING 1007 if (this->m_LogText_OutputPort[0].isConnected()) {
1008 #if FW_OBJECT_NAMES == 1 1009 const char* _formatString =
1010 "(%s) %s: Interrupt polling returned errno: %" PRIi32
"";
1012 const char* _formatString =
1013 "%s: Interrupt polling returned errno: %" PRIi32
"";
1020 this->m_objName.toChar(),
1026 this->m_LogText_OutputPort[0].invoke(
1043 if (this->m_Time_OutputPort[0].isConnected()) {
1045 this->m_Time_OutputPort[0].
invoke(_time);
1081 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)
Drv::InputGpioWritePort * get_gpioWrite_InputPort(FwIndexType portNum)
FwIndexType getNum_Time_OutputPorts() const
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
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.
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.
virtual Drv::GpioStatus gpioRead_handler(FwIndexType portNum, Fw::Logic &state)=0
Handler for input port gpioRead.
Software diagnostic events.
void init()
Object initializer.
FwIndexType getNum_gpioRead_InputPorts() const
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.
U32 FwEventIdType
The type of an event identifier.
SerializeStatus
forward declaration for string
void addCallPort(InputCyclePort *callPort)
Register an input port.
bool isConnected_Log_OutputPort(FwIndexType portNum)
Auto-generated base for LinuxGpioDriver component.
void init()
Initialization function.
#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
No time base has been established.
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.
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
void init()
Initialization function.
void init()
Initialization function.
FwIndexType getNum_gpioWrite_InputPorts() const
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.
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
void addCallPort(InputLogPort *callPort)
Register an input port.
FwIndexType getNum_Log_OutputPorts() const
virtual SerializeStatus serialize(SerializeBufferBase &buffer) const
serialization function
FwIndexType getNum_gpioInterrupt_OutputPorts() const
void invoke(Os::RawTime &cycleStart) const
Invoke a port interface.
virtual ~LinuxGpioDriverComponentBase()
Destroy LinuxGpioDriverComponentBase object.
FPP shadow-enum representing Os::File::Status.
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
#define FW_LOG_STRING_MAX_SIZE
Max size of log string parameter type.
virtual const CHAR * toChar() const =0