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;
302 static_cast<FwAssertArgType>(portNum)
305 return this->m_Log_OutputPort[portNum].
isConnected();
308 #if FW_ENABLE_TEXT_LOGGING == 1 310 bool LinuxSpiDriverComponentBase ::
311 isConnected_LogText_OutputPort(
FwIndexType portNum)
314 (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
315 static_cast<FwAssertArgType>(portNum)
318 return this->m_LogText_OutputPort[portNum].isConnected();
328 static_cast<FwAssertArgType>(portNum)
331 return this->m_Time_OutputPort[portNum].
isConnected();
339 static_cast<FwAssertArgType>(portNum)
342 return this->m_Tlm_OutputPort[portNum].
isConnected();
361 static_cast<FwAssertArgType>(portNum)
385 if (this->m_Time_OutputPort[0].isConnected()) {
386 this->m_Time_OutputPort[0].
invoke(_logTime);
394 if (this->m_Log_OutputPort[0].isConnected()) {
398 #if FW_AMPCS_COMPATIBLE 403 static_cast<FwAssertArgType>(_status)
407 #if FW_AMPCS_COMPATIBLE 410 static_cast<U8>(
sizeof(I32))
414 static_cast<FwAssertArgType>(_status)
420 static_cast<FwAssertArgType>(_status)
423 #if FW_AMPCS_COMPATIBLE 426 static_cast<U8>(
sizeof(I32))
430 static_cast<FwAssertArgType>(_status)
436 static_cast<FwAssertArgType>(_status)
439 #if FW_AMPCS_COMPATIBLE 442 static_cast<U8>(
sizeof(I32))
446 static_cast<FwAssertArgType>(_status)
452 static_cast<FwAssertArgType>(_status)
455 this->m_Log_OutputPort[0].
invoke(
464 #if FW_ENABLE_TEXT_LOGGING 465 if (this->m_LogText_OutputPort[0].isConnected()) {
466 #if FW_OBJECT_NAMES == 1 467 const char* _formatString =
468 "(%s) %s: Error opening SPI device %" PRIi32
".%" PRIi32
": %" PRIi32
"";
470 const char* _formatString =
471 "%s: Error opening SPI device %" PRIi32
".%" PRIi32
": %" PRIi32
"";
478 this->m_objName.toChar(),
486 this->m_LogText_OutputPort[0].invoke(
505 if (this->m_Time_OutputPort[0].isConnected()) {
506 this->m_Time_OutputPort[0].
invoke(_logTime);
514 if (this->m_Log_OutputPort[0].isConnected()) {
518 #if FW_AMPCS_COMPATIBLE 523 static_cast<FwAssertArgType>(_status)
527 #if FW_AMPCS_COMPATIBLE 530 static_cast<U8>(
sizeof(I32))
534 static_cast<FwAssertArgType>(_status)
540 static_cast<FwAssertArgType>(_status)
543 #if FW_AMPCS_COMPATIBLE 546 static_cast<U8>(
sizeof(I32))
550 static_cast<FwAssertArgType>(_status)
556 static_cast<FwAssertArgType>(_status)
559 #if FW_AMPCS_COMPATIBLE 562 static_cast<U8>(
sizeof(I32))
566 static_cast<FwAssertArgType>(_status)
572 static_cast<FwAssertArgType>(_status)
575 this->m_Log_OutputPort[0].
invoke(
584 #if FW_ENABLE_TEXT_LOGGING 585 if (this->m_LogText_OutputPort[0].isConnected()) {
586 #if FW_OBJECT_NAMES == 1 587 const char* _formatString =
588 "(%s) %s: Error configuring SPI device %" PRIi32
".%" PRIi32
": %" PRIi32
"";
590 const char* _formatString =
591 "%s: Error configuring SPI device %" PRIi32
".%" PRIi32
": %" PRIi32
"";
598 this->m_objName.toChar(),
606 this->m_LogText_OutputPort[0].invoke(
628 this->m_SPI_WriteErrorThrottle++;
633 if (this->m_Time_OutputPort[0].isConnected()) {
634 this->m_Time_OutputPort[0].
invoke(_logTime);
642 if (this->m_Log_OutputPort[0].isConnected()) {
646 #if FW_AMPCS_COMPATIBLE 651 static_cast<FwAssertArgType>(_status)
655 #if FW_AMPCS_COMPATIBLE 658 static_cast<U8>(
sizeof(I32))
662 static_cast<FwAssertArgType>(_status)
668 static_cast<FwAssertArgType>(_status)
671 #if FW_AMPCS_COMPATIBLE 674 static_cast<U8>(
sizeof(I32))
678 static_cast<FwAssertArgType>(_status)
684 static_cast<FwAssertArgType>(_status)
687 #if FW_AMPCS_COMPATIBLE 690 static_cast<U8>(
sizeof(I32))
694 static_cast<FwAssertArgType>(_status)
700 static_cast<FwAssertArgType>(_status)
703 this->m_Log_OutputPort[0].
invoke(
712 #if FW_ENABLE_TEXT_LOGGING 713 if (this->m_LogText_OutputPort[0].isConnected()) {
714 #if FW_OBJECT_NAMES == 1 715 const char* _formatString =
716 "(%s) %s: Error writing/reading SPI device %" PRIi32
".%" PRIi32
": %" PRIi32
"";
718 const char* _formatString =
719 "%s: Error writing/reading SPI device %" PRIi32
".%" PRIi32
": %" PRIi32
"";
726 this->m_objName.toChar(),
734 this->m_LogText_OutputPort[0].invoke(
755 if (this->m_Time_OutputPort[0].isConnected()) {
756 this->m_Time_OutputPort[0].
invoke(_logTime);
764 if (this->m_Log_OutputPort[0].isConnected()) {
768 #if FW_AMPCS_COMPATIBLE 773 static_cast<FwAssertArgType>(_status)
777 #if FW_AMPCS_COMPATIBLE 780 static_cast<U8>(
sizeof(I32))
784 static_cast<FwAssertArgType>(_status)
790 static_cast<FwAssertArgType>(_status)
793 #if FW_AMPCS_COMPATIBLE 796 static_cast<U8>(
sizeof(I32))
800 static_cast<FwAssertArgType>(_status)
806 static_cast<FwAssertArgType>(_status)
812 static_cast<FwAssertArgType>(_status)
815 #if FW_AMPCS_COMPATIBLE 818 static_cast<U8>(
sizeof(U32))
822 static_cast<FwAssertArgType>(_status)
828 static_cast<FwAssertArgType>(_status)
831 #if FW_AMPCS_COMPATIBLE 834 static_cast<U8>(
sizeof(U32))
838 static_cast<FwAssertArgType>(_status)
844 static_cast<FwAssertArgType>(_status)
847 this->m_Log_OutputPort[0].
invoke(
856 #if FW_ENABLE_TEXT_LOGGING 857 if (this->m_LogText_OutputPort[0].isConnected()) {
858 #if FW_OBJECT_NAMES == 1 859 const char* _formatString =
860 "(%s) %s: SPI device %" PRIi32
".%" PRIi32
" configuration mismatch for %s: wrote %" PRIu32
", read %" PRIu32
"";
862 const char* _formatString =
863 "%s: SPI device %" PRIi32
".%" PRIi32
" configuration mismatch for %s: wrote %" PRIu32
", read %" PRIu32
"";
870 this->m_objName.toChar(),
872 "SPI_ConfigMismatch ",
880 this->m_LogText_OutputPort[0].invoke(
898 if (this->m_Time_OutputPort[0].isConnected()) {
899 this->m_Time_OutputPort[0].
invoke(_logTime);
907 if (this->m_Log_OutputPort[0].isConnected()) {
911 #if FW_AMPCS_COMPATIBLE 916 static_cast<FwAssertArgType>(_status)
920 #if FW_AMPCS_COMPATIBLE 923 static_cast<U8>(
sizeof(I32))
927 static_cast<FwAssertArgType>(_status)
933 static_cast<FwAssertArgType>(_status)
936 #if FW_AMPCS_COMPATIBLE 939 static_cast<U8>(
sizeof(I32))
943 static_cast<FwAssertArgType>(_status)
949 static_cast<FwAssertArgType>(_status)
952 this->m_Log_OutputPort[0].
invoke(
961 #if FW_ENABLE_TEXT_LOGGING 962 if (this->m_LogText_OutputPort[0].isConnected()) {
963 #if FW_OBJECT_NAMES == 1 964 const char* _formatString =
965 "(%s) %s: SPI Device %" PRIi32
".%" PRIi32
" configured";
967 const char* _formatString =
968 "%s: SPI Device %" PRIi32
".%" PRIi32
" configured";
975 this->m_objName.toChar(),
982 this->m_LogText_OutputPort[0].invoke(
1000 this->m_SPI_WriteErrorThrottle = 0;
1013 if (this->m_Tlm_OutputPort[0].isConnected()) {
1015 this->m_Time_OutputPort[0].isConnected() &&
1018 this->m_Time_OutputPort[0].
invoke(_tlmTime);
1025 static_cast<FwAssertArgType>(_stat)
1032 this->m_Tlm_OutputPort[0].
invoke(
1047 if (this->m_Time_OutputPort[0].isConnected()) {
1049 this->m_Time_OutputPort[0].
invoke(_time);
1061 void LinuxSpiDriverComponentBase ::
1062 m_p_SpiReadWrite_in(
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.
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
void log_WARNING_HI_SPI_ConfigError(I32 device, I32 select, I32 error) const
FwIdType getIdBase() const
PlatformSizeType FwSizeType
Throttle reset count for SPI_WriteError.
virtual void SpiReadWrite_handler(FwIndexType portNum, Fw::Buffer &writeBuffer, Fw::Buffer &readBuffer)=0
Handler for input port SpiReadWrite.
static constexpr FwIndexType getNum_Time_OutputPorts()
void log_WARNING_HI_SPI_WriteError(I32 device, I32 select, I32 error)
virtual const CHAR * toChar() const =0
Convert to a C-style char*.
void log_WARNING_LO_SPI_ConfigMismatch(I32 device, I32 select, const Fw::StringBase ¶meter, U32 write_value, U32 read_value) const
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.
static constexpr FwIndexType getNum_Tlm_OutputPorts()
SerializeStatus
forward declaration for string
bool isConnected_Tlm_OutputPort(FwIndexType portNum)
void log_WARNING_HI_SPI_WriteError_ThrottleClear()
Reset throttle value for SPI_WriteError.
FwIdType FwEventIdType
The type of an event identifier.
Channel ID for SPI_Bytes.
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
Convert to a C-style char*.
FwIdType FwChanIdType
The type of a telemetry channel identifier.
void log_ACTIVITY_HI_SPI_PortOpened(I32 device, I32 select) const
A serious but recoverable event.
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Invoke a port interface.
static constexpr FwIndexType getNum_SpiReadWrite_InputPorts()
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
static constexpr FwIndexType getNum_Log_OutputPorts()
void set_Tlm_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to Tlm[portNum].
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
void addCallPort(InputLogPort *callPort)
Register an input port.
SPI configuration mismatch.
Implementation of malloc based allocator.
SerializeStatus serializeTo(SerialBufferBase &buffer, Endianness mode=Endianness::BIG) const override
Serialize the contents of this object to a buffer.