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());
138 static_cast<FwAssertArgType>(portNum)
141 return &this->m_SpiReadWrite_InputPort[portNum];
156 static_cast<FwAssertArgType>(portNum)
162 #if FW_ENABLE_TEXT_LOGGING == 1 164 void LinuxSpiDriverComponentBase ::
165 set_LogText_OutputPort(
171 (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
172 static_cast<FwAssertArgType>(portNum)
175 this->m_LogText_OutputPort[portNum].addCallPort(port);
188 static_cast<FwAssertArgType>(portNum)
191 this->m_Time_OutputPort[portNum].
addCallPort(port);
202 static_cast<FwAssertArgType>(portNum)
208 #if FW_PORT_SERIALIZATION 217 Fw::InputSerializePort* port
222 static_cast<FwAssertArgType>(portNum)
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 (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
238 static_cast<FwAssertArgType>(portNum)
241 this->m_LogText_OutputPort[portNum].registerSerialPort(port);
249 Fw::InputSerializePort* port
254 static_cast<FwAssertArgType>(portNum)
257 this->m_Time_OutputPort[portNum].registerSerialPort(port);
263 Fw::InputSerializePort* port
268 static_cast<FwAssertArgType>(portNum)
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 344 static_cast<FwAssertArgType>(portNum)
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 (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
357 static_cast<FwAssertArgType>(portNum)
360 return this->m_LogText_OutputPort[portNum].isConnected();
370 static_cast<FwAssertArgType>(portNum)
373 return this->m_Time_OutputPort[portNum].
isConnected();
381 static_cast<FwAssertArgType>(portNum)
384 return this->m_Tlm_OutputPort[portNum].
isConnected();
403 static_cast<FwAssertArgType>(portNum)
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 445 static_cast<FwAssertArgType>(_status)
449 #if FW_AMPCS_COMPATIBLE 452 static_cast<U8>(
sizeof(I32))
456 static_cast<FwAssertArgType>(_status)
462 static_cast<FwAssertArgType>(_status)
465 #if FW_AMPCS_COMPATIBLE 468 static_cast<U8>(
sizeof(I32))
472 static_cast<FwAssertArgType>(_status)
478 static_cast<FwAssertArgType>(_status)
481 #if FW_AMPCS_COMPATIBLE 484 static_cast<U8>(
sizeof(I32))
488 static_cast<FwAssertArgType>(_status)
494 static_cast<FwAssertArgType>(_status)
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 565 static_cast<FwAssertArgType>(_status)
569 #if FW_AMPCS_COMPATIBLE 572 static_cast<U8>(
sizeof(I32))
576 static_cast<FwAssertArgType>(_status)
582 static_cast<FwAssertArgType>(_status)
585 #if FW_AMPCS_COMPATIBLE 588 static_cast<U8>(
sizeof(I32))
592 static_cast<FwAssertArgType>(_status)
598 static_cast<FwAssertArgType>(_status)
601 #if FW_AMPCS_COMPATIBLE 604 static_cast<U8>(
sizeof(I32))
608 static_cast<FwAssertArgType>(_status)
614 static_cast<FwAssertArgType>(_status)
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 (void) this->m_SPI_WriteErrorThrottle.fetch_add(1);
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 693 static_cast<FwAssertArgType>(_status)
697 #if FW_AMPCS_COMPATIBLE 700 static_cast<U8>(
sizeof(I32))
704 static_cast<FwAssertArgType>(_status)
710 static_cast<FwAssertArgType>(_status)
713 #if FW_AMPCS_COMPATIBLE 716 static_cast<U8>(
sizeof(I32))
720 static_cast<FwAssertArgType>(_status)
726 static_cast<FwAssertArgType>(_status)
729 #if FW_AMPCS_COMPATIBLE 732 static_cast<U8>(
sizeof(I32))
736 static_cast<FwAssertArgType>(_status)
742 static_cast<FwAssertArgType>(_status)
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(
797 if (this->m_Time_OutputPort[0].isConnected()) {
798 this->m_Time_OutputPort[0].
invoke(_logTime);
806 if (this->m_Log_OutputPort[0].isConnected()) {
810 #if FW_AMPCS_COMPATIBLE 815 static_cast<FwAssertArgType>(_status)
819 #if FW_AMPCS_COMPATIBLE 822 static_cast<U8>(
sizeof(I32))
826 static_cast<FwAssertArgType>(_status)
832 static_cast<FwAssertArgType>(_status)
835 #if FW_AMPCS_COMPATIBLE 838 static_cast<U8>(
sizeof(I32))
842 static_cast<FwAssertArgType>(_status)
848 static_cast<FwAssertArgType>(_status)
854 static_cast<FwAssertArgType>(_status)
857 #if FW_AMPCS_COMPATIBLE 860 static_cast<U8>(
sizeof(U32))
864 static_cast<FwAssertArgType>(_status)
870 static_cast<FwAssertArgType>(_status)
873 #if FW_AMPCS_COMPATIBLE 876 static_cast<U8>(
sizeof(U32))
880 static_cast<FwAssertArgType>(_status)
886 static_cast<FwAssertArgType>(_status)
889 this->m_Log_OutputPort[0].
invoke(
898 #if FW_ENABLE_TEXT_LOGGING 899 if (this->m_LogText_OutputPort[0].isConnected()) {
900 #if FW_OBJECT_NAMES == 1 901 const char* _formatString =
902 "(%s) %s: SPI device %" PRIi32
".%" PRIi32
" configuration mismatch for %s: wrote %" PRIu32
", read %" PRIu32
"";
904 const char* _formatString =
905 "%s: SPI device %" PRIi32
".%" PRIi32
" configuration mismatch for %s: wrote %" PRIu32
", read %" PRIu32
"";
912 this->m_objName.toChar(),
914 "SPI_ConfigMismatch ",
922 this->m_LogText_OutputPort[0].invoke(
940 if (this->m_Time_OutputPort[0].isConnected()) {
941 this->m_Time_OutputPort[0].
invoke(_logTime);
949 if (this->m_Log_OutputPort[0].isConnected()) {
953 #if FW_AMPCS_COMPATIBLE 958 static_cast<FwAssertArgType>(_status)
962 #if FW_AMPCS_COMPATIBLE 965 static_cast<U8>(
sizeof(I32))
969 static_cast<FwAssertArgType>(_status)
975 static_cast<FwAssertArgType>(_status)
978 #if FW_AMPCS_COMPATIBLE 981 static_cast<U8>(
sizeof(I32))
985 static_cast<FwAssertArgType>(_status)
991 static_cast<FwAssertArgType>(_status)
994 this->m_Log_OutputPort[0].
invoke(
1003 #if FW_ENABLE_TEXT_LOGGING 1004 if (this->m_LogText_OutputPort[0].isConnected()) {
1005 #if FW_OBJECT_NAMES == 1 1006 const char* _formatString =
1007 "(%s) %s: SPI Device %" PRIi32
".%" PRIi32
" configured";
1009 const char* _formatString =
1010 "%s: SPI Device %" PRIi32
".%" PRIi32
" configured";
1017 this->m_objName.toChar(),
1024 this->m_LogText_OutputPort[0].invoke(
1042 this->m_SPI_WriteErrorThrottle = 0;
1055 if (this->m_Tlm_OutputPort[0].isConnected()) {
1057 this->m_Time_OutputPort[0].isConnected() &&
1060 this->m_Time_OutputPort[0].
invoke(_tlmTime);
1067 static_cast<FwAssertArgType>(_stat)
1074 this->m_Tlm_OutputPort[0].
invoke(
1089 if (this->m_Time_OutputPort[0].isConnected()) {
1091 this->m_Time_OutputPort[0].
invoke(_time);
1103 void LinuxSpiDriverComponentBase ::
1104 m_p_SpiReadWrite_in(
FwIndexType getNum_SpiReadWrite_InputPorts() const
void SpiReadWrite_handlerBase(FwIndexType portNum, Fw::Buffer &writeBuffer, Fw::Buffer &readBuffer)
Handler base-class function for input port SpiReadWrite.
Serialization/Deserialization operation was successful.
void addCallPort(InputTimePort *callPort)
Register an input port.
void log_WARNING_HI_SPI_ConfigError(I32 device, I32 select, I32 error) const
FwIdType getIdBase() const
PlatformSizeType FwSizeType
Throttle reset count for SPI_WriteError.
#define FW_LOG_STRING_MAX_SIZE
Max size of log string parameter type.
virtual void SpiReadWrite_handler(FwIndexType portNum, Fw::Buffer &writeBuffer, Fw::Buffer &readBuffer)=0
Handler for input port SpiReadWrite.
FwIndexType getNum_Log_OutputPorts() const
void log_WARNING_HI_SPI_WriteError(I32 device, I32 select, I32 error)
void log_WARNING_LO_SPI_ConfigMismatch(I32 device, I32 select, const Fw::StringBase ¶meter, U32 write_value, U32 read_value) const
Channel ID for SPI_Bytes.
void init()
Initialization function.
No time base has been established (Required)
virtual ~LinuxSpiDriverComponentBase()
Destroy LinuxSpiDriverComponentBase object.
void set_Time_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
void addCallPort(InputTlmPort *callPort)
Register an input port.
void init()
Object initializer.
SerializeStatus
forward declaration for string
bool isConnected_Tlm_OutputPort(FwIndexType portNum)
void log_WARNING_HI_SPI_WriteError_ThrottleClear()
Reset throttle value for SPI_WriteError.
FwIndexType getNum_Time_OutputPorts() const
FwIdType FwEventIdType
The type of an event identifier.
void tlmWrite_SPI_Bytes(FwSizeType arg, Fw::Time _tlmTime=Fw::Time()) const
Drv::InputSpiReadWritePort * get_SpiReadWrite_InputPort(FwIndexType portNum)
Auto-generated base for LinuxSpiDriver component.
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
void init()
Initialization function.
bool isConnected_Time_OutputPort(FwIndexType portNum)
#define FW_MIN(a, b)
MIN macro.
A less serious but recoverable event.
LinuxSpiDriverComponentBase(const char *compName="")
Construct LinuxSpiDriverComponentBase object.
void invoke(Fw::Time &time) const
Invoke a port interface.
const char * toChar() const
FwIdType FwChanIdType
The type of a telemetry channel identifier.
void log_ACTIVITY_HI_SPI_PortOpened(I32 device, I32 select) const
FwIndexType getNum_Tlm_OutputPorts() const
A serious but recoverable event.
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Invoke a port interface.
void set_Log_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to Log[portNum].
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
void init()
Initialization function.
void log_WARNING_HI_SPI_OpenError(I32 device, I32 select, I32 error) const
void set_Tlm_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to Tlm[portNum].
SerializeStatus serializeTo(SerializeBufferBase &buffer) const override
serialize contents to buffer
Important informational events.
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port interface.
bool isConnected_Log_OutputPort(FwIndexType portNum)
PlatformIndexType FwIndexType
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
void addCallPort(InputLogPort *callPort)
Register an input port.
SerializeStatus serializeFrom(U8 val)
serialize 8-bit unsigned int
virtual const CHAR * toChar() const =0
SPI configuration mismatch.