Appiko
S2LP_PktStack.h
Go to the documentation of this file.
1 
75 /* Define to prevent recursive inclusion -------------------------------------*/
76 #ifndef __S2LP_PKT_STACK_H
77 #define __S2LP_PKT_STACK_H
78 
79 /* Includes ------------------------------------------------------------------*/
80 
81 #include "S2LP_Regs.h"
82 #include "S2LP_Types.h"
83 #include "S2LP_PacketHandler.h"
84 
85 #ifdef __cplusplus
86  extern "C" {
87 #endif
88 
89 
113 
114 
118 typedef struct {
119  uint16_t xPreambleLength;
120  uint8_t xSyncLength;
121  uint32_t lSyncWords;
127 } PktStackInit;
128 
129 
134 typedef struct {
136  uint8_t cMyAddress;
142 
143 
160 #define S2LPPktStackSetPreambleLength(xPreambleLength) S2LPSetPreambleLength(xPreambleLength)
161 
162 
168 #define S2LPPktStackGetPreambleLength() S2LPGetPreambleLength()
169 
170 
177 #define S2LPPktStackSetSyncLength(xSyncLength) S2LPSetSyncLength((PktSyncLength)xSyncLength)
178 
179 
185 #define S2LPPktStackGetSyncLength() S2LPGetSyncLength()
186 
187 
188 
195 #define S2LPPktStackFilterOnCrc(xNewState) S2LPPktCommonFilterOnCrc(xNewState)
196 
197 
198 
205 #define S2LPPktStackWhitening(xNewState) S2LPWhitening(xNewState)
206 
207 
214 #define S2LPPktStackFec(xNewState) S2LPFec(xNewState)
215 
216 
226 #define S2LPPktStackSetSyncWords(lSyncWords, xSyncLength) S2LPSetSyncWords(lSyncWords,xSyncLength)
227 
228 
239 void S2LPPktStackInit(PktStackInit* pxPktStackInit);
240 void S2LPPktStackGetInfo(PktStackInit* pxPktStackInit);
241 void S2LPPktStackAddressesInit(PktStackAddressesInit* pxPktStackAddresses);
242 void S2LPPktStackGetAddressesInfo(PktStackAddressesInit* pxPktStackAddresses);
243 void S2LPPktStackSetFormat(void);
244 void S2LPPktStackSetPayloadLength(uint16_t nPayloadLength);
245 uint16_t S2LPPktStackGetPayloadLength(void);
247 void S2LPPktStackAutoAck(SFunctionalState xNewState);
248 void S2LPPktStackNRetx(uint8_t nRetx);
251 uint8_t S2LPPktStackGetNReTx(void);
252 
266 #ifdef __cplusplus
267 }
268 #endif
269 
270 #endif
271 
272 /******************* (C) COPYRIGHT 2015 STMicroelectronics *****END OF FILE****/
SFunctionalState xFilterOnMulticastAddress
void S2LPPktStackNRetx(uint8_t nRetx)
Set the number of retransmissions to be done in case of ACK loss.
uint8_t S2LPPktStackGetNReTx(void)
Returns the number of retransmission done on the transmitted packet.
SFunctionalState
S2LP Functional state. Used to enable or disable a specific option.
Definition: S2LP_Types.h:67
SFunctionalState xFec
StackCrcMode xCrcMode
void S2LPPktStackInit(PktStackInit *pxPktStackInit)
Initialize the S2LP STack packet according to the specified parameters in the PktStackInit.
Definition: S2LP_PktStack.c:83
SFlagStatus
S2LP Flag status. Used to control the state of a flag.
Definition: S2LP_Types.h:76
void S2LPPktStackAckRequest(SFunctionalState xNewState)
This function will set the NO_ACK bit or reset it.
S2LP STack packet address structure definition. This structure allows users to specify the node/multi...
void S2LPPktStackGetAddressesInfo(PktStackAddressesInit *pxPktStackAddresses)
Return the S2LP STack packet addresses structure according to the specified parameters in the registe...
SFunctionalState xFilterOnBroadcastAddress
void S2LPPktStackAddressesInit(PktStackAddressesInit *pxPktStackAddresses)
Initialize the S2LP STack packet addresses according to the specified parameters in the PktStackAddre...
This file contains all the registers address and masks.
SFunctionalState xFilterOnMyAddress
PktCrcMode StackCrcMode
CRC length in bytes enumeration.
uint32_t lSyncWords
uint8_t xSyncLength
void S2LPPktStackSetFormat(void)
Configure the STack packet format for S2LP.
Configuration and management of the common features of S2-LP packets.
SFunctionalState xDataWhitening
void S2LPPktStackAutoAck(SFunctionalState xNewState)
Se the AUTO_ACK bit on the receiver .
SFunctionalState xFixVarLength
void S2LPPktStackGetInfo(PktStackInit *pxPktStackInit)
Return the S2LP STack packet structure according to the specified parameters in the registers.
PktCrcMode
CRC length in bytes enumeration.
SFunctionalState cExtendedPktLenField
void S2LPPktStackSetPayloadLength(uint16_t nPayloadLength)
Set the payload length for S2LP STack packets. Since the packet length depends from the address (alwa...
uint16_t S2LPPktStackGetPayloadLength(void)
Return the payload length for S2LP STack packets. Since the packet length depends from the address an...
SFlagStatus S2LPPktStackGetTXAckRequest(void)
Get the NO_ACK bit.
S2LP STack Packet Init structure definition.
Header file for S2-LP types.
void S2LPPktStackPiggybacking(SFunctionalState xNewState)
Enable or Disable the piggybacking.
uint16_t xPreambleLength