45 #ifndef __S2LP_PKT_COMMON_H 46 #define __S2LP_PKT_COMMON_H 134 #define S2LPSetPreambleLengthByte(xPreambleLength) S2LPSetPreambleLength(4*xPreambleLength) 135 #define S2LPSetSyncLengthByte(cSyncLength) S2LPSetSyncLength(8*cSyncLength) 137 #define IS_PREAMBLE_LEN(VAL) (VAL<=1024) 138 #define IS_SYNC_LEN(VAL) (VAL<=64) 140 #define IS_PKT_LEN_FIELD_WID(LENGTH) ((LENGTH == PKT_LENGTH_FIELD_1BYTE) || \ 141 (LENGTH == PKT_LENGTH_FIELD_2BYTE)) 144 #define IS_PKT_CRC_MODE(MODE) ((MODE == PKT_NO_CRC) || \ 145 (MODE == PKT_CRC_MODE_8BITS) || \ 146 (MODE == PKT_CRC_MODE_16BITS_1) || \ 147 (MODE == PKT_CRC_MODE_16BITS_2) || \ 148 (MODE == PKT_CRC_MODE_24BITS))
void S2LPPacketHandler3OutOf6(SFunctionalState xNewState)
Enable or Disable the 3o6 encoding.
uint8_t S2LPPacketHandlerGetTransmittedSeqNumber(void)
Returns the sequence number of the transmitted packet.
void S2LPPacketHandlerSetExtendedLenField(SFunctionalState xExtendedLenField)
Set the extended length field in case of variable length.
void S2LPPacketHandlerSwapPreamblePattern(SFunctionalState xEnableSwap)
Swap preamble pattern.
void S2LPPacketHandlerSetAutoPcktFilter(SFunctionalState xNewState)
Enable or Disable the auto packet filter mechanisms.
DirectTx S2LPPacketHandlerGetTxMode(void)
Return the DirectRF TX mode of S2LP.
void S2LPSetMyAddress(uint8_t address)
Set the MY_ADDRESS (source address that will be transmitted).
void S2LPPacketHandlerSetTxMode(DirectTx xNewState)
Set the TX mode of S2LP.
SFunctionalState
S2LP Functional state. Used to enable or disable a specific option.
void S2LPSetPreambleLength(uint16_t cPreambleLength)
Set the PREAMBLE field Length mode for S2LP packets.
void S2LPGetDualSyncWords(uint32_t *lSyncWords)
Get the secondary sync word.
uint8_t S2LPGetSyncLength(void)
Return the SYNC field Length for S2LP packets.
void S2LPSetDualSyncWords(uint32_t lSyncWords)
Set the secondary sync word.
void S2LPPacketHandlerSelectSecondarySync(SFunctionalState xSecondarySync)
Select the secondary sync mode. In TX if enabled: it will send the secondary sync word (from the PCKT...
uint8_t S2LPGetReceivedDestinationAddress(void)
Get the received destination address.
void S2LPSetSyncWords(uint32_t lSyncWords, uint8_t xSyncLength)
Set the SYNC_WORD.
void S2LPSetBroadcastAddress(uint8_t address)
Set the BROADCAST_ADDRESS set on the chip.
void S2LPGetSyncWords(uint32_t *lSyncWords, uint8_t *cSyncLength)
Get the SYNC_WORD.
uint16_t S2LPGetPreambleLength(void)
Return the PREAMBLE field Length mode for S2LP packets.
void S2LPPktCommonFilterOnCrc(SFunctionalState xNewState)
Enable or Disable the filtering on CRC.
void S2LPPacketHandlerManchester(SFunctionalState xNewState)
Enable or Disable the MANCHESTER encoding.
This file contains all the registers address and masks.
void S2LPPacketHandlerSetRxMode(DirectRx xNewState)
Set the DirectRF RX mode of S2LP.
DirectTx
Direct transmission mode enumeration for SPIRIT.
uint8_t S2LPGetMulticastAddress(void)
Get the MULTICAST_ADDRESS set on the chip.
void S2LPPacketHandlerWhitening(SFunctionalState xNewState)
Enable or Disable WHITENING for S2LP packets.
void S2LPSetMulticastAddress(uint8_t address)
Set the MULTICAST_ADDRESS set on the chip.
void S2LPPacketHandlerSwap4FSKSymbol(SFunctionalState xSwapSymbol)
Swap the 4FSK symbol mapping.
uint8_t S2LPGetRxSourceMask(void)
Get the SOURCE_MASK set on the chip.
uint8_t S2LPGetReceivedSourceAddress(void)
Get the received source address.
uint8_t S2LPGetMyAddress(void)
Get the MY_ADDRESS set on the chip.
DirectRx S2LPPacketHandlerGetRxMode(void)
Return the DirectRF RX mode of S2LP.
PktCrcMode S2LPPacketHandlerGetCrcMode(void)
Get the CRC mode.
PktCrcMode
CRC length in bytes enumeration.
uint8_t S2LPGetBroadcastAddress(void)
Get the BROADCAST_ADDRESS set on the chip.
void S2LPSetRxSourceMask(uint8_t address)
Set the SOURCE_MASK .
void S2LPPacketHandlerFec(SFunctionalState xNewState)
Enable or Disable the FEC encoding.
uint8_t S2LPGetRxSourceReferenceAddress(void)
Get the SOURCE_REFERENCE set on the chip.
void S2LPPacketHandlerSetSrcAddrFlt(SFunctionalState xNewState)
Set the source address filtering.
void S2LPPacketHandlerSetCrcMode(PktCrcMode xPktCrcMode)
Set the CRC mode.
uint8_t S2LPGetPacketFormat(void)
Get the packet format.
Header file for S2-LP types.
DirectRx
Direct receive mode enumeration for SPIRIT.
void S2LPSetRxSourceReferenceAddress(uint8_t address)
Set the SOURCE_REFERENCEK.
void S2LPPacketHandlerSetVariableLength(SFunctionalState xVarLen)
Set the variable length mode.
void S2LPPacketHandlerSwapFifoEndianess(SFunctionalState xEnableSwap)
Change the FIFO endianness .
void S2LPSetSyncLength(uint8_t cSyncLength)
Set the SYNC field Length for S2LP packets.
void S2LPPacketHandlerSetRxPersistentMode(SFunctionalState xNewState)
Set the RX persistent mode. The device will be ever in RX unles an abort command comes.