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_intOut_OutputPort[port].
init();
141 #if FW_OBJECT_NAMES == 1
145 this->m_objName.toChar(),
148 this->m_intOut_OutputPort[port].setObjName(portName.
toChar());
165 return &this->m_gpioRead_InputPort[portNum];
176 return &this->m_gpioWrite_InputPort[portNum];
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);
226 this->m_Time_OutputPort[portNum].
addCallPort(port);
244 this->m_intOut_OutputPort[portNum].
addCallPort(port);
247 #if FW_PORT_SERIALIZATION
256 Fw::InputSerializePort* port
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);
288 Fw::InputSerializePort* port
296 this->m_Time_OutputPort[portNum].registerSerialPort(port);
301 #if FW_PORT_SERIALIZATION
310 Fw::InputSerializePort* port
318 this->m_intOut_OutputPort[portNum].registerSerialPort(port);
329 Fw::PassiveComponentBase(compName)
331 this->m_GP_WriteErrorThrottle = 0;
332 this->m_GP_ReadErrorThrottle = 0;
367 #if FW_ENABLE_TEXT_LOGGING == 1
370 getNum_LogText_OutputPorts()
const
405 return this->m_Log_OutputPort[portNum].
isConnected();
408 #if FW_ENABLE_TEXT_LOGGING == 1
410 bool LinuxGpioDriverComponentBase ::
411 isConnected_LogText_OutputPort(
FwIndexType portNum)
414 portNum < this->getNum_LogText_OutputPorts(),
418 return this->m_LogText_OutputPort[portNum].isConnected();
431 return this->m_Time_OutputPort[portNum].
isConnected();
446 return this->m_intOut_OutputPort[portNum].
isConnected();
507 this->m_intOut_OutputPort[portNum].
invoke(
525 if (this->m_Time_OutputPort[0].isConnected()) {
526 this->m_Time_OutputPort[0].
invoke(_logTime);
534 if (this->m_Log_OutputPort[0].isConnected()) {
538 #if FW_AMPCS_COMPATIBLE
547 #if FW_AMPCS_COMPATIBLE
550 static_cast<U8>(
sizeof(I32))
563 #if FW_AMPCS_COMPATIBLE
566 static_cast<U8>(
sizeof(I32))
585 this->m_Log_OutputPort[0].
invoke(
594 #if FW_ENABLE_TEXT_LOGGING
595 if (this->m_LogText_OutputPort[0].isConnected()) {
596 #if FW_OBJECT_NAMES == 1
597 const char* _formatString =
598 "(%s) %s: Error opening GPIO device %" PRIi32
": %" PRIi32
" (%s)";
600 const char* _formatString =
601 "%s: Error opening GPIO device %" PRIi32
": %" PRIi32
" (%s)";
608 this->m_objName.toChar(),
616 this->m_LogText_OutputPort[0].invoke(
634 if (this->m_Time_OutputPort[0].isConnected()) {
635 this->m_Time_OutputPort[0].
invoke(_logTime);
643 if (this->m_Log_OutputPort[0].isConnected()) {
647 #if FW_AMPCS_COMPATIBLE
656 #if FW_AMPCS_COMPATIBLE
659 static_cast<U8>(
sizeof(I32))
672 #if FW_AMPCS_COMPATIBLE
675 static_cast<U8>(
sizeof(I32))
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: Error configuring GPIO device %" PRIi32
": %" PRIi32
"";
703 const char* _formatString =
704 "%s: Error configuring GPIO device %" PRIi32
": %" PRIi32
"";
711 this->m_objName.toChar(),
718 this->m_LogText_OutputPort[0].invoke(
739 this->m_GP_WriteErrorThrottle++;
744 if (this->m_Time_OutputPort[0].isConnected()) {
745 this->m_Time_OutputPort[0].
invoke(_logTime);
753 if (this->m_Log_OutputPort[0].isConnected()) {
757 #if FW_AMPCS_COMPATIBLE
766 #if FW_AMPCS_COMPATIBLE
769 static_cast<U8>(
sizeof(I32))
782 #if FW_AMPCS_COMPATIBLE
785 static_cast<U8>(
sizeof(I32))
798 this->m_Log_OutputPort[0].
invoke(
807 #if FW_ENABLE_TEXT_LOGGING
808 if (this->m_LogText_OutputPort[0].isConnected()) {
809 #if FW_OBJECT_NAMES == 1
810 const char* _formatString =
811 "(%s) %s: Error writing GPIO device %" PRIi32
": %" PRIi32
"";
813 const char* _formatString =
814 "%s: Error writing GPIO device %" PRIi32
": %" PRIi32
"";
821 this->m_objName.toChar(),
828 this->m_LogText_OutputPort[0].invoke(
849 this->m_GP_ReadErrorThrottle++;
854 if (this->m_Time_OutputPort[0].isConnected()) {
855 this->m_Time_OutputPort[0].
invoke(_logTime);
863 if (this->m_Log_OutputPort[0].isConnected()) {
867 #if FW_AMPCS_COMPATIBLE
876 #if FW_AMPCS_COMPATIBLE
879 static_cast<U8>(
sizeof(I32))
892 #if FW_AMPCS_COMPATIBLE
895 static_cast<U8>(
sizeof(I32))
908 this->m_Log_OutputPort[0].
invoke(
917 #if FW_ENABLE_TEXT_LOGGING
918 if (this->m_LogText_OutputPort[0].isConnected()) {
919 #if FW_OBJECT_NAMES == 1
920 const char* _formatString =
921 "(%s) %s: Error reading GPIO device %" PRIi32
": %" PRIi32
"";
923 const char* _formatString =
924 "%s: Error reading GPIO device %" PRIi32
": %" PRIi32
"";
931 this->m_objName.toChar(),
938 this->m_LogText_OutputPort[0].invoke(
953 if (this->m_Time_OutputPort[0].isConnected()) {
954 this->m_Time_OutputPort[0].
invoke(_logTime);
962 if (this->m_Log_OutputPort[0].isConnected()) {
966 #if FW_AMPCS_COMPATIBLE
975 #if FW_AMPCS_COMPATIBLE
978 static_cast<U8>(
sizeof(I32))
991 this->m_Log_OutputPort[0].
invoke(
1000 #if FW_ENABLE_TEXT_LOGGING
1001 if (this->m_LogText_OutputPort[0].isConnected()) {
1002 #if FW_OBJECT_NAMES == 1
1003 const char* _formatString =
1004 "(%s) %s: GPIO Device %" PRIi32
" configured";
1006 const char* _formatString =
1007 "%s: GPIO Device %" PRIi32
" configured";
1014 this->m_objName.toChar(),
1020 this->m_LogText_OutputPort[0].invoke(
1035 if (this->m_Time_OutputPort[0].isConnected()) {
1036 this->m_Time_OutputPort[0].
invoke(_logTime);
1044 if (this->m_Log_OutputPort[0].isConnected()) {
1048 #if FW_AMPCS_COMPATIBLE
1057 #if FW_AMPCS_COMPATIBLE
1060 static_cast<U8>(
sizeof(I32))
1073 this->m_Log_OutputPort[0].
invoke(
1082 #if FW_ENABLE_TEXT_LOGGING
1083 if (this->m_LogText_OutputPort[0].isConnected()) {
1084 #if FW_OBJECT_NAMES == 1
1085 const char* _formatString =
1086 "(%s) %s: GPIO Device %" PRIi32
" interrupt start error";
1088 const char* _formatString =
1089 "%s: GPIO Device %" PRIi32
" interrupt start error";
1096 this->m_objName.toChar(),
1098 "GP_IntStartError ",
1102 this->m_LogText_OutputPort[0].invoke(
1117 if (this->m_Time_OutputPort[0].isConnected()) {
1118 this->m_Time_OutputPort[0].
invoke(_logTime);
1126 if (this->m_Log_OutputPort[0].isConnected()) {
1130 #if FW_AMPCS_COMPATIBLE
1139 #if FW_AMPCS_COMPATIBLE
1142 static_cast<U8>(
sizeof(I32))
1155 this->m_Log_OutputPort[0].
invoke(
1164 #if FW_ENABLE_TEXT_LOGGING
1165 if (this->m_LogText_OutputPort[0].isConnected()) {
1166 #if FW_OBJECT_NAMES == 1
1167 const char* _formatString =
1168 "(%s) %s: GPIO Device %" PRIi32
" interrupt wait error";
1170 const char* _formatString =
1171 "%s: GPIO Device %" PRIi32
" interrupt wait error";
1178 this->m_objName.toChar(),
1184 this->m_LogText_OutputPort[0].invoke(
1202 this->m_GP_WriteErrorThrottle = 0;
1209 this->m_GP_ReadErrorThrottle = 0;
1219 if (this->m_Time_OutputPort[0].isConnected()) {
1221 this->m_Time_OutputPort[0].
invoke(_time);
1233 void LinuxGpioDriverComponentBase ::
1248 void LinuxGpioDriverComponentBase ::
1257 compPtr->gpioWrite_handlerBase(
#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)
Auto-generated base for LinuxGpioDriver component.
virtual void gpioRead_handler(FwIndexType portNum, Fw::Logic &state)=0
Handler for input port gpioRead.
void gpioWrite_handlerBase(FwIndexType portNum, const Fw::Logic &state)
Handler base-class function for input port gpioWrite.
Drv::InputGpioWritePort * get_gpioWrite_InputPort(FwIndexType portNum)
@ EVENTID_GP_WRITEERROR
GPIO write error.
@ EVENTID_GP_INTSTARTERROR
GPIO interrupt start error notification.
@ EVENTID_GP_CONFIGERROR
GPIO configure error.
@ EVENTID_GP_INTWAITERROR
GPIO interrupt wait error notification.
@ EVENTID_GP_OPENERROR
Open error.
@ EVENTID_GP_PORTOPENED
GPIO opened notification.
@ EVENTID_GP_READERROR
GPIO read error.
void intOut_out(FwIndexType portNum, Svc::TimerVal &cycleStart)
Invoke output port intOut.
void set_intOut_OutputPort(FwIndexType portNum, Svc::InputCyclePort *port)
Connect port to intOut[portNum].
FwIndexType getNum_gpioWrite_InputPorts() const
void log_WARNING_HI_GP_IntStartError(I32 gpio)
virtual ~LinuxGpioDriverComponentBase()
Destroy LinuxGpioDriverComponentBase object.
virtual void gpioWrite_handler(FwIndexType portNum, const Fw::Logic &state)=0
Handler for input port gpioWrite.
@ EVENTID_GP_READERROR_THROTTLE
Throttle reset count for GP_ReadError.
@ EVENTID_GP_WRITEERROR_THROTTLE
Throttle reset count for GP_WriteError.
bool isConnected_intOut_OutputPort(FwIndexType portNum)
FwIndexType getNum_Log_OutputPorts() const
FwIndexType getNum_intOut_OutputPorts() const
void log_WARNING_HI_GP_ReadError(I32 gpio, I32 error)
void log_WARNING_HI_GP_IntWaitError(I32 gpio)
void log_WARNING_HI_GP_ReadError_ThrottleClear()
Reset throttle value for GP_ReadError.
void set_Time_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
Drv::InputGpioReadPort * get_gpioRead_InputPort(FwIndexType portNum)
void log_WARNING_HI_GP_OpenError(I32 gpio, I32 error, const Fw::StringBase &msg)
FwIndexType getNum_gpioRead_InputPorts() const
void log_WARNING_HI_GP_WriteError(I32 gpio, I32 error)
void gpioRead_handlerBase(FwIndexType portNum, Fw::Logic &state)
Handler base-class function for input port gpioRead.
void log_WARNING_HI_GP_WriteError_ThrottleClear()
Reset throttle value for GP_WriteError.
void set_Log_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to Log[portNum].
void log_WARNING_HI_GP_ConfigError(I32 gpio, I32 error)
bool isConnected_Time_OutputPort(FwIndexType portNum)
FwIndexType getNum_Time_OutputPorts() const
bool isConnected_Log_OutputPort(FwIndexType portNum)
LinuxGpioDriverComponentBase(const char *compName="")
Construct LinuxGpioDriverComponentBase object.
void log_ACTIVITY_HI_GP_PortOpened(I32 gpio)
@ WARNING_HI
A serious but recoverable event.
@ ACTIVITY_HI
Important informational events.
void init()
Object initializer.
const char * toChar() const
void init()
Initialization function.
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)
Invoke a port interface.
void addCallPort(InputLogPort *callPort)
Register an input port.
void addCallPort(InputTimePort *callPort)
Register an input port.
void invoke(Fw::Time &time)
Invoke a port interface.
void init()
Initialization function.
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
virtual const CHAR * toChar() const =0
void format(const CHAR *formatString,...)
write formatted string to buffer
virtual SerializeStatus serialize(SerializeBufferBase &buffer) const
serialization function
void init()
Initialization function.
void addCallPort(InputCyclePort *callPort)
Register an input port.
void invoke(Svc::TimerVal &cycleStart)
Invoke a port interface.
Serializable class for carrying timer values.
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.