#include "temu-c/Support/Objsys.h"
#include "temu-c/Support/Buffer.h"
#include <assert.h>
#include <stdbool.h>
#include <stdint.h>
 
Go to the source code of this file.
 | 
| enum   | temu_SpwPacketType { teSMT_Data = 1, 
teSMT_Err = 2, 
teSMT_Time = 3
 } | 
|   | 
| enum   | temu_SpwLinkState {  
  teSPWLS_ErrorReset = 0, 
teSPWLS_ErrorWait = 1, 
teSPWLS_Ready = 2, 
teSPWLS_Started = 3, 
 
  teSPWLS_Connecting = 4, 
teSPWLS_Run = 5
 
 } | 
|   | 
| enum   | temu_SpwRmapPacketType { teSPWRMAPPT_Response = 0, 
teSPWRMAPPT_Command = 1, 
teSPWRMAPPT_Invalid = 2
 } | 
|   | 
| enum   | temu_SpwRmapCommandType { teSPWRMAPCT_Read = 0, 
teSPWRMAPCT_Write = 1, 
teSPWRMAPCT_Rmw = 2
 } | 
|   | 
| enum   | temu_SpwRmapDecodedPacketType {  
  teSPWRMAPDP_Invalid = 0, 
teSPWRMAPDP_ReadCmd = 1, 
teSPWRMAPDP_WriteCmd = 2, 
teSPWRMAPDP_RmwCmd = 3, 
 
  teSPWRMAPDP_ReadReply = 4, 
teSPWRMAPDP_WriteReply = 5, 
teSPWRMAPDP_RmwReply = 6
 
 } | 
|   | 
| enum   | temu_SpwRmapDecodingOutcome { teSPWRMAPDO_NoError = 0, 
teSPWRMAPDO_HeaderIncomplete = 1, 
teSPWRMAPDO_InvalidPacketType = 2
 } | 
|   | 
 | 
|   | TEMU_IFACE_REFERENCE_TYPE (temu_SpwPort) | 
|   | 
| void  | temu_spwLsmInit (temu_SpwLinkState *StatePtr) | 
|   | 
| uint8_t  | temu_spwLsmUpdate (temu_SpwLinkState *StatePtr, uint8_t AS, uint8_t LS, uint8_t LD, uint8_t PortConnect, temu_SpwLinkState otherSideLinkState) | 
|   | 
| const char *  | temu_spwLinkStateToStr (uint8_t linkState) | 
|   | 
| temu_SpwRmapDecodingOutcome  | temu_spwRmapDecodePacket (const temu_SpwPacket *Pkt, temu_SpwRmapDecodedPacket *PktDecoded) | 
|   | 
| temu_SpwRmapDecodingOutcome  | temu_spwRmapDecodeBuffer (const temu_Buff *PktDataBuffer, temu_SpwRmapDecodedPacket *PktDecoded) | 
|   | 
| uint32_t  | temu_spwRmapHeaderReplySize (const temu_SpwRmapDecodedPacket *DCmdPkt) | 
|   | 
| uint32_t  | temu_spwRmapEncodeReadReplyHeaderForPacket (const temu_SpwRmapDecodedPacket *DCmdPkt, uint8_t *Data, uint32_t AllocatedDataSize, uint8_t Status, uint32_t DataLength) | 
|   | 
| uint32_t  | temu_spwRmapEncodeRmwHeaderForPacket (const temu_SpwRmapDecodedPacket *DCmdPkt, uint8_t *Data, uint32_t AllocatedDataSize, uint8_t Status, uint32_t DataLength) | 
|   | 
| uint32_t  | temu_spwRmapEncodeWriteReplyHeaderForPacket (const temu_SpwRmapDecodedPacket *DCmdPkt, uint8_t *Data, uint32_t AllocatedDataSize, uint8_t Status) | 
|   | 
| uint8_t  | temu_spwRmapCRCNextCode (uint8_t InCRC, uint8_t InByte) | 
|   | 
| uint8_t  | temu_spwRmapCRC (const uint8_t *Data, uint32_t DataSize) | 
|   | 
◆ TEMU_SPW_BITS_PER_CTRL_CHAR
      
        
          | #define TEMU_SPW_BITS_PER_CTRL_CHAR   4 | 
        
      
 
 
◆ TEMU_SPW_BITS_PER_DATA_CHAR
      
        
          | #define TEMU_SPW_BITS_PER_DATA_CHAR   10 | 
        
      
 
 
◆ TEMU_SPW_EEP_BITS
◆ TEMU_SPW_EOP_BITS
◆ TEMU_SPW_ESC_BITS
◆ TEMU_SPW_FCT_BITS
◆ TEMU_SPW_FLAG_RMAP_DCRC_ERROR
      
        
          | #define TEMU_SPW_FLAG_RMAP_DCRC_ERROR   0x02 | 
        
      
 
 
◆ TEMU_SPW_FLAG_RMAP_HCRC_ERROR
      
        
          | #define TEMU_SPW_FLAG_RMAP_HCRC_ERROR   0x01 | 
        
      
 
 
◆ TEMU_SPW_LOGICAL_ADDRESS_DEFAULT
      
        
          | #define TEMU_SPW_LOGICAL_ADDRESS_DEFAULT   0xfe | 
        
      
 
 
◆ TEMU_SPW_PORT_IFACE_TYPE
      
        
          | #define TEMU_SPW_PORT_IFACE_TYPE   "SpwPortIface" | 
        
      
 
 
◆ TEMU_SPW_PROT_CCSDSPKT
      
        
          | #define TEMU_SPW_PROT_CCSDSPKT   2 | 
        
      
 
 
◆ TEMU_SPW_PROT_EXT
      
        
          | #define TEMU_SPW_PROT_EXT   0 | 
        
      
 
 
◆ TEMU_SPW_PROT_GOES_R
      
        
          | #define TEMU_SPW_PROT_GOES_R   238 | 
        
      
 
 
◆ TEMU_SPW_PROT_RMAP
      
        
          | #define TEMU_SPW_PROT_RMAP   1 | 
        
      
 
 
◆ TEMU_SPW_PROT_STUP
      
        
          | #define TEMU_SPW_PROT_STUP   239 | 
        
      
 
 
◆ TEMU_SPW_RMAP_INST_ACK
      
        
          | #define TEMU_SPW_RMAP_INST_ACK   0x8; | 
        
      
 
 
◆ TEMU_SPW_RMAP_INST_CMD
      
        
          | #define TEMU_SPW_RMAP_INST_CMD   0x40; | 
        
      
 
 
◆ TEMU_SPW_RMAP_INST_INC
      
        
          | #define TEMU_SPW_RMAP_INST_INC   0x4; | 
        
      
 
 
◆ TEMU_SPW_RMAP_INST_VERIFY
      
        
          | #define TEMU_SPW_RMAP_INST_VERIFY   0x10; | 
        
      
 
 
◆ TEMU_SPW_RMAP_INST_WRITE
      
        
          | #define TEMU_SPW_RMAP_INST_WRITE   0x20; | 
        
      
 
 
◆ temu_SpwPacket
◆ temu_SpwPortIface
◆ temu_SpwLinkState
| Enumerator | 
|---|
| teSPWLS_ErrorReset  |  | 
| teSPWLS_ErrorWait  |  | 
| teSPWLS_Ready  |  | 
| teSPWLS_Started  |  | 
| teSPWLS_Connecting  |  | 
| teSPWLS_Run  |  | 
 
 
◆ temu_SpwPacketType
This is the spacewire device modelling API. It provides an interface to be used for implementing routers, spacewire controllers and devices.
The spacewire device interface is EXPERIMENTAL at the moment. 
| Enumerator | 
|---|
| teSMT_Data  |  | 
| teSMT_Err  |  | 
| teSMT_Time  |  | 
 
 
◆ temu_SpwRmapCommandType
| Enumerator | 
|---|
| teSPWRMAPCT_Read  |  | 
| teSPWRMAPCT_Write  |  | 
| teSPWRMAPCT_Rmw  |  | 
 
 
◆ temu_SpwRmapDecodedPacketType
| Enumerator | 
|---|
| teSPWRMAPDP_Invalid  |  | 
| teSPWRMAPDP_ReadCmd  |  | 
| teSPWRMAPDP_WriteCmd  |  | 
| teSPWRMAPDP_RmwCmd  |  | 
| teSPWRMAPDP_ReadReply  |  | 
| teSPWRMAPDP_WriteReply  |  | 
| teSPWRMAPDP_RmwReply  |  | 
 
 
◆ temu_SpwRmapDecodingOutcome
| Enumerator | 
|---|
| teSPWRMAPDO_NoError  |  | 
| teSPWRMAPDO_HeaderIncomplete  |  | 
| teSPWRMAPDO_InvalidPacketType  |  | 
 
 
◆ temu_SpwRmapPacketType
| Enumerator | 
|---|
| teSPWRMAPPT_Response  |  | 
| teSPWRMAPPT_Command  |  | 
| teSPWRMAPPT_Invalid  |  | 
 
 
◆ TEMU_IFACE_REFERENCE_TYPE()
      
        
          | TEMU_IFACE_REFERENCE_TYPE  | 
          ( | 
          temu_SpwPort  | 
           | ) | 
           | 
        
      
 
 
◆ temu_spwLinkStateToStr()
      
        
          | const char* temu_spwLinkStateToStr  | 
          ( | 
          uint8_t  | 
          linkState | ) | 
           | 
        
      
 
Returns the string name for the link state. 
 
 
◆ temu_spwLsmInit()
Initialize the link state. 
 
 
◆ temu_spwLsmUpdate()
◆ temu_spwRmapCRC()
      
        
          | uint8_t temu_spwRmapCRC  | 
          ( | 
          const uint8_t *  | 
          Data,  | 
        
        
           | 
           | 
          uint32_t  | 
          DataSize  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Calculates the CRC over the specified data. 
 
 
◆ temu_spwRmapCRCNextCode()
      
        
          | uint8_t temu_spwRmapCRCNextCode  | 
          ( | 
          uint8_t  | 
          InCRC,  | 
        
        
           | 
           | 
          uint8_t  | 
          InByte  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Provided the previous calculated crc and a the current byte returns the next CRC value. 
 
 
◆ temu_spwRmapDecodeBuffer()
Provided a buffer containing a SpaceWire Rmap packet attempts to decode it. 
 
 
◆ temu_spwRmapDecodePacket()
Provided a SpaceWire Rmap packet attempts to decode it. 
 
 
◆ temu_spwRmapEncodeReadReplyHeaderForPacket()
      
        
          | uint32_t temu_spwRmapEncodeReadReplyHeaderForPacket  | 
          ( | 
          const temu_SpwRmapDecodedPacket *  | 
          DCmdPkt,  | 
        
        
           | 
           | 
          uint8_t *  | 
          Data,  | 
        
        
           | 
           | 
          uint32_t  | 
          AllocatedDataSize,  | 
        
        
           | 
           | 
          uint8_t  | 
          Status,  | 
        
        
           | 
           | 
          uint32_t  | 
          DataLength  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Encodes the reply for a read command. 
 
 
◆ temu_spwRmapEncodeRmwHeaderForPacket()
      
        
          | uint32_t temu_spwRmapEncodeRmwHeaderForPacket  | 
          ( | 
          const temu_SpwRmapDecodedPacket *  | 
          DCmdPkt,  | 
        
        
           | 
           | 
          uint8_t *  | 
          Data,  | 
        
        
           | 
           | 
          uint32_t  | 
          AllocatedDataSize,  | 
        
        
           | 
           | 
          uint8_t  | 
          Status,  | 
        
        
           | 
           | 
          uint32_t  | 
          DataLength  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Encodes the reply for a rmw command. 
 
 
◆ temu_spwRmapEncodeWriteReplyHeaderForPacket()
      
        
          | uint32_t temu_spwRmapEncodeWriteReplyHeaderForPacket  | 
          ( | 
          const temu_SpwRmapDecodedPacket *  | 
          DCmdPkt,  | 
        
        
           | 
           | 
          uint8_t *  | 
          Data,  | 
        
        
           | 
           | 
          uint32_t  | 
          AllocatedDataSize,  | 
        
        
           | 
           | 
          uint8_t  | 
          Status  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Encodes the reply for a write command. 
 
 
◆ temu_spwRmapHeaderReplySize()
Returns the total packet-size required to reply to the command.