10 #if FW_ENABLE_TEXT_LOGGING
32 this->m_SpiReadWrite_InputPort[port].
init();
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());
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());
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());
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());
141 return &this->m_SpiReadWrite_InputPort[portNum];
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);
191 this->m_Time_OutputPort[portNum].
addCallPort(port);
208 #if FW_PORT_SERIALIZATION
217 Fw::InputSerializePort* port
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);
249 Fw::InputSerializePort* port
257 this->m_Time_OutputPort[portNum].registerSerialPort(port);
263 Fw::InputSerializePort* port
271 this->m_Tlm_OutputPort[portNum].registerSerialPort(port);
282 Fw::PassiveComponentBase(compName)
284 this->m_SPI_WriteErrorThrottle = 0;
313 #if FW_ENABLE_TEXT_LOGGING == 1
316 getNum_LogText_OutputPorts()
const
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();
373 return this->m_Time_OutputPort[portNum].
isConnected();
384 return this->m_Tlm_OutputPort[portNum].
isConnected();
427 if (this->m_Time_OutputPort[0].isConnected()) {
428 this->m_Time_OutputPort[0].
invoke(_logTime);
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(
547 if (this->m_Time_OutputPort[0].isConnected()) {
548 this->m_Time_OutputPort[0].
invoke(_logTime);
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(
670 this->m_SPI_WriteErrorThrottle++;
675 if (this->m_Time_OutputPort[0].isConnected()) {
676 this->m_Time_OutputPort[0].
invoke(_logTime);
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(
794 if (this->m_Time_OutputPort[0].isConnected()) {
795 this->m_Time_OutputPort[0].
invoke(_logTime);
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(
896 this->m_SPI_WriteErrorThrottle = 0;
909 if (this->m_Tlm_OutputPort[0].isConnected()) {
911 this->m_Time_OutputPort[0].isConnected() &&
914 this->m_Time_OutputPort[0].
invoke(_tlmTime);
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)
Auto-generated base for LinuxSpiDriver component.
void log_WARNING_HI_SPI_WriteError(I32 device, I32 select, I32 error)
FwIndexType getNum_Log_OutputPorts() const
FwIndexType getNum_Tlm_OutputPorts() const
void set_Time_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
void set_Tlm_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to Tlm[portNum].
LinuxSpiDriverComponentBase(const char *compName="")
Construct LinuxSpiDriverComponentBase object.
void tlmWrite_SPI_Bytes(U32 arg, Fw::Time _tlmTime=Fw::Time())
@ EVENTID_SPI_WRITEERROR_THROTTLE
Throttle reset count for SPI_WriteError.
void log_WARNING_HI_SPI_WriteError_ThrottleClear()
Reset throttle value for SPI_WriteError.
Drv::InputSpiReadWritePort * get_SpiReadWrite_InputPort(FwIndexType portNum)
void log_WARNING_HI_SPI_ConfigError(I32 device, I32 select, I32 error)
@ EVENTID_SPI_OPENERROR
SPI open error.
@ EVENTID_SPI_CONFIGERROR
SPI config error.
@ EVENTID_SPI_WRITEERROR
SPI write error.
@ EVENTID_SPI_PORTOPENED
SPI open notification.
FwIndexType getNum_Time_OutputPorts() const
FwIndexType getNum_SpiReadWrite_InputPorts() const
bool isConnected_Tlm_OutputPort(FwIndexType portNum)
void log_ACTIVITY_HI_SPI_PortOpened(I32 device, I32 select)
@ CHANNELID_SPI_BYTES
Channel ID for SPI_Bytes.
bool isConnected_Log_OutputPort(FwIndexType portNum)
bool isConnected_Time_OutputPort(FwIndexType portNum)
virtual ~LinuxSpiDriverComponentBase()
Destroy LinuxSpiDriverComponentBase object.
virtual void SpiReadWrite_handler(FwIndexType portNum, Fw::Buffer &writeBuffer, Fw::Buffer &readBuffer)=0
Handler for input port SpiReadWrite.
void set_Log_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to Log[portNum].
void SpiReadWrite_handlerBase(FwIndexType portNum, Fw::Buffer &writeBuffer, Fw::Buffer &readBuffer)
Handler base-class function for input port SpiReadWrite.
void log_WARNING_HI_SPI_OpenError(I32 device, I32 select, I32 error)
@ 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.
void addCallPort(InputTlmPort *callPort)
Register an input port.
void init()
Initialization function.
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Invoke a port interface.
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.