10#if FW_ENABLE_TEXT_LOGGING
20 void LinuxSpiDriverComponentBase ::
29 port < static_cast<FwIndexType>(this->getNum_SpiReadWrite_InputPorts());
32 this->m_SpiReadWrite_InputPort[port].init();
33 this->m_SpiReadWrite_InputPort[port].addCallComp(
37 this->m_SpiReadWrite_InputPort[port].setPortNum(port);
39#if FW_OBJECT_NAMES == 1
43 this->m_objName.toChar(),
46 this->m_SpiReadWrite_InputPort[port].setObjName(portName.
toChar());
53 port < static_cast<FwIndexType>(this->getNum_Log_OutputPorts());
56 this->m_Log_OutputPort[port].init();
58#if FW_OBJECT_NAMES == 1
62 this->m_objName.toChar(),
65 this->m_Log_OutputPort[port].setObjName(portName.
toChar());
69#if FW_ENABLE_TEXT_LOGGING == 1
73 port < static_cast<FwIndexType>(this->getNum_LogText_OutputPorts());
76 this->m_LogText_OutputPort[port].init();
78#if FW_OBJECT_NAMES == 1
82 this->m_objName.toChar(),
85 this->m_LogText_OutputPort[port].setObjName(portName.
toChar());
93 port < static_cast<FwIndexType>(this->getNum_Time_OutputPorts());
96 this->m_Time_OutputPort[port].init();
98#if FW_OBJECT_NAMES == 1
102 this->m_objName.toChar(),
105 this->m_Time_OutputPort[port].setObjName(portName.
toChar());
112 port < static_cast<FwIndexType>(this->getNum_Tlm_OutputPorts());
115 this->m_Tlm_OutputPort[port].init();
117#if FW_OBJECT_NAMES == 1
121 this->m_objName.toChar(),
124 this->m_Tlm_OutputPort[port].setObjName(portName.
toChar());
137 portNum < this->getNum_SpiReadWrite_InputPorts(),
141 return &this->m_SpiReadWrite_InputPort[portNum];
148 void LinuxSpiDriverComponentBase ::
155 portNum < this->getNum_Log_OutputPorts(),
159 this->m_Log_OutputPort[portNum].addCallPort(port);
162#if FW_ENABLE_TEXT_LOGGING == 1
164 void LinuxSpiDriverComponentBase ::
165 set_LogText_OutputPort(
171 portNum < this->getNum_LogText_OutputPorts(),
175 this->m_LogText_OutputPort[portNum].addCallPort(port);
180 void LinuxSpiDriverComponentBase ::
187 portNum < this->getNum_Time_OutputPorts(),
191 this->m_Time_OutputPort[portNum].addCallPort(port);
194 void LinuxSpiDriverComponentBase ::
201 portNum < this->getNum_Tlm_OutputPorts(),
205 this->m_Tlm_OutputPort[portNum].addCallPort(port);
208#if FW_PORT_SERIALIZATION
214 void LinuxSpiDriverComponentBase ::
217 Fw::InputSerializePort* port
221 portNum < this->getNum_Log_OutputPorts(),
225 this->m_Log_OutputPort[portNum].registerSerialPort(port);
228#if FW_ENABLE_TEXT_LOGGING == 1
230 void LinuxSpiDriverComponentBase ::
231 set_LogText_OutputPort(
233 Fw::InputSerializePort* port
237 portNum < this->getNum_LogText_OutputPorts(),
241 this->m_LogText_OutputPort[portNum].registerSerialPort(port);
246 void LinuxSpiDriverComponentBase ::
249 Fw::InputSerializePort* port
253 portNum < this->getNum_Time_OutputPorts(),
257 this->m_Time_OutputPort[portNum].registerSerialPort(port);
260 void LinuxSpiDriverComponentBase ::
263 Fw::InputSerializePort* port
267 portNum < this->getNum_Tlm_OutputPorts(),
271 this->m_Tlm_OutputPort[portNum].registerSerialPort(port);
280 LinuxSpiDriverComponentBase ::
281 LinuxSpiDriverComponentBase(
const char* compName) :
282 Fw::PassiveComponentBase(compName)
284 this->m_SPI_WriteErrorThrottle = 0;
287 LinuxSpiDriverComponentBase ::
288 ~LinuxSpiDriverComponentBase()
298 getNum_SpiReadWrite_InputPorts()
const
308 getNum_Log_OutputPorts()
const
313#if FW_ENABLE_TEXT_LOGGING == 1
316 getNum_LogText_OutputPorts()
const
324 getNum_Time_OutputPorts()
const
330 getNum_Tlm_OutputPorts()
const
339 bool LinuxSpiDriverComponentBase ::
343 portNum < this->getNum_Log_OutputPorts(),
347 return this->m_Log_OutputPort[portNum].isConnected();
350#if FW_ENABLE_TEXT_LOGGING == 1
352 bool LinuxSpiDriverComponentBase ::
353 isConnected_LogText_OutputPort(
FwIndexType portNum)
356 portNum < this->getNum_LogText_OutputPorts(),
360 return this->m_LogText_OutputPort[portNum].isConnected();
365 bool LinuxSpiDriverComponentBase ::
369 portNum < this->getNum_Time_OutputPorts(),
373 return this->m_Time_OutputPort[portNum].isConnected();
376 bool LinuxSpiDriverComponentBase ::
380 portNum < this->getNum_Tlm_OutputPorts(),
384 return this->m_Tlm_OutputPort[portNum].isConnected();
393 void LinuxSpiDriverComponentBase ::
394 SpiReadWrite_handlerBase(
402 portNum < this->getNum_SpiReadWrite_InputPorts(),
407 this->SpiReadWrite_handler(
418 void LinuxSpiDriverComponentBase ::
419 log_WARNING_HI_SPI_OpenError(
427 if (this->m_Time_OutputPort[0].isConnected()) {
428 this->m_Time_OutputPort[0].invoke(_logTime);
433 _id = this->getIdBase() + EVENTID_SPI_OPENERROR;
436 if (this->m_Log_OutputPort[0].isConnected()) {
440#if FW_AMPCS_COMPATIBLE
449#if FW_AMPCS_COMPATIBLE
452 static_cast<U8>(
sizeof(I32))
465#if FW_AMPCS_COMPATIBLE
468 static_cast<U8>(
sizeof(I32))
481#if FW_AMPCS_COMPATIBLE
484 static_cast<U8>(
sizeof(I32))
497 this->m_Log_OutputPort[0].invoke(
506#if FW_ENABLE_TEXT_LOGGING
507 if (this->m_LogText_OutputPort[0].isConnected()) {
508#if FW_OBJECT_NAMES == 1
509 const char* _formatString =
510 "(%s) %s: Error opening SPI device %" PRIi32
".%" PRIi32
": %" PRIi32
"";
512 const char* _formatString =
513 "%s: Error opening SPI device %" PRIi32
".%" PRIi32
": %" PRIi32
"";
520 this->m_objName.toChar(),
528 this->m_LogText_OutputPort[0].invoke(
538 void LinuxSpiDriverComponentBase ::
539 log_WARNING_HI_SPI_ConfigError(
547 if (this->m_Time_OutputPort[0].isConnected()) {
548 this->m_Time_OutputPort[0].invoke(_logTime);
553 _id = this->getIdBase() + EVENTID_SPI_CONFIGERROR;
556 if (this->m_Log_OutputPort[0].isConnected()) {
560#if FW_AMPCS_COMPATIBLE
569#if FW_AMPCS_COMPATIBLE
572 static_cast<U8>(
sizeof(I32))
585#if FW_AMPCS_COMPATIBLE
588 static_cast<U8>(
sizeof(I32))
601#if FW_AMPCS_COMPATIBLE
604 static_cast<U8>(
sizeof(I32))
617 this->m_Log_OutputPort[0].invoke(
626#if FW_ENABLE_TEXT_LOGGING
627 if (this->m_LogText_OutputPort[0].isConnected()) {
628#if FW_OBJECT_NAMES == 1
629 const char* _formatString =
630 "(%s) %s: Error configuring SPI device %" PRIi32
".%" PRIi32
": %" PRIi32
"";
632 const char* _formatString =
633 "%s: Error configuring SPI device %" PRIi32
".%" PRIi32
": %" PRIi32
"";
640 this->m_objName.toChar(),
648 this->m_LogText_OutputPort[0].invoke(
658 void LinuxSpiDriverComponentBase ::
659 log_WARNING_HI_SPI_WriteError(
666 if (this->m_SPI_WriteErrorThrottle >= EVENTID_SPI_WRITEERROR_THROTTLE) {
670 this->m_SPI_WriteErrorThrottle++;
675 if (this->m_Time_OutputPort[0].isConnected()) {
676 this->m_Time_OutputPort[0].invoke(_logTime);
681 _id = this->getIdBase() + EVENTID_SPI_WRITEERROR;
684 if (this->m_Log_OutputPort[0].isConnected()) {
688#if FW_AMPCS_COMPATIBLE
697#if FW_AMPCS_COMPATIBLE
700 static_cast<U8>(
sizeof(I32))
713#if FW_AMPCS_COMPATIBLE
716 static_cast<U8>(
sizeof(I32))
729#if FW_AMPCS_COMPATIBLE
732 static_cast<U8>(
sizeof(I32))
745 this->m_Log_OutputPort[0].invoke(
754#if FW_ENABLE_TEXT_LOGGING
755 if (this->m_LogText_OutputPort[0].isConnected()) {
756#if FW_OBJECT_NAMES == 1
757 const char* _formatString =
758 "(%s) %s: Error writing/reading SPI device %" PRIi32
".%" PRIi32
": %" PRIi32
"";
760 const char* _formatString =
761 "%s: Error writing/reading SPI device %" PRIi32
".%" PRIi32
": %" PRIi32
"";
768 this->m_objName.toChar(),
776 this->m_LogText_OutputPort[0].invoke(
786 void LinuxSpiDriverComponentBase ::
787 log_ACTIVITY_HI_SPI_PortOpened(
794 if (this->m_Time_OutputPort[0].isConnected()) {
795 this->m_Time_OutputPort[0].invoke(_logTime);
800 _id = this->getIdBase() + EVENTID_SPI_PORTOPENED;
803 if (this->m_Log_OutputPort[0].isConnected()) {
807#if FW_AMPCS_COMPATIBLE
816#if FW_AMPCS_COMPATIBLE
819 static_cast<U8>(
sizeof(I32))
832#if FW_AMPCS_COMPATIBLE
835 static_cast<U8>(
sizeof(I32))
848 this->m_Log_OutputPort[0].invoke(
857#if FW_ENABLE_TEXT_LOGGING
858 if (this->m_LogText_OutputPort[0].isConnected()) {
859#if FW_OBJECT_NAMES == 1
860 const char* _formatString =
861 "(%s) %s: SPI Device %" PRIi32
".%" PRIi32
" configured";
863 const char* _formatString =
864 "%s: SPI Device %" PRIi32
".%" PRIi32
" configured";
871 this->m_objName.toChar(),
878 this->m_LogText_OutputPort[0].invoke(
892 void LinuxSpiDriverComponentBase ::
893 log_WARNING_HI_SPI_WriteError_ThrottleClear()
896 this->m_SPI_WriteErrorThrottle = 0;
903 void LinuxSpiDriverComponentBase ::
909 if (this->m_Tlm_OutputPort[0].isConnected()) {
911 this->m_Time_OutputPort[0].isConnected() &&
914 this->m_Time_OutputPort[0].invoke(_tlmTime);
926 _id = this->getIdBase() + CHANNELID_SPI_BYTES;
928 this->m_Tlm_OutputPort[0].invoke(
943 if (this->m_Time_OutputPort[0].isConnected()) {
945 this->m_Time_OutputPort[0].invoke(_time);
957 void LinuxSpiDriverComponentBase ::
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
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 LinuxSpiDriver component.
void SpiReadWrite_handlerBase(FwIndexType portNum, Fw::Buffer &writeBuffer, Fw::Buffer &readBuffer)
Handler base-class function for input port SpiReadWrite.
@ WARNING_HI
A serious but recoverable event.
@ ACTIVITY_HI
Important informational 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
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.