10 #if FW_ENABLE_TEXT_LOGGING 26 #if !FW_DIRECT_PORT_CALLS 33 this->m_SpiReadWrite_InputPort[port].
init();
38 this->m_SpiReadWrite_InputPort[port].
setPortNum(port);
40 #if FW_OBJECT_NAMES == 1 44 this->m_objName.toChar(),
47 this->m_SpiReadWrite_InputPort[port].setObjName(portName.
toChar());
52 #if !FW_DIRECT_PORT_CALLS 59 this->m_SpiWriteRead_InputPort[port].
init();
64 this->m_SpiWriteRead_InputPort[port].
setPortNum(port);
66 #if FW_OBJECT_NAMES == 1 70 this->m_objName.toChar(),
73 this->m_SpiWriteRead_InputPort[port].setObjName(portName.
toChar());
78 #if !FW_DIRECT_PORT_CALLS 85 this->m_Log_OutputPort[port].
init();
87 #if FW_OBJECT_NAMES == 1 91 this->m_objName.toChar(),
94 this->m_Log_OutputPort[port].setObjName(portName.
toChar());
99 #if !FW_DIRECT_PORT_CALLS && FW_ENABLE_TEXT_LOGGING 103 port < static_cast<FwIndexType>(this->getNum_LogText_OutputPorts());
106 this->m_LogText_OutputPort[port].
init();
108 #if FW_OBJECT_NAMES == 1 112 this->m_objName.toChar(),
115 this->m_LogText_OutputPort[port].setObjName(portName.
toChar());
120 #if !FW_DIRECT_PORT_CALLS 127 this->m_Time_OutputPort[port].
init();
129 #if FW_OBJECT_NAMES == 1 133 this->m_objName.toChar(),
136 this->m_Time_OutputPort[port].setObjName(portName.
toChar());
141 #if !FW_DIRECT_PORT_CALLS 148 this->m_Tlm_OutputPort[port].
init();
150 #if FW_OBJECT_NAMES == 1 154 this->m_objName.toChar(),
157 this->m_Tlm_OutputPort[port].setObjName(portName.
toChar());
163 #if !FW_DIRECT_PORT_CALLS 174 static_cast<FwAssertArgType>(portNum)
177 return &this->m_SpiReadWrite_InputPort[portNum];
185 static_cast<FwAssertArgType>(portNum)
188 return &this->m_SpiWriteRead_InputPort[portNum];
193 #if !FW_DIRECT_PORT_CALLS 207 static_cast<FwAssertArgType>(portNum)
213 #if FW_ENABLE_TEXT_LOGGING == 1 215 void LinuxSpiDriverComponentBase ::
216 set_LogText_OutputPort(
222 (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
223 static_cast<FwAssertArgType>(portNum)
226 this->m_LogText_OutputPort[portNum].addCallPort(port);
239 static_cast<FwAssertArgType>(portNum)
242 this->m_Time_OutputPort[portNum].
addCallPort(port);
253 static_cast<FwAssertArgType>(portNum)
261 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION 270 Fw::InputSerializePort* port
275 static_cast<FwAssertArgType>(portNum)
278 this->m_Log_OutputPort[portNum].registerSerialPort(port);
281 #if FW_ENABLE_TEXT_LOGGING == 1 283 void LinuxSpiDriverComponentBase ::
284 set_LogText_OutputPort(
286 Fw::InputSerializePort* port
290 (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
291 static_cast<FwAssertArgType>(portNum)
294 this->m_LogText_OutputPort[portNum].registerSerialPort(port);
302 Fw::InputSerializePort* port
307 static_cast<FwAssertArgType>(portNum)
310 this->m_Time_OutputPort[portNum].registerSerialPort(port);
316 Fw::InputSerializePort* port
321 static_cast<FwAssertArgType>(portNum)
324 this->m_Tlm_OutputPort[portNum].registerSerialPort(port);
335 Fw::PassiveComponentBase(compName)
337 this->m_SPI_WriteErrorThrottle = 0;
346 #if !FW_DIRECT_PORT_CALLS 357 static_cast<FwAssertArgType>(portNum)
360 return this->m_Log_OutputPort[portNum].
isConnected();
363 #if FW_ENABLE_TEXT_LOGGING == 1 365 bool LinuxSpiDriverComponentBase ::
366 isConnected_LogText_OutputPort(
FwIndexType portNum)
const 369 (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
370 static_cast<FwAssertArgType>(portNum)
373 return this->m_LogText_OutputPort[portNum].isConnected();
383 static_cast<FwAssertArgType>(portNum)
386 return this->m_Time_OutputPort[portNum].
isConnected();
394 static_cast<FwAssertArgType>(portNum)
397 return this->m_Tlm_OutputPort[portNum].
isConnected();
418 static_cast<FwAssertArgType>(portNum)
439 static_cast<FwAssertArgType>(portNum)
474 this->Time_out(0, _logTime);
484 #if FW_AMPCS_COMPATIBLE 489 static_cast<FwAssertArgType>(_status)
493 #if FW_AMPCS_COMPATIBLE 496 static_cast<U8>(
sizeof(I32))
500 static_cast<FwAssertArgType>(_status)
506 static_cast<FwAssertArgType>(_status)
509 #if FW_AMPCS_COMPATIBLE 512 static_cast<U8>(
sizeof(I32))
516 static_cast<FwAssertArgType>(_status)
522 static_cast<FwAssertArgType>(_status)
525 #if FW_AMPCS_COMPATIBLE 528 static_cast<U8>(
sizeof(I32))
532 static_cast<FwAssertArgType>(_status)
538 static_cast<FwAssertArgType>(_status)
551 #if FW_ENABLE_TEXT_LOGGING 552 if (this->isConnected_LogText_OutputPort(0)) {
553 #if FW_OBJECT_NAMES == 1 554 const char* _formatString =
555 "(%s) %s: Error opening SPI device %" PRIi32
".%" PRIi32
": %" PRIi32
"";
557 const char* _formatString =
558 "%s: Error opening SPI device %" PRIi32
".%" PRIi32
": %" PRIi32
"";
565 this->m_objName.toChar(),
594 this->Time_out(0, _logTime);
604 #if FW_AMPCS_COMPATIBLE 609 static_cast<FwAssertArgType>(_status)
613 #if FW_AMPCS_COMPATIBLE 616 static_cast<U8>(
sizeof(I32))
620 static_cast<FwAssertArgType>(_status)
626 static_cast<FwAssertArgType>(_status)
629 #if FW_AMPCS_COMPATIBLE 632 static_cast<U8>(
sizeof(I32))
636 static_cast<FwAssertArgType>(_status)
642 static_cast<FwAssertArgType>(_status)
645 #if FW_AMPCS_COMPATIBLE 648 static_cast<U8>(
sizeof(I32))
652 static_cast<FwAssertArgType>(_status)
658 static_cast<FwAssertArgType>(_status)
671 #if FW_ENABLE_TEXT_LOGGING 672 if (this->isConnected_LogText_OutputPort(0)) {
673 #if FW_OBJECT_NAMES == 1 674 const char* _formatString =
675 "(%s) %s: Error configuring SPI device %" PRIi32
".%" PRIi32
": %" PRIi32
"";
677 const char* _formatString =
678 "%s: Error configuring SPI device %" PRIi32
".%" PRIi32
": %" PRIi32
"";
685 this->m_objName.toChar(),
716 this->m_SPI_WriteErrorThrottle++;
722 this->Time_out(0, _logTime);
732 #if FW_AMPCS_COMPATIBLE 737 static_cast<FwAssertArgType>(_status)
741 #if FW_AMPCS_COMPATIBLE 744 static_cast<U8>(
sizeof(I32))
748 static_cast<FwAssertArgType>(_status)
754 static_cast<FwAssertArgType>(_status)
757 #if FW_AMPCS_COMPATIBLE 760 static_cast<U8>(
sizeof(I32))
764 static_cast<FwAssertArgType>(_status)
770 static_cast<FwAssertArgType>(_status)
773 #if FW_AMPCS_COMPATIBLE 776 static_cast<U8>(
sizeof(I32))
780 static_cast<FwAssertArgType>(_status)
786 static_cast<FwAssertArgType>(_status)
799 #if FW_ENABLE_TEXT_LOGGING 800 if (this->isConnected_LogText_OutputPort(0)) {
801 #if FW_OBJECT_NAMES == 1 802 const char* _formatString =
803 "(%s) %s: Error writing/reading SPI device %" PRIi32
".%" PRIi32
": %" PRIi32
"";
805 const char* _formatString =
806 "%s: Error writing/reading SPI device %" PRIi32
".%" PRIi32
": %" PRIi32
"";
813 this->m_objName.toChar(),
844 this->Time_out(0, _logTime);
854 #if FW_AMPCS_COMPATIBLE 859 static_cast<FwAssertArgType>(_status)
863 #if FW_AMPCS_COMPATIBLE 866 static_cast<U8>(
sizeof(I32))
870 static_cast<FwAssertArgType>(_status)
876 static_cast<FwAssertArgType>(_status)
879 #if FW_AMPCS_COMPATIBLE 882 static_cast<U8>(
sizeof(I32))
886 static_cast<FwAssertArgType>(_status)
892 static_cast<FwAssertArgType>(_status)
901 static_cast<FwAssertArgType>(_status)
904 #if FW_AMPCS_COMPATIBLE 907 static_cast<U8>(
sizeof(U32))
911 static_cast<FwAssertArgType>(_status)
917 static_cast<FwAssertArgType>(_status)
920 #if FW_AMPCS_COMPATIBLE 923 static_cast<U8>(
sizeof(U32))
927 static_cast<FwAssertArgType>(_status)
933 static_cast<FwAssertArgType>(_status)
946 #if FW_ENABLE_TEXT_LOGGING 947 if (this->isConnected_LogText_OutputPort(0)) {
948 #if FW_OBJECT_NAMES == 1 949 const char* _formatString =
950 "(%s) %s: SPI device %" PRIi32
".%" PRIi32
" configuration mismatch for %s: wrote %" PRIu32
", read %" PRIu32
"";
952 const char* _formatString =
953 "%s: SPI device %" PRIi32
".%" PRIi32
" configuration mismatch for %s: wrote %" PRIu32
", read %" PRIu32
"";
960 this->m_objName.toChar(),
962 "SPI_ConfigMismatch ",
990 this->Time_out(0, _logTime);
1000 #if FW_AMPCS_COMPATIBLE 1005 static_cast<FwAssertArgType>(_status)
1009 #if FW_AMPCS_COMPATIBLE 1012 static_cast<U8>(
sizeof(I32))
1016 static_cast<FwAssertArgType>(_status)
1022 static_cast<FwAssertArgType>(_status)
1025 #if FW_AMPCS_COMPATIBLE 1028 static_cast<U8>(
sizeof(I32))
1032 static_cast<FwAssertArgType>(_status)
1038 static_cast<FwAssertArgType>(_status)
1051 #if FW_ENABLE_TEXT_LOGGING 1052 if (this->isConnected_LogText_OutputPort(0)) {
1053 #if FW_OBJECT_NAMES == 1 1054 const char* _formatString =
1055 "(%s) %s: SPI Device %" PRIi32
".%" PRIi32
" configured";
1057 const char* _formatString =
1058 "%s: SPI Device %" PRIi32
".%" PRIi32
" configured";
1065 this->m_objName.toChar(),
1091 this->m_SPI_WriteErrorThrottle = 0;
1110 this->Time_out(0, _tlmTime);
1140 static_cast<FwAssertArgType>(_stat)
1160 this->Time_out(0, _time);
1178 this->m_guardedPortMutex.
lock();
1184 this->m_guardedPortMutex.
unLock();
1191 void LinuxSpiDriverComponentBase ::
1192 m_p_SpiReadWrite_in(
1209 m_p_SpiWriteRead_in(
1218 return compPtr->SpiWriteRead_handlerBase(
1225 #if !FW_DIRECT_PORT_CALLS 1231 void LinuxSpiDriverComponentBase ::
1242 static_cast<FwAssertArgType>(portNum)
1246 this->m_Log_OutputPort[portNum].isConnected(),
1247 static_cast<FwAssertArgType>(portNum)
1249 this->m_Log_OutputPort[portNum].
invoke(
1257 #if FW_ENABLE_TEXT_LOGGING 1259 void LinuxSpiDriverComponentBase ::
1269 (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
1270 static_cast<FwAssertArgType>(portNum)
1274 this->m_LogText_OutputPort[portNum].isConnected(),
1275 static_cast<FwAssertArgType>(portNum)
1277 this->m_LogText_OutputPort[portNum].invoke(
1287 void LinuxSpiDriverComponentBase ::
1295 static_cast<FwAssertArgType>(portNum)
1299 this->m_Time_OutputPort[portNum].isConnected(),
1300 static_cast<FwAssertArgType>(portNum)
1302 this->m_Time_OutputPort[portNum].
invoke(
1307 void LinuxSpiDriverComponentBase ::
1317 static_cast<FwAssertArgType>(portNum)
1321 this->m_Tlm_OutputPort[portNum].isConnected(),
1322 static_cast<FwAssertArgType>(portNum)
1324 this->m_Tlm_OutputPort[portNum].
invoke(
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()
bool isConnected_Time_OutputPort(FwIndexType portNum) const
Channel ID for SPI_Bytes.
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
void log_WARNING_HI_SPI_WriteError_ThrottleClear()
Reset throttle value for SPI_WriteError.
bool isConnected_Tlm_OutputPort(FwIndexType portNum) 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.
#define FW_MIN(a, b)
MIN macro (deprecated in C++, use std::min)
Throttle reset count for SPI_WriteError.
A less serious but recoverable event.
LinuxSpiDriverComponentBase(const char *compName="")
Construct LinuxSpiDriverComponentBase object.
void invoke(Fw::Time &time) const
Invoke a port connection.
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.
bool isConnected_Log_OutputPort(FwIndexType portNum) const
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Invoke a port connection.
static constexpr FwIndexType getNum_SpiReadWrite_InputPorts()
Enum representing event severity.
void tlmWrite(FwChanIdType id, Fw::TlmBuffer &_tlmBuff, Fw::Time _tlmTime=Fw::Time()) const
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 connection.
PlatformIndexType FwIndexType
void addCallPort(InputLogPort *callPort)
Register an input port.
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.