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_SpiWriteRead_InputPort[port].
init();
61 this->m_SpiWriteRead_InputPort[port].
setPortNum(port);
63 #if FW_OBJECT_NAMES == 1 67 this->m_objName.toChar(),
70 this->m_SpiWriteRead_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_Tlm_OutputPort[port].
init();
141 #if FW_OBJECT_NAMES == 1 145 this->m_objName.toChar(),
148 this->m_Tlm_OutputPort[port].setObjName(portName.
toChar());
162 static_cast<FwAssertArgType>(portNum)
165 return &this->m_SpiReadWrite_InputPort[portNum];
173 static_cast<FwAssertArgType>(portNum)
176 return &this->m_SpiWriteRead_InputPort[portNum];
191 static_cast<FwAssertArgType>(portNum)
197 #if FW_ENABLE_TEXT_LOGGING == 1 199 void LinuxSpiDriverComponentBase ::
200 set_LogText_OutputPort(
206 (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
207 static_cast<FwAssertArgType>(portNum)
210 this->m_LogText_OutputPort[portNum].addCallPort(port);
223 static_cast<FwAssertArgType>(portNum)
226 this->m_Time_OutputPort[portNum].
addCallPort(port);
237 static_cast<FwAssertArgType>(portNum)
243 #if FW_PORT_SERIALIZATION 252 Fw::InputSerializePort* port
257 static_cast<FwAssertArgType>(portNum)
260 this->m_Log_OutputPort[portNum].registerSerialPort(port);
263 #if FW_ENABLE_TEXT_LOGGING == 1 265 void LinuxSpiDriverComponentBase ::
266 set_LogText_OutputPort(
268 Fw::InputSerializePort* port
272 (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
273 static_cast<FwAssertArgType>(portNum)
276 this->m_LogText_OutputPort[portNum].registerSerialPort(port);
284 Fw::InputSerializePort* port
289 static_cast<FwAssertArgType>(portNum)
292 this->m_Time_OutputPort[portNum].registerSerialPort(port);
298 Fw::InputSerializePort* port
303 static_cast<FwAssertArgType>(portNum)
306 this->m_Tlm_OutputPort[portNum].registerSerialPort(port);
317 Fw::PassiveComponentBase(compName)
319 this->m_SPI_WriteErrorThrottle = 0;
337 static_cast<FwAssertArgType>(portNum)
340 return this->m_Log_OutputPort[portNum].
isConnected();
343 #if FW_ENABLE_TEXT_LOGGING == 1 345 bool LinuxSpiDriverComponentBase ::
346 isConnected_LogText_OutputPort(
FwIndexType portNum)
349 (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
350 static_cast<FwAssertArgType>(portNum)
353 return this->m_LogText_OutputPort[portNum].isConnected();
363 static_cast<FwAssertArgType>(portNum)
366 return this->m_Time_OutputPort[portNum].
isConnected();
374 static_cast<FwAssertArgType>(portNum)
377 return this->m_Tlm_OutputPort[portNum].
isConnected();
396 static_cast<FwAssertArgType>(portNum)
417 static_cast<FwAssertArgType>(portNum)
451 if (this->m_Time_OutputPort[0].isConnected()) {
452 this->m_Time_OutputPort[0].
invoke(_logTime);
460 if (this->m_Log_OutputPort[0].isConnected()) {
464 #if FW_AMPCS_COMPATIBLE 469 static_cast<FwAssertArgType>(_status)
473 #if FW_AMPCS_COMPATIBLE 476 static_cast<U8>(
sizeof(I32))
480 static_cast<FwAssertArgType>(_status)
486 static_cast<FwAssertArgType>(_status)
489 #if FW_AMPCS_COMPATIBLE 492 static_cast<U8>(
sizeof(I32))
496 static_cast<FwAssertArgType>(_status)
502 static_cast<FwAssertArgType>(_status)
505 #if FW_AMPCS_COMPATIBLE 508 static_cast<U8>(
sizeof(I32))
512 static_cast<FwAssertArgType>(_status)
518 static_cast<FwAssertArgType>(_status)
521 this->m_Log_OutputPort[0].
invoke(
530 #if FW_ENABLE_TEXT_LOGGING 531 if (this->m_LogText_OutputPort[0].isConnected()) {
532 #if FW_OBJECT_NAMES == 1 533 const char* _formatString =
534 "(%s) %s: Error opening SPI device %" PRIi32
".%" PRIi32
": %" PRIi32
"";
536 const char* _formatString =
537 "%s: Error opening SPI device %" PRIi32
".%" PRIi32
": %" PRIi32
"";
544 this->m_objName.toChar(),
552 this->m_LogText_OutputPort[0].invoke(
571 if (this->m_Time_OutputPort[0].isConnected()) {
572 this->m_Time_OutputPort[0].
invoke(_logTime);
580 if (this->m_Log_OutputPort[0].isConnected()) {
584 #if FW_AMPCS_COMPATIBLE 589 static_cast<FwAssertArgType>(_status)
593 #if FW_AMPCS_COMPATIBLE 596 static_cast<U8>(
sizeof(I32))
600 static_cast<FwAssertArgType>(_status)
606 static_cast<FwAssertArgType>(_status)
609 #if FW_AMPCS_COMPATIBLE 612 static_cast<U8>(
sizeof(I32))
616 static_cast<FwAssertArgType>(_status)
622 static_cast<FwAssertArgType>(_status)
625 #if FW_AMPCS_COMPATIBLE 628 static_cast<U8>(
sizeof(I32))
632 static_cast<FwAssertArgType>(_status)
638 static_cast<FwAssertArgType>(_status)
641 this->m_Log_OutputPort[0].
invoke(
650 #if FW_ENABLE_TEXT_LOGGING 651 if (this->m_LogText_OutputPort[0].isConnected()) {
652 #if FW_OBJECT_NAMES == 1 653 const char* _formatString =
654 "(%s) %s: Error configuring SPI device %" PRIi32
".%" PRIi32
": %" PRIi32
"";
656 const char* _formatString =
657 "%s: Error configuring SPI device %" PRIi32
".%" PRIi32
": %" PRIi32
"";
664 this->m_objName.toChar(),
672 this->m_LogText_OutputPort[0].invoke(
694 this->m_SPI_WriteErrorThrottle++;
699 if (this->m_Time_OutputPort[0].isConnected()) {
700 this->m_Time_OutputPort[0].
invoke(_logTime);
708 if (this->m_Log_OutputPort[0].isConnected()) {
712 #if FW_AMPCS_COMPATIBLE 717 static_cast<FwAssertArgType>(_status)
721 #if FW_AMPCS_COMPATIBLE 724 static_cast<U8>(
sizeof(I32))
728 static_cast<FwAssertArgType>(_status)
734 static_cast<FwAssertArgType>(_status)
737 #if FW_AMPCS_COMPATIBLE 740 static_cast<U8>(
sizeof(I32))
744 static_cast<FwAssertArgType>(_status)
750 static_cast<FwAssertArgType>(_status)
753 #if FW_AMPCS_COMPATIBLE 756 static_cast<U8>(
sizeof(I32))
760 static_cast<FwAssertArgType>(_status)
766 static_cast<FwAssertArgType>(_status)
769 this->m_Log_OutputPort[0].
invoke(
778 #if FW_ENABLE_TEXT_LOGGING 779 if (this->m_LogText_OutputPort[0].isConnected()) {
780 #if FW_OBJECT_NAMES == 1 781 const char* _formatString =
782 "(%s) %s: Error writing/reading SPI device %" PRIi32
".%" PRIi32
": %" PRIi32
"";
784 const char* _formatString =
785 "%s: Error writing/reading SPI device %" PRIi32
".%" PRIi32
": %" PRIi32
"";
792 this->m_objName.toChar(),
800 this->m_LogText_OutputPort[0].invoke(
821 if (this->m_Time_OutputPort[0].isConnected()) {
822 this->m_Time_OutputPort[0].
invoke(_logTime);
830 if (this->m_Log_OutputPort[0].isConnected()) {
834 #if FW_AMPCS_COMPATIBLE 839 static_cast<FwAssertArgType>(_status)
843 #if FW_AMPCS_COMPATIBLE 846 static_cast<U8>(
sizeof(I32))
850 static_cast<FwAssertArgType>(_status)
856 static_cast<FwAssertArgType>(_status)
859 #if FW_AMPCS_COMPATIBLE 862 static_cast<U8>(
sizeof(I32))
866 static_cast<FwAssertArgType>(_status)
872 static_cast<FwAssertArgType>(_status)
878 static_cast<FwAssertArgType>(_status)
881 #if FW_AMPCS_COMPATIBLE 884 static_cast<U8>(
sizeof(U32))
888 static_cast<FwAssertArgType>(_status)
894 static_cast<FwAssertArgType>(_status)
897 #if FW_AMPCS_COMPATIBLE 900 static_cast<U8>(
sizeof(U32))
904 static_cast<FwAssertArgType>(_status)
910 static_cast<FwAssertArgType>(_status)
913 this->m_Log_OutputPort[0].
invoke(
922 #if FW_ENABLE_TEXT_LOGGING 923 if (this->m_LogText_OutputPort[0].isConnected()) {
924 #if FW_OBJECT_NAMES == 1 925 const char* _formatString =
926 "(%s) %s: SPI device %" PRIi32
".%" PRIi32
" configuration mismatch for %s: wrote %" PRIu32
", read %" PRIu32
"";
928 const char* _formatString =
929 "%s: SPI device %" PRIi32
".%" PRIi32
" configuration mismatch for %s: wrote %" PRIu32
", read %" PRIu32
"";
936 this->m_objName.toChar(),
938 "SPI_ConfigMismatch ",
946 this->m_LogText_OutputPort[0].invoke(
964 if (this->m_Time_OutputPort[0].isConnected()) {
965 this->m_Time_OutputPort[0].
invoke(_logTime);
973 if (this->m_Log_OutputPort[0].isConnected()) {
977 #if FW_AMPCS_COMPATIBLE 982 static_cast<FwAssertArgType>(_status)
986 #if FW_AMPCS_COMPATIBLE 989 static_cast<U8>(
sizeof(I32))
993 static_cast<FwAssertArgType>(_status)
999 static_cast<FwAssertArgType>(_status)
1002 #if FW_AMPCS_COMPATIBLE 1005 static_cast<U8>(
sizeof(I32))
1009 static_cast<FwAssertArgType>(_status)
1015 static_cast<FwAssertArgType>(_status)
1018 this->m_Log_OutputPort[0].
invoke(
1027 #if FW_ENABLE_TEXT_LOGGING 1028 if (this->m_LogText_OutputPort[0].isConnected()) {
1029 #if FW_OBJECT_NAMES == 1 1030 const char* _formatString =
1031 "(%s) %s: SPI Device %" PRIi32
".%" PRIi32
" configured";
1033 const char* _formatString =
1034 "%s: SPI Device %" PRIi32
".%" PRIi32
" configured";
1041 this->m_objName.toChar(),
1048 this->m_LogText_OutputPort[0].invoke(
1066 this->m_SPI_WriteErrorThrottle = 0;
1079 if (this->m_Tlm_OutputPort[0].isConnected()) {
1081 this->m_Time_OutputPort[0].isConnected() &&
1084 this->m_Time_OutputPort[0].
invoke(_tlmTime);
1091 static_cast<FwAssertArgType>(_stat)
1098 this->m_Tlm_OutputPort[0].
invoke(
1113 if (this->m_Time_OutputPort[0].isConnected()) {
1115 this->m_Time_OutputPort[0].
invoke(_time);
1133 this->m_guardedPortMutex.
lock();
1139 this->m_guardedPortMutex.
unLock();
1146 void LinuxSpiDriverComponentBase ::
1147 m_p_SpiReadWrite_in(
1164 m_p_SpiWriteRead_in(
1173 return compPtr->SpiWriteRead_handlerBase(
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
static constexpr FwIndexType getNum_SpiWriteRead_InputPorts()
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 unLock()
unlock the mutex and assert success
virtual void lock()
Lock the guarded mutex.
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.
virtual Drv::SpiStatus SpiWriteRead_handler(FwIndexType portNum, Fw::Buffer &writeBuffer, Fw::Buffer &readBuffer)=0
Handler for input port SpiWriteRead.
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.
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
SPI configuration mismatch.
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()
virtual void unLock()
Unlock the guarded mutex.
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()
Drv::SpiStatus SpiWriteRead_handlerBase(FwIndexType portNum, Fw::Buffer &writeBuffer, Fw::Buffer &readBuffer)
Handler base-class function for input port SpiWriteRead.
Drv::InputSpiWriteReadPort * get_SpiWriteRead_InputPort(FwIndexType portNum)
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.
Throttle reset count for SPI_WriteError.
bool isConnected_Log_OutputPort(FwIndexType portNum)
PlatformIndexType FwIndexType
void addCallPort(InputLogPort *callPort)
Register an input port.
Channel ID for SPI_Bytes.
Implementation of malloc based allocator.
void lock()
lock the mutex and assert success
SerializeStatus serializeTo(SerialBufferBase &buffer, Endianness mode=Endianness::BIG) const override
Serialize the contents of this object to a buffer.