10#if FW_ENABLE_TEXT_LOGGING
20 void LinuxGpioDriverComponentBase ::
29 port < static_cast<FwIndexType>(this->getNum_gpioRead_InputPorts());
32 this->m_gpioRead_InputPort[port].init();
33 this->m_gpioRead_InputPort[port].addCallComp(
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());
53 port < static_cast<FwIndexType>(this->getNum_gpioWrite_InputPorts());
56 this->m_gpioWrite_InputPort[port].init();
57 this->m_gpioWrite_InputPort[port].addCallComp(
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());
77 port < static_cast<FwIndexType>(this->getNum_Log_OutputPorts());
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());
117 port < static_cast<FwIndexType>(this->getNum_Time_OutputPorts());
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());
136 port < static_cast<FwIndexType>(this->getNum_gpioInterrupt_OutputPorts());
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());
20 void LinuxGpioDriverComponentBase :: {
…}
161 portNum < this->getNum_gpioRead_InputPorts(),
165 return &this->m_gpioRead_InputPort[portNum];
172 portNum < this->getNum_gpioWrite_InputPorts(),
176 return &this->m_gpioWrite_InputPort[portNum];
183 void LinuxGpioDriverComponentBase ::
190 portNum < this->getNum_Log_OutputPorts(),
194 this->m_Log_OutputPort[portNum].addCallPort(port);
183 void LinuxGpioDriverComponentBase :: {
…}
197#if FW_ENABLE_TEXT_LOGGING == 1
199 void LinuxGpioDriverComponentBase ::
200 set_LogText_OutputPort(
206 portNum < this->getNum_LogText_OutputPorts(),
210 this->m_LogText_OutputPort[portNum].addCallPort(port);
215 void LinuxGpioDriverComponentBase ::
222 portNum < this->getNum_Time_OutputPorts(),
226 this->m_Time_OutputPort[portNum].addCallPort(port);
215 void LinuxGpioDriverComponentBase :: {
…}
233 void LinuxGpioDriverComponentBase ::
234 set_gpioInterrupt_OutputPort(
240 portNum < this->getNum_gpioInterrupt_OutputPorts(),
244 this->m_gpioInterrupt_OutputPort[portNum].addCallPort(port);
233 void LinuxGpioDriverComponentBase :: {
…}
247#if FW_PORT_SERIALIZATION
253 void LinuxGpioDriverComponentBase ::
256 Fw::InputSerializePort* port
260 portNum < this->getNum_Log_OutputPorts(),
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 portNum < this->getNum_LogText_OutputPorts(),
280 this->m_LogText_OutputPort[portNum].registerSerialPort(port);
285 void LinuxGpioDriverComponentBase ::
288 Fw::InputSerializePort* port
292 portNum < this->getNum_Time_OutputPorts(),
296 this->m_Time_OutputPort[portNum].registerSerialPort(port);
301#if FW_PORT_SERIALIZATION
307 void LinuxGpioDriverComponentBase ::
308 set_gpioInterrupt_OutputPort(
310 Fw::InputSerializePort* port
314 portNum < this->getNum_gpioInterrupt_OutputPorts(),
318 this->m_gpioInterrupt_OutputPort[portNum].registerSerialPort(port);
327 LinuxGpioDriverComponentBase ::
328 LinuxGpioDriverComponentBase(
const char* compName) :
329 Fw::PassiveComponentBase(compName)
327 LinuxGpioDriverComponentBase :: {
…}
334 LinuxGpioDriverComponentBase ::
335 ~LinuxGpioDriverComponentBase()
334 LinuxGpioDriverComponentBase :: {
…}
345 getNum_gpioRead_InputPorts()
const
351 getNum_gpioWrite_InputPorts()
const
361 getNum_Log_OutputPorts()
const
366#if FW_ENABLE_TEXT_LOGGING == 1
369 getNum_LogText_OutputPorts()
const
377 getNum_Time_OutputPorts()
const
387 getNum_gpioInterrupt_OutputPorts()
const
396 bool LinuxGpioDriverComponentBase ::
400 portNum < this->getNum_Log_OutputPorts(),
404 return this->m_Log_OutputPort[portNum].isConnected();
396 bool LinuxGpioDriverComponentBase :: {
…}
407#if FW_ENABLE_TEXT_LOGGING == 1
409 bool LinuxGpioDriverComponentBase ::
410 isConnected_LogText_OutputPort(
FwIndexType portNum)
413 portNum < this->getNum_LogText_OutputPorts(),
417 return this->m_LogText_OutputPort[portNum].isConnected();
422 bool LinuxGpioDriverComponentBase ::
426 portNum < this->getNum_Time_OutputPorts(),
430 return this->m_Time_OutputPort[portNum].isConnected();
422 bool LinuxGpioDriverComponentBase :: {
…}
437 bool LinuxGpioDriverComponentBase ::
438 isConnected_gpioInterrupt_OutputPort(
FwIndexType portNum)
441 portNum < this->getNum_gpioInterrupt_OutputPorts(),
445 return this->m_gpioInterrupt_OutputPort[portNum].isConnected();
437 bool LinuxGpioDriverComponentBase :: {
…}
455 gpioRead_handlerBase(
462 portNum < this->getNum_gpioRead_InputPorts(),
469 retVal = this->gpioRead_handler(
478 gpioWrite_handlerBase(
485 portNum < this->getNum_gpioWrite_InputPorts(),
492 retVal = this->gpioWrite_handler(
504 void LinuxGpioDriverComponentBase ::
511 portNum < this->getNum_gpioInterrupt_OutputPorts(),
514 this->m_gpioInterrupt_OutputPort[portNum].invoke(
504 void LinuxGpioDriverComponentBase :: {
…}
523 void LinuxGpioDriverComponentBase ::
524 log_DIAGNOSTIC_OpenChip(
533 if (this->m_Time_OutputPort[0].isConnected()) {
534 this->m_Time_OutputPort[0].invoke(_logTime);
539 _id = this->getIdBase() + EVENTID_OPENCHIP;
542 if (this->m_Log_OutputPort[0].isConnected()) {
546#if FW_AMPCS_COMPATIBLE
567#if FW_AMPCS_COMPATIBLE
570 static_cast<U8>(
sizeof(U32))
589 this->m_Log_OutputPort[0].invoke(
598#if FW_ENABLE_TEXT_LOGGING
599 if (this->m_LogText_OutputPort[0].isConnected()) {
600#if FW_OBJECT_NAMES == 1
601 const char* _formatString =
602 "(%s) %s: Opened GPIO chip %s[%s] pin %" PRIu32
"[%s]";
604 const char* _formatString =
605 "%s: Opened GPIO chip %s[%s] pin %" PRIu32
"[%s]";
612 this->m_objName.toChar(),
621 this->m_LogText_OutputPort[0].invoke(
523 void LinuxGpioDriverComponentBase :: {
…}
631 void LinuxGpioDriverComponentBase ::
632 log_WARNING_HI_OpenChipError(
639 if (this->m_Time_OutputPort[0].isConnected()) {
640 this->m_Time_OutputPort[0].invoke(_logTime);
645 _id = this->getIdBase() + EVENTID_OPENCHIPERROR;
648 if (this->m_Log_OutputPort[0].isConnected()) {
652#if FW_AMPCS_COMPATIBLE
667#if FW_AMPCS_COMPATIBLE
683 this->m_Log_OutputPort[0].invoke(
692#if FW_ENABLE_TEXT_LOGGING
693 if (this->m_LogText_OutputPort[0].isConnected()) {
694#if FW_OBJECT_NAMES == 1
695 const char* _formatString =
696 "(%s) %s: Failed to open GPIO chip %s: %s";
698 const char* _formatString =
699 "%s: Failed to open GPIO chip %s: %s";
703 status.toString(statusStr);
709 this->m_objName.toChar(),
716 this->m_LogText_OutputPort[0].invoke(
631 void LinuxGpioDriverComponentBase :: {
…}
726 void LinuxGpioDriverComponentBase ::
727 log_WARNING_HI_OpenPinError(
736 if (this->m_Time_OutputPort[0].isConnected()) {
737 this->m_Time_OutputPort[0].invoke(_logTime);
742 _id = this->getIdBase() + EVENTID_OPENPINERROR;
745 if (this->m_Log_OutputPort[0].isConnected()) {
749#if FW_AMPCS_COMPATIBLE
764#if FW_AMPCS_COMPATIBLE
767 static_cast<U8>(
sizeof(U32))
786#if FW_AMPCS_COMPATIBLE
802 this->m_Log_OutputPort[0].invoke(
811#if FW_ENABLE_TEXT_LOGGING
812 if (this->m_LogText_OutputPort[0].isConnected()) {
813#if FW_OBJECT_NAMES == 1
814 const char* _formatString =
815 "(%s) %s: Failed to open GPIO chip %s pin %" PRIu32
" [%s]: %s";
817 const char* _formatString =
818 "%s: Failed to open GPIO chip %s pin %" PRIu32
" [%s]: %s";
822 status.toString(statusStr);
828 this->m_objName.toChar(),
837 this->m_LogText_OutputPort[0].invoke(
726 void LinuxGpioDriverComponentBase :: {
…}
847 void LinuxGpioDriverComponentBase ::
848 log_WARNING_HI_InterruptReadError(
855 if (this->m_Time_OutputPort[0].isConnected()) {
856 this->m_Time_OutputPort[0].invoke(_logTime);
861 _id = this->getIdBase() + EVENTID_INTERRUPTREADERROR;
864 if (this->m_Log_OutputPort[0].isConnected()) {
868#if FW_AMPCS_COMPATIBLE
877#if FW_AMPCS_COMPATIBLE
880 static_cast<U8>(
sizeof(U32))
893#if FW_AMPCS_COMPATIBLE
896 static_cast<U8>(
sizeof(U32))
909 this->m_Log_OutputPort[0].invoke(
918#if FW_ENABLE_TEXT_LOGGING
919 if (this->m_LogText_OutputPort[0].isConnected()) {
920#if FW_OBJECT_NAMES == 1
921 const char* _formatString =
922 "(%s) %s: Interrupt data read expected %" PRIu32
" byes and got %" PRIu32
"";
924 const char* _formatString =
925 "%s: Interrupt data read expected %" PRIu32
" byes and got %" PRIu32
"";
932 this->m_objName.toChar(),
934 "InterruptReadError ",
939 this->m_LogText_OutputPort[0].invoke(
847 void LinuxGpioDriverComponentBase :: {
…}
949 void LinuxGpioDriverComponentBase ::
950 log_WARNING_HI_PollingError(I32 error_number)
const
954 if (this->m_Time_OutputPort[0].isConnected()) {
955 this->m_Time_OutputPort[0].invoke(_logTime);
960 _id = this->getIdBase() + EVENTID_POLLINGERROR;
963 if (this->m_Log_OutputPort[0].isConnected()) {
967#if FW_AMPCS_COMPATIBLE
976#if FW_AMPCS_COMPATIBLE
979 static_cast<U8>(
sizeof(I32))
986 _status = _logBuff.
serialize(error_number);
992 this->m_Log_OutputPort[0].invoke(
1001#if FW_ENABLE_TEXT_LOGGING
1002 if (this->m_LogText_OutputPort[0].isConnected()) {
1003#if FW_OBJECT_NAMES == 1
1004 const char* _formatString =
1005 "(%s) %s: Interrupt polling returned errno: %" PRIi32
"";
1007 const char* _formatString =
1008 "%s: Interrupt polling returned errno: %" PRIi32
"";
1015 this->m_objName.toChar(),
1021 this->m_LogText_OutputPort[0].invoke(
949 void LinuxGpioDriverComponentBase :: {
…}
1038 if (this->m_Time_OutputPort[0].isConnected()) {
1040 this->m_Time_OutputPort[0].invoke(_time);
1075 LinuxGpioDriverComponentBase* compPtr =
static_cast<LinuxGpioDriverComponentBase*
>(callComp);
#define FW_MIN(a, b)
MIN macro.
uint8_t U8
8-bit unsigned integer
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
#define PRI_PlatformIntType
@ TB_NONE
No time base has been established.
PlatformAssertArgType FwAssertArgType
#define FW_LOG_STRING_MAX_SIZE
Max size of log string parameter type.
PlatformIndexType FwIndexType
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects)/*#en...
Auto-generated base for LinuxGpioDriver component.
Drv::GpioStatus gpioRead_handlerBase(FwIndexType portNum, Fw::Logic &state)
Handler base-class function for input port gpioRead.
Drv::GpioStatus gpioWrite_handlerBase(FwIndexType portNum, const Fw::Logic &state)
Handler base-class function for input port gpioWrite.
@ WARNING_HI
A serious but recoverable event.
@ DIAGNOSTIC
Software diagnostic events.
void init()
Object initializer.
const char * toChar() const
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
void format(const CHAR *formatString,...)
write formatted string to buffer
virtual SerializeStatus serialize(SerializeBufferBase &buffer) const
serialization function
virtual const CHAR * toChar() const =0
const char * toChar() const
FPP shadow-enum representing Os::File::Status.
@ SERIALIZED_SIZE
The size of the serial representation.
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.