wifi test

Dependencies:   X_NUCLEO_IKS01A2 mbed-http

Committer:
JMF
Date:
Wed Sep 05 14:28:24 2018 +0000
Revision:
0:24d3eb812fd4
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
JMF 0:24d3eb812fd4 1 /**
JMF 0:24d3eb812fd4 2 ******************************************************************************
JMF 0:24d3eb812fd4 3 * @file SPIRIT_PktStack.h
JMF 0:24d3eb812fd4 4 * @author VMA division - AMS
JMF 0:24d3eb812fd4 5 * @version 3.2.2
JMF 0:24d3eb812fd4 6 * @date 08-July-2015
JMF 0:24d3eb812fd4 7 * @brief Configuration and management of SPIRIT STack packets.
JMF 0:24d3eb812fd4 8 *
JMF 0:24d3eb812fd4 9 * @details
JMF 0:24d3eb812fd4 10 *
JMF 0:24d3eb812fd4 11 * This module can be used to manage the configuration of Spirit STack
JMF 0:24d3eb812fd4 12 * packets, and it is quite similar to the Basic packets one since the
JMF 0:24d3eb812fd4 13 * STack packets can be considered an extension of Basic.
JMF 0:24d3eb812fd4 14 * The user can obtain a packet configuration filling the structure
JMF 0:24d3eb812fd4 15 * <i>@ref PktStackInit</i>, defining in it some general parameters
JMF 0:24d3eb812fd4 16 * for the Spirit STack packet format.
JMF 0:24d3eb812fd4 17 * Another structure the user can fill is <i>@ref PktStackAddressesInit</i>
JMF 0:24d3eb812fd4 18 * to define the addresses which will be used during the communication.
JMF 0:24d3eb812fd4 19 * The structure <i>@ref PktStackLlpInit</i> is provided in order to configure
JMF 0:24d3eb812fd4 20 * the link layer protocol features like autoack, autoretransmission
JMF 0:24d3eb812fd4 21 * or piggybacking.
JMF 0:24d3eb812fd4 22 * Moreover, functions to set the payload length and the destination address
JMF 0:24d3eb812fd4 23 * are provided.
JMF 0:24d3eb812fd4 24 *
JMF 0:24d3eb812fd4 25 * <b>Example:</b>
JMF 0:24d3eb812fd4 26 * @code
JMF 0:24d3eb812fd4 27 *
JMF 0:24d3eb812fd4 28 * PktStackInit stackInit={
JMF 0:24d3eb812fd4 29 * PKT_PREAMBLE_LENGTH_08BYTES, // preamble length in bytes
JMF 0:24d3eb812fd4 30 * PKT_SYNC_LENGTH_4BYTES, // sync word length in bytes
JMF 0:24d3eb812fd4 31 * 0x1A2635A8, // sync word
JMF 0:24d3eb812fd4 32 * PKT_LENGTH_VAR, // variable or fixed payload length
JMF 0:24d3eb812fd4 33 * 7, // length field width in bits (used only for variable length)
JMF 0:24d3eb812fd4 34 * PKT_NO_CRC, // CRC mode
JMF 0:24d3eb812fd4 35 * PKT_CONTROL_LENGTH_0BYTES, // control field length
JMF 0:24d3eb812fd4 36 * S_DISABLE, // FEC
JMF 0:24d3eb812fd4 37 * S_ENABLE // whitening
JMF 0:24d3eb812fd4 38 * };
JMF 0:24d3eb812fd4 39 *
JMF 0:24d3eb812fd4 40 * PktStackAddressesInit addressInit={
JMF 0:24d3eb812fd4 41 * S_ENABLE, // enable/disable filtering on my address
JMF 0:24d3eb812fd4 42 * 0x34, // my address (address of the current node)
JMF 0:24d3eb812fd4 43 * S_DISABLE, // enable/disable filtering on multicast address
JMF 0:24d3eb812fd4 44 * 0xEE, // multicast address
JMF 0:24d3eb812fd4 45 * S_DISABLE, // enable/disable filtering on broadcast address
JMF 0:24d3eb812fd4 46 * 0xFF // broadcast address
JMF 0:24d3eb812fd4 47 * };
JMF 0:24d3eb812fd4 48 *
JMF 0:24d3eb812fd4 49 * PktStackLlpInit stackLLPInit ={
JMF 0:24d3eb812fd4 50 * S_DISABLE, // enable/disable the autoack feature
JMF 0:24d3eb812fd4 51 * S_DISABLE, // enable/disable the piggybacking feature
JMF 0:24d3eb812fd4 52 * PKT_DISABLE_RETX // set the max number of retransmissions or disable them
JMF 0:24d3eb812fd4 53 * };
JMF 0:24d3eb812fd4 54 * ...
JMF 0:24d3eb812fd4 55 *
JMF 0:24d3eb812fd4 56 * SpiritPktStackInit(&stackInit);
JMF 0:24d3eb812fd4 57 * SpiritPktStackAddressesInit(&addressInit);
JMF 0:24d3eb812fd4 58 * SpiritPktStackLlpInit(&stackLLPInit);
JMF 0:24d3eb812fd4 59 *
JMF 0:24d3eb812fd4 60 * ...
JMF 0:24d3eb812fd4 61 *
JMF 0:24d3eb812fd4 62 * SpiritPktStackSetPayloadLength(20);
JMF 0:24d3eb812fd4 63 * SpiritPktStackSetDestinationAddress(0x44);
JMF 0:24d3eb812fd4 64 *
JMF 0:24d3eb812fd4 65 * ...
JMF 0:24d3eb812fd4 66 *
JMF 0:24d3eb812fd4 67 * @endcode
JMF 0:24d3eb812fd4 68 *
JMF 0:24d3eb812fd4 69 * The module provides some other functions that can be used to modify
JMF 0:24d3eb812fd4 70 * or read only some configuration parameters.
JMF 0:24d3eb812fd4 71 *
JMF 0:24d3eb812fd4 72 *
JMF 0:24d3eb812fd4 73 * @attention
JMF 0:24d3eb812fd4 74 *
JMF 0:24d3eb812fd4 75 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
JMF 0:24d3eb812fd4 76 *
JMF 0:24d3eb812fd4 77 * Redistribution and use in source and binary forms, with or without modification,
JMF 0:24d3eb812fd4 78 * are permitted provided that the following conditions are met:
JMF 0:24d3eb812fd4 79 * 1. Redistributions of source code must retain the above copyright notice,
JMF 0:24d3eb812fd4 80 * this list of conditions and the following disclaimer.
JMF 0:24d3eb812fd4 81 * 2. Redistributions in binary form must reproduce the above copyright notice,
JMF 0:24d3eb812fd4 82 * this list of conditions and the following disclaimer in the documentation
JMF 0:24d3eb812fd4 83 * and/or other materials provided with the distribution.
JMF 0:24d3eb812fd4 84 * 3. Neither the name of STMicroelectronics nor the names of its contributors
JMF 0:24d3eb812fd4 85 * may be used to endorse or promote products derived from this software
JMF 0:24d3eb812fd4 86 * without specific prior written permission.
JMF 0:24d3eb812fd4 87 *
JMF 0:24d3eb812fd4 88 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
JMF 0:24d3eb812fd4 89 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
JMF 0:24d3eb812fd4 90 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
JMF 0:24d3eb812fd4 91 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
JMF 0:24d3eb812fd4 92 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
JMF 0:24d3eb812fd4 93 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
JMF 0:24d3eb812fd4 94 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
JMF 0:24d3eb812fd4 95 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
JMF 0:24d3eb812fd4 96 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
JMF 0:24d3eb812fd4 97 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
JMF 0:24d3eb812fd4 98 *
JMF 0:24d3eb812fd4 99 ******************************************************************************
JMF 0:24d3eb812fd4 100 */
JMF 0:24d3eb812fd4 101
JMF 0:24d3eb812fd4 102 /* Define to prevent recursive inclusion -------------------------------------*/
JMF 0:24d3eb812fd4 103 #ifndef __SPIRIT_PKT_STACK_H
JMF 0:24d3eb812fd4 104 #define __SPIRIT_PKT_STACK_H
JMF 0:24d3eb812fd4 105
JMF 0:24d3eb812fd4 106 /* Includes ------------------------------------------------------------------*/
JMF 0:24d3eb812fd4 107
JMF 0:24d3eb812fd4 108 #include "SPIRIT_Regs.h"
JMF 0:24d3eb812fd4 109 #include "SPIRIT_Types.h"
JMF 0:24d3eb812fd4 110 #include "SPIRIT_PktCommon.h"
JMF 0:24d3eb812fd4 111
JMF 0:24d3eb812fd4 112 #ifdef __cplusplus
JMF 0:24d3eb812fd4 113 extern "C" {
JMF 0:24d3eb812fd4 114 #endif
JMF 0:24d3eb812fd4 115
JMF 0:24d3eb812fd4 116
JMF 0:24d3eb812fd4 117
JMF 0:24d3eb812fd4 118 /**
JMF 0:24d3eb812fd4 119 * @addtogroup SPIRIT_Libraries
JMF 0:24d3eb812fd4 120 * @{
JMF 0:24d3eb812fd4 121 */
JMF 0:24d3eb812fd4 122
JMF 0:24d3eb812fd4 123
JMF 0:24d3eb812fd4 124 /**
JMF 0:24d3eb812fd4 125 * @defgroup SPIRIT_PktStack Pkt STack
JMF 0:24d3eb812fd4 126 * @brief Configuration and management of SPIRIT STack packets.
JMF 0:24d3eb812fd4 127 * @details See the file <i>@ref SPIRIT_PktStack.h</i> for more details.
JMF 0:24d3eb812fd4 128 * @{
JMF 0:24d3eb812fd4 129 */
JMF 0:24d3eb812fd4 130
JMF 0:24d3eb812fd4 131 /**
JMF 0:24d3eb812fd4 132 * @defgroup PktStack_Exported_Types Pkt STack Exported Types
JMF 0:24d3eb812fd4 133 * @{
JMF 0:24d3eb812fd4 134 */
JMF 0:24d3eb812fd4 135
JMF 0:24d3eb812fd4 136 /**
JMF 0:24d3eb812fd4 137 * @brief Preamble length in bytes enumeration.
JMF 0:24d3eb812fd4 138 */
JMF 0:24d3eb812fd4 139 typedef PktPreambleLength StackPreambleLength;
JMF 0:24d3eb812fd4 140
JMF 0:24d3eb812fd4 141 #define IS_STACK_PREAMBLE_LENGTH IS_PKT_PREAMBLE_LENGTH
JMF 0:24d3eb812fd4 142
JMF 0:24d3eb812fd4 143 /**
JMF 0:24d3eb812fd4 144 * @brief Sync length in bytes enumeration.
JMF 0:24d3eb812fd4 145 */
JMF 0:24d3eb812fd4 146 typedef PktSyncLength StackSyncLength;
JMF 0:24d3eb812fd4 147
JMF 0:24d3eb812fd4 148 #define IS_STACK_SYNC_LENGTH IS_PKT_SYNC_LENGTH
JMF 0:24d3eb812fd4 149
JMF 0:24d3eb812fd4 150
JMF 0:24d3eb812fd4 151
JMF 0:24d3eb812fd4 152 /**
JMF 0:24d3eb812fd4 153 * @brief CRC length in bytes enumeration.
JMF 0:24d3eb812fd4 154 */
JMF 0:24d3eb812fd4 155 typedef PktCrcMode StackCrcMode;
JMF 0:24d3eb812fd4 156
JMF 0:24d3eb812fd4 157 #define IS_STACK_CRC_MODE IS_PKT_CRC_MODE
JMF 0:24d3eb812fd4 158
JMF 0:24d3eb812fd4 159
JMF 0:24d3eb812fd4 160 /**
JMF 0:24d3eb812fd4 161 * @brief Fixed or variable payload length enumeration.
JMF 0:24d3eb812fd4 162 */
JMF 0:24d3eb812fd4 163 typedef PktFixVarLength StackFixVarLength;
JMF 0:24d3eb812fd4 164
JMF 0:24d3eb812fd4 165 #define IS_STACK_FIX_VAR_LENGTH IS_PKT_FIX_VAR_LENGTH
JMF 0:24d3eb812fd4 166
JMF 0:24d3eb812fd4 167 /**
JMF 0:24d3eb812fd4 168 * @brief Control length in bytes enumeration for SPIRIT.
JMF 0:24d3eb812fd4 169 */
JMF 0:24d3eb812fd4 170 typedef PktControlLength StackControlLength;
JMF 0:24d3eb812fd4 171
JMF 0:24d3eb812fd4 172 #define IS_STACK_CONTROL_LENGTH IS_PKT_CONTROL_LENGTH
JMF 0:24d3eb812fd4 173
JMF 0:24d3eb812fd4 174 /**
JMF 0:24d3eb812fd4 175 * @brief Sync words enumeration for SPIRIT.
JMF 0:24d3eb812fd4 176 */
JMF 0:24d3eb812fd4 177 typedef PktSyncX StackSyncX;
JMF 0:24d3eb812fd4 178
JMF 0:24d3eb812fd4 179 #define IS_STACK_SYNCx IS_PKT_SYNCx
JMF 0:24d3eb812fd4 180
JMF 0:24d3eb812fd4 181 /**
JMF 0:24d3eb812fd4 182 * @brief Max retransmission number enumeration for SPIRIT.
JMF 0:24d3eb812fd4 183 */
JMF 0:24d3eb812fd4 184 typedef PktNMaxReTx StackNMaxReTx;
JMF 0:24d3eb812fd4 185
JMF 0:24d3eb812fd4 186 #define IS_STACK_NMAX_RETX IS_PKT_NMAX_RETX
JMF 0:24d3eb812fd4 187
JMF 0:24d3eb812fd4 188
JMF 0:24d3eb812fd4 189 /**
JMF 0:24d3eb812fd4 190 * @brief SPIRIT STack Packet Init structure definition. This structure allows users to set the main options
JMF 0:24d3eb812fd4 191 * for the STack packet.
JMF 0:24d3eb812fd4 192 */
JMF 0:24d3eb812fd4 193 typedef struct
JMF 0:24d3eb812fd4 194 {
JMF 0:24d3eb812fd4 195
JMF 0:24d3eb812fd4 196 StackPreambleLength xPreambleLength; /*!< Specifies the preamble length of packet.
JMF 0:24d3eb812fd4 197 This parameter can be any value of @ref StackPreambleLength */
JMF 0:24d3eb812fd4 198 StackSyncLength xSyncLength; /*!< Specifies the sync word length of packet.
JMF 0:24d3eb812fd4 199 This parameter can be any value of @ref StackSyncLength */
JMF 0:24d3eb812fd4 200 uint32_t lSyncWords; /*!< Specifies the sync words.
JMF 0:24d3eb812fd4 201 This parameter is a uint32_t word with format: 0x|SYNC1|SYNC2|SYNC3|SYNC4| */
JMF 0:24d3eb812fd4 202 StackFixVarLength xFixVarLength; /*!< Specifies if a fixed length of packet has to be used.
JMF 0:24d3eb812fd4 203 This parameter can be any value of @ref StackFixVarLength */
JMF 0:24d3eb812fd4 204 uint8_t cPktLengthWidth; /*!< Specifies the size of the length of packet in bits. This field is useful only if
JMF 0:24d3eb812fd4 205 the field xFixVarLength is set to STACK_LENGTH_VAR. For STack packets the length width
JMF 0:24d3eb812fd4 206 is log2( max payload length + control length (0 to 4) + address length (always 2)).
JMF 0:24d3eb812fd4 207 This parameter is an uint8_t */
JMF 0:24d3eb812fd4 208 StackCrcMode xCrcMode; /*!< Specifies the CRC word length of packet.
JMF 0:24d3eb812fd4 209 This parameter can be any value of @ref StackCrcMode */
JMF 0:24d3eb812fd4 210 StackControlLength xControlLength; /*!< Specifies the length of a control field to be sent.
JMF 0:24d3eb812fd4 211 This parameter can be any value of @ref StackControlLength */
JMF 0:24d3eb812fd4 212 SpiritFunctionalState xFec; /*!< Specifies if FEC has to be enabled.
JMF 0:24d3eb812fd4 213 This parameter can be any value of @ref SpiritFunctionalState */
JMF 0:24d3eb812fd4 214 SpiritFunctionalState xDataWhitening; /*!< Specifies if data whitening has to be enabled.
JMF 0:24d3eb812fd4 215 This parameter can be any value of @ref SpiritFunctionalState */
JMF 0:24d3eb812fd4 216
JMF 0:24d3eb812fd4 217 }PktStackInit;
JMF 0:24d3eb812fd4 218
JMF 0:24d3eb812fd4 219
JMF 0:24d3eb812fd4 220 /**
JMF 0:24d3eb812fd4 221 * @brief SPIRIT STack packet address structure definition. This structure allows users to specify
JMF 0:24d3eb812fd4 222 * the node/multicast/broadcast addresses and the correspondent filtering options.
JMF 0:24d3eb812fd4 223 */
JMF 0:24d3eb812fd4 224 typedef struct
JMF 0:24d3eb812fd4 225 {
JMF 0:24d3eb812fd4 226
JMF 0:24d3eb812fd4 227 SpiritFunctionalState xFilterOnMyAddress; /*!< If set RX packet is accepted if its destination address matches with cMyAddress.
JMF 0:24d3eb812fd4 228 This parameter can be S_ENABLE or S_DISABLE */
JMF 0:24d3eb812fd4 229 uint8_t cMyAddress; /*!< Specifies the TX packet source address (address of this node).
JMF 0:24d3eb812fd4 230 This parameter is an uint8_t */
JMF 0:24d3eb812fd4 231 SpiritFunctionalState xFilterOnMulticastAddress; /*!< If set RX packet is accepted if its destination address matches with cMulticastAddress.
JMF 0:24d3eb812fd4 232 This parameter can be S_ENABLE or S_DISABLE */
JMF 0:24d3eb812fd4 233 uint8_t cMulticastAddress; /*!< Specifies the Multicast group address for this node.
JMF 0:24d3eb812fd4 234 This parameter is an uint8_t */
JMF 0:24d3eb812fd4 235 SpiritFunctionalState xFilterOnBroadcastAddress; /*!< If set RX packet is accepted if its destination address matches with cBroadcastAddress.
JMF 0:24d3eb812fd4 236 This parameter can be S_ENABLE or S_DISABLE */
JMF 0:24d3eb812fd4 237 uint8_t cBroadcastAddress; /*!< Specifies the Broadcast address for this node.
JMF 0:24d3eb812fd4 238 This parameter is an uint8_t */
JMF 0:24d3eb812fd4 239 }PktStackAddressesInit;
JMF 0:24d3eb812fd4 240
JMF 0:24d3eb812fd4 241
JMF 0:24d3eb812fd4 242 /**
JMF 0:24d3eb812fd4 243 * @brief SPIRIT STack packet LLP structure definition. This structure allows users to configure
JMF 0:24d3eb812fd4 244 * all the LLP options for STack packets.
JMF 0:24d3eb812fd4 245 */
JMF 0:24d3eb812fd4 246 typedef struct
JMF 0:24d3eb812fd4 247 {
JMF 0:24d3eb812fd4 248
JMF 0:24d3eb812fd4 249 SpiritFunctionalState xAutoAck; /*!< Specifies if the auto ACK feature is used or not.
JMF 0:24d3eb812fd4 250 This parameter can be a value of @ref SpiritFunctionalState */
JMF 0:24d3eb812fd4 251 SpiritFunctionalState xPiggybacking; /*!< Specifies if the piggybacking feature is used or not.
JMF 0:24d3eb812fd4 252 This parameter can be a value of @ref SpiritFunctionalState */
JMF 0:24d3eb812fd4 253 StackNMaxReTx xNMaxRetx; /*!< Specifies the number of MAX-Retransmissions.
JMF 0:24d3eb812fd4 254 This parameter can be a value of @ref StackNMaxReTx */
JMF 0:24d3eb812fd4 255 }PktStackLlpInit;
JMF 0:24d3eb812fd4 256
JMF 0:24d3eb812fd4 257
JMF 0:24d3eb812fd4 258
JMF 0:24d3eb812fd4 259 /**
JMF 0:24d3eb812fd4 260 *@}
JMF 0:24d3eb812fd4 261 */
JMF 0:24d3eb812fd4 262
JMF 0:24d3eb812fd4 263
JMF 0:24d3eb812fd4 264 /**
JMF 0:24d3eb812fd4 265 * @defgroup PktStack_Exported_Constants Pkt STack Exported Constants
JMF 0:24d3eb812fd4 266 * @{
JMF 0:24d3eb812fd4 267 */
JMF 0:24d3eb812fd4 268
JMF 0:24d3eb812fd4 269 #define IS_STACK_LENGTH_WIDTH_BITS IS_PKT_LENGTH_WIDTH_BITS
JMF 0:24d3eb812fd4 270
JMF 0:24d3eb812fd4 271 /**
JMF 0:24d3eb812fd4 272 *@}
JMF 0:24d3eb812fd4 273 */
JMF 0:24d3eb812fd4 274
JMF 0:24d3eb812fd4 275
JMF 0:24d3eb812fd4 276 /**
JMF 0:24d3eb812fd4 277 * @defgroup PktStack_Exported_Macros Pkt STack Exported Macros
JMF 0:24d3eb812fd4 278 * @{
JMF 0:24d3eb812fd4 279 */
JMF 0:24d3eb812fd4 280
JMF 0:24d3eb812fd4 281 /**
JMF 0:24d3eb812fd4 282 * @brief Macro used to compute the lower part of the packet length
JMF 0:24d3eb812fd4 283 * for Spirit STack packets, to write in the PCKTLEN0 register.
JMF 0:24d3eb812fd4 284 * @param nLength length of the packet payload.
JMF 0:24d3eb812fd4 285 * This parameter is an uint16_t.
JMF 0:24d3eb812fd4 286 * @retval None.
JMF 0:24d3eb812fd4 287 */
JMF 0:24d3eb812fd4 288 #define STACK_BUILD_PCKTLEN0(nLength) BUILD_PCKTLEN0(nLength)
JMF 0:24d3eb812fd4 289
JMF 0:24d3eb812fd4 290
JMF 0:24d3eb812fd4 291 /**
JMF 0:24d3eb812fd4 292 * @brief Macro used to compute the upper part of the packet length
JMF 0:24d3eb812fd4 293 * for Spirit STack packets, to write the PCKTLEN1 register.
JMF 0:24d3eb812fd4 294 * @param nLength length of the packet payload.
JMF 0:24d3eb812fd4 295 * This parameter is an uint16_t.
JMF 0:24d3eb812fd4 296 * @retval None.
JMF 0:24d3eb812fd4 297 */
JMF 0:24d3eb812fd4 298 #define STACK_BUILD_PCKTLEN1(nLength) BUILD_PCKTLEN1(nLength)
JMF 0:24d3eb812fd4 299
JMF 0:24d3eb812fd4 300
JMF 0:24d3eb812fd4 301 /**
JMF 0:24d3eb812fd4 302 * @brief Sets the CONTROL length for SPIRIT STack packets.
JMF 0:24d3eb812fd4 303 * @param xControlLength length of CONTROL field in bytes.
JMF 0:24d3eb812fd4 304 * This parameter can be any value of @ref StackControlLength.
JMF 0:24d3eb812fd4 305 * @retval None.
JMF 0:24d3eb812fd4 306 */
JMF 0:24d3eb812fd4 307 #define SpiritPktStackSetControlLength(xControlLength) SpiritPktCommonSetControlLength(xControlLength)
JMF 0:24d3eb812fd4 308
JMF 0:24d3eb812fd4 309
JMF 0:24d3eb812fd4 310 /**
JMF 0:24d3eb812fd4 311 * @brief Returns the CONTROL length for SPIRIT STack packets.
JMF 0:24d3eb812fd4 312 * @param None.
JMF 0:24d3eb812fd4 313 * @retval Control length.
JMF 0:24d3eb812fd4 314 */
JMF 0:24d3eb812fd4 315 #define SpiritPktStackGetControlLength() SpiritPktCommonGetControlLength()
JMF 0:24d3eb812fd4 316
JMF 0:24d3eb812fd4 317
JMF 0:24d3eb812fd4 318 /**
JMF 0:24d3eb812fd4 319 * @brief Sets the PREAMBLE Length mode for SPIRIT STack packets.
JMF 0:24d3eb812fd4 320 * @param xPreambleLength length of PREAMBLE field in bytes.
JMF 0:24d3eb812fd4 321 * This parameter can be any value of @ref StackPreambleLength.
JMF 0:24d3eb812fd4 322 * @retval None.
JMF 0:24d3eb812fd4 323 */
JMF 0:24d3eb812fd4 324 #define SpiritPktStackSetPreambleLength(xPreambleLength) SpiritPktCommonSetPreambleLength((PktPreambleLength)xPreambleLength)
JMF 0:24d3eb812fd4 325
JMF 0:24d3eb812fd4 326
JMF 0:24d3eb812fd4 327 /**
JMF 0:24d3eb812fd4 328 * @brief Returns the PREAMBLE Length mode for SPIRIT STack packets.
JMF 0:24d3eb812fd4 329 * @param None.
JMF 0:24d3eb812fd4 330 * @retval uint8_t Preamble length in bytes.
JMF 0:24d3eb812fd4 331 */
JMF 0:24d3eb812fd4 332 #define SpiritPktStackGetPreambleLength() SpiritPktCommonGetPreambleLength()
JMF 0:24d3eb812fd4 333
JMF 0:24d3eb812fd4 334
JMF 0:24d3eb812fd4 335 /**
JMF 0:24d3eb812fd4 336 * @brief Sets the SYNC Length for SPIRIT STack packets.
JMF 0:24d3eb812fd4 337 * @param xSyncLength length of SYNC field in bytes.
JMF 0:24d3eb812fd4 338 * This parameter can be any value of @ref StackSyncLength.
JMF 0:24d3eb812fd4 339 * @retval None.
JMF 0:24d3eb812fd4 340 */
JMF 0:24d3eb812fd4 341 #define SpiritPktStackSetSyncLength(xSyncLength) SpiritPktCommonSetSyncLength((PktSyncLength)xSyncLength)
JMF 0:24d3eb812fd4 342
JMF 0:24d3eb812fd4 343
JMF 0:24d3eb812fd4 344 /**
JMF 0:24d3eb812fd4 345 * @brief Returns the SYNC Length for SPIRIT STack packets.
JMF 0:24d3eb812fd4 346 * @param None.
JMF 0:24d3eb812fd4 347 * @retval uint8_t Sync length in bytes.
JMF 0:24d3eb812fd4 348 */
JMF 0:24d3eb812fd4 349 #define SpiritPktStackGetSyncLength() SpiritPktCommonGetSyncLength()
JMF 0:24d3eb812fd4 350
JMF 0:24d3eb812fd4 351
JMF 0:24d3eb812fd4 352 /**
JMF 0:24d3eb812fd4 353 * @brief Sets fixed or variable payload length mode for SPIRIT STack packets.
JMF 0:24d3eb812fd4 354 * @param xFixVarLength variable or fixed length.
JMF 0:24d3eb812fd4 355 * PKT_FIXED_LENGTH_VAR -> variable (the length is extracted from the received packet).
JMF 0:24d3eb812fd4 356 * PKT_FIXED_LENGTH_FIX -> fix (the length is set by PCKTLEN0 and PCKTLEN1).
JMF 0:24d3eb812fd4 357 * @retval None.
JMF 0:24d3eb812fd4 358 */
JMF 0:24d3eb812fd4 359 #define SpiritPktStackSetFixVarLength(xFixVarLength) SpiritPktCommonSetFixVarLength((PktFixVarLength)xFixVarLength)
JMF 0:24d3eb812fd4 360
JMF 0:24d3eb812fd4 361
JMF 0:24d3eb812fd4 362 /**
JMF 0:24d3eb812fd4 363 * @brief Enables or Disables the CRC filtering.
JMF 0:24d3eb812fd4 364 * @param xNewState new state for CRC_CHECK.
JMF 0:24d3eb812fd4 365 * This parameter can be S_ENABLE or S_DISABLE.
JMF 0:24d3eb812fd4 366 * @retval None.
JMF 0:24d3eb812fd4 367 */
JMF 0:24d3eb812fd4 368 #define SpiritPktStackFilterOnCrc(xNewState) SpiritPktCommonFilterOnCrc(xNewState)
JMF 0:24d3eb812fd4 369
JMF 0:24d3eb812fd4 370
JMF 0:24d3eb812fd4 371 /**
JMF 0:24d3eb812fd4 372 * @brief Returns the CRC filtering bit.
JMF 0:24d3eb812fd4 373 * @param None.
JMF 0:24d3eb812fd4 374 * @retval SpiritFunctionalState This parameter can be S_ENABLE or S_DISABLE.
JMF 0:24d3eb812fd4 375 */
JMF 0:24d3eb812fd4 376 #define SpiritPktStackGetFilterOnCrc() SpiritPktCommonGetFilterOnCrc()
JMF 0:24d3eb812fd4 377
JMF 0:24d3eb812fd4 378
JMF 0:24d3eb812fd4 379 /**
JMF 0:24d3eb812fd4 380 * @brief Sets the CRC mode for SPIRIT STack packets.
JMF 0:24d3eb812fd4 381 * @param xCrcMode CRC mode.
JMF 0:24d3eb812fd4 382 * This parameter can be any value of @ref StackCrcMode.
JMF 0:24d3eb812fd4 383 * @retval None.
JMF 0:24d3eb812fd4 384 */
JMF 0:24d3eb812fd4 385 #define SpiritPktStackSetCrcMode(xCrcMode) SpiritPktCommonSetCrcMode((PktCrcMode)xCrcMode)
JMF 0:24d3eb812fd4 386
JMF 0:24d3eb812fd4 387
JMF 0:24d3eb812fd4 388 /**
JMF 0:24d3eb812fd4 389 * @brief Returns the CRC mode for SPIRIT packets.
JMF 0:24d3eb812fd4 390 * @param None.
JMF 0:24d3eb812fd4 391 * @retval StackCrcMode Crc mode.
JMF 0:24d3eb812fd4 392 */
JMF 0:24d3eb812fd4 393 #define SpiritPktStackGetCrcMode() (StackCrcMode)SpiritPktCommonGetCrcMode()
JMF 0:24d3eb812fd4 394
JMF 0:24d3eb812fd4 395
JMF 0:24d3eb812fd4 396 /**
JMF 0:24d3eb812fd4 397 * @brief Enables or Disables WHITENING for SPIRIT STack packets.
JMF 0:24d3eb812fd4 398 * @param xNewState new state for WHITENING mode.
JMF 0:24d3eb812fd4 399 * This parameter can be S_ENABLE or S_DISABLE.
JMF 0:24d3eb812fd4 400 * @retval None.
JMF 0:24d3eb812fd4 401 */
JMF 0:24d3eb812fd4 402 #define SpiritPktStackWhitening(xNewState) SpiritPktCommonWhitening(xNewState)
JMF 0:24d3eb812fd4 403
JMF 0:24d3eb812fd4 404
JMF 0:24d3eb812fd4 405 /**
JMF 0:24d3eb812fd4 406 * @brief Enables or Disables FEC for SPIRIT STack packets.
JMF 0:24d3eb812fd4 407 * @param xNewState new state for FEC mode.
JMF 0:24d3eb812fd4 408 * This parameter can be S_ENABLE or S_DISABLE.
JMF 0:24d3eb812fd4 409 * @retval None.
JMF 0:24d3eb812fd4 410 */
JMF 0:24d3eb812fd4 411 #define SpiritPktStackFec(xNewState) SpiritPktCommonFec(xNewState)
JMF 0:24d3eb812fd4 412
JMF 0:24d3eb812fd4 413
JMF 0:24d3eb812fd4 414 /**
JMF 0:24d3eb812fd4 415 * @brief Sets a specific SYNC word for SPIRIT STack packets.
JMF 0:24d3eb812fd4 416 * @param xSyncX SYNC word number to be set.
JMF 0:24d3eb812fd4 417 * This parameter can be any value of @ref StackSyncX.
JMF 0:24d3eb812fd4 418 * @param cSyncWord SYNC word.
JMF 0:24d3eb812fd4 419 * This parameter is an uint8_t.
JMF 0:24d3eb812fd4 420 * @retval None.
JMF 0:24d3eb812fd4 421 */
JMF 0:24d3eb812fd4 422 #define SpiritPktStackSetSyncxWord(xSyncX, cSyncWord) SpiritPktCommonSetSyncxWord((PktSyncX)xSyncX,cSyncWord)
JMF 0:24d3eb812fd4 423
JMF 0:24d3eb812fd4 424
JMF 0:24d3eb812fd4 425 /**
JMF 0:24d3eb812fd4 426 * @brief Returns a specific SYNC word for SPIRIT STack packets.
JMF 0:24d3eb812fd4 427 * @param xSyncX SYNC word number to be get.
JMF 0:24d3eb812fd4 428 * This parameter can be any value of @ref StackSyncX.
JMF 0:24d3eb812fd4 429 * @retval uint8_t Sync word x.
JMF 0:24d3eb812fd4 430 */
JMF 0:24d3eb812fd4 431 #define SpiritPktStackGetSyncxWord(xSyncX) SpiritPktCommonGetSyncxWord(xSyncX)
JMF 0:24d3eb812fd4 432
JMF 0:24d3eb812fd4 433
JMF 0:24d3eb812fd4 434 /**
JMF 0:24d3eb812fd4 435 * @brief Sets multiple SYNC words for SPIRIT STack packets.
JMF 0:24d3eb812fd4 436 * @param lSyncWords SYNC words to be set with format: 0x|SYNC1|SYNC2|SYNC3|SYNC4|.
JMF 0:24d3eb812fd4 437 * This parameter is a uint32_t.
JMF 0:24d3eb812fd4 438 * @param xSyncLength SYNC length in bytes. The 32bit word passed will be stored in the SYNCx registers from the MSb
JMF 0:24d3eb812fd4 439 * until the number of bytes in xSyncLength has been stored.
JMF 0:24d3eb812fd4 440 * This parameter is a @ref StackSyncLength.
JMF 0:24d3eb812fd4 441 * @retval None.
JMF 0:24d3eb812fd4 442 */
JMF 0:24d3eb812fd4 443 #define SpiritPktStackSetSyncWords(lSyncWords, xSyncLength) SpiritPktCommonSetSyncWords(lSyncWords,(PktSyncLength)xSyncLength)
JMF 0:24d3eb812fd4 444
JMF 0:24d3eb812fd4 445
JMF 0:24d3eb812fd4 446 /**
JMF 0:24d3eb812fd4 447 * @brief Returns multiple SYNC words for SPIRIT packets.
JMF 0:24d3eb812fd4 448 * @param xSyncLength SYNC length in bytes. The 32bit word passed will be stored in the SYNCx registers from the MSb
JMF 0:24d3eb812fd4 449 * until the number of bytes in xSyncLength has been stored.
JMF 0:24d3eb812fd4 450 * This parameter is a pointer to @ref StackSyncLength.
JMF 0:24d3eb812fd4 451 * @retval uint32_t Sync words. The format of the read 32 bit word is 0x|SYNC1|SYNC2|SYNC3|SYNC4|.
JMF 0:24d3eb812fd4 452 */
JMF 0:24d3eb812fd4 453 #define SpiritPktStackGetSyncWords(xSyncLength) SpiritPktCommonGetSyncWords((PktSyncLength)xSyncLength)
JMF 0:24d3eb812fd4 454
JMF 0:24d3eb812fd4 455
JMF 0:24d3eb812fd4 456 /**
JMF 0:24d3eb812fd4 457 * @brief Returns the SPIRIT variable length width (in number of bits).
JMF 0:24d3eb812fd4 458 * @param None.
JMF 0:24d3eb812fd4 459 * @retval uint8_t Variable length width in bits.
JMF 0:24d3eb812fd4 460 */
JMF 0:24d3eb812fd4 461 #define SpiritPktStackGetVarLengthWidth() SpiritPktCommonGetVarLengthWidth()
JMF 0:24d3eb812fd4 462
JMF 0:24d3eb812fd4 463
JMF 0:24d3eb812fd4 464 /**
JMF 0:24d3eb812fd4 465 * @brief Sets the destination address for the Tx packet.
JMF 0:24d3eb812fd4 466 * @param cAddress destination address.
JMF 0:24d3eb812fd4 467 * This parameter is an uint8_t.
JMF 0:24d3eb812fd4 468 * @retval None.
JMF 0:24d3eb812fd4 469 */
JMF 0:24d3eb812fd4 470 #define SpiritPktStackSetDestinationAddress(cAddress) SpiritPktCommonSetDestinationAddress(cAddress)
JMF 0:24d3eb812fd4 471
JMF 0:24d3eb812fd4 472
JMF 0:24d3eb812fd4 473 /**
JMF 0:24d3eb812fd4 474 * @brief Sets the Rx packet reference source address. The source address extracted from the received packet is masked
JMF 0:24d3eb812fd4 475 * with the source reference mask and then compared to the masked reference value.
JMF 0:24d3eb812fd4 476 * @param cAddress Reference source address.
JMF 0:24d3eb812fd4 477 * This parameter is an uint8_t.
JMF 0:24d3eb812fd4 478 * @retval None.
JMF 0:24d3eb812fd4 479 */
JMF 0:24d3eb812fd4 480 #define SpiritPktStackSetSourceReferenceAddress(cAddress) SpiritPktCommonSetDestinationAddress(cAddress)
JMF 0:24d3eb812fd4 481
JMF 0:24d3eb812fd4 482
JMF 0:24d3eb812fd4 483 /**
JMF 0:24d3eb812fd4 484 * @brief Returns the Rx packet reference source address. The source address extracted from the received packet is masked
JMF 0:24d3eb812fd4 485 * with the source reference mask and then compared to the masked reference value.
JMF 0:24d3eb812fd4 486 * @param cAddress Reference source address.
JMF 0:24d3eb812fd4 487 * This parameter is an uint8_t.
JMF 0:24d3eb812fd4 488 * @retval None.
JMF 0:24d3eb812fd4 489 */
JMF 0:24d3eb812fd4 490 #define SpiritPktStackGetSourceReferenceAddress() SpiritPktCommonGetTransmittedDestAddress()
JMF 0:24d3eb812fd4 491
JMF 0:24d3eb812fd4 492
JMF 0:24d3eb812fd4 493 /**
JMF 0:24d3eb812fd4 494 * @brief Returns the settled destination address.
JMF 0:24d3eb812fd4 495 * @param None.
JMF 0:24d3eb812fd4 496 * @retval uint8_t Transmitted destination address.
JMF 0:24d3eb812fd4 497 */
JMF 0:24d3eb812fd4 498 #define SpiritPktStackGetTransmittedDestAddress() SpiritPktCommonGetTransmittedDestAddress()
JMF 0:24d3eb812fd4 499
JMF 0:24d3eb812fd4 500
JMF 0:24d3eb812fd4 501 /**
JMF 0:24d3eb812fd4 502 * @brief Sets the node address. When the filtering on my address is on, if the destination address extracted from the received packet is equal to the content of the
JMF 0:24d3eb812fd4 503 * my address, then the packet is accepted (this is the address of the node).
JMF 0:24d3eb812fd4 504 * @param cAddress Address of the present node.
JMF 0:24d3eb812fd4 505 * This parameter is an uint8_t.
JMF 0:24d3eb812fd4 506 * @retval None.
JMF 0:24d3eb812fd4 507 */
JMF 0:24d3eb812fd4 508 #define SpiritPktStackSetMyAddress(cAddress) SpiritPktCommonSetMyAddress(cAddress)
JMF 0:24d3eb812fd4 509
JMF 0:24d3eb812fd4 510
JMF 0:24d3eb812fd4 511 /**
JMF 0:24d3eb812fd4 512 * @brief Returns the address of the present node.
JMF 0:24d3eb812fd4 513 * @param None.
JMF 0:24d3eb812fd4 514 * @retval uint8_t My address (address of this node).
JMF 0:24d3eb812fd4 515 */
JMF 0:24d3eb812fd4 516 #define SpiritPktStackGetMyAddress() SpiritPktCommonGetMyAddress()
JMF 0:24d3eb812fd4 517
JMF 0:24d3eb812fd4 518
JMF 0:24d3eb812fd4 519 /**
JMF 0:24d3eb812fd4 520 * @brief Sets the broadcast address. When the broadcast filtering is on, if the destination address extracted from the received packet is equal to the content of the
JMF 0:24d3eb812fd4 521 * BROADCAST_ADDR register, then the packet is accepted.
JMF 0:24d3eb812fd4 522 * @param cAddress Broadcast address.
JMF 0:24d3eb812fd4 523 * This parameter is an uint8_t.
JMF 0:24d3eb812fd4 524 * @retval None.
JMF 0:24d3eb812fd4 525 */
JMF 0:24d3eb812fd4 526 #define SpiritPktStackSetBroadcastAddress(cAddress) SpiritPktCommonSetBroadcastAddress(cAddress)
JMF 0:24d3eb812fd4 527
JMF 0:24d3eb812fd4 528
JMF 0:24d3eb812fd4 529 /**
JMF 0:24d3eb812fd4 530 * @brief Returns the broadcast address.
JMF 0:24d3eb812fd4 531 * @param None.
JMF 0:24d3eb812fd4 532 * @retval uint8_t Broadcast address.
JMF 0:24d3eb812fd4 533 */
JMF 0:24d3eb812fd4 534 #define SpiritPktStackGetBroadcastAddress() SpiritPktCommonGetBroadcastAddress()
JMF 0:24d3eb812fd4 535
JMF 0:24d3eb812fd4 536
JMF 0:24d3eb812fd4 537 /**
JMF 0:24d3eb812fd4 538 * @brief Sets the multicast address. When the multicast filtering is on, if the destination address extracted from the received packet is equal to the content of the
JMF 0:24d3eb812fd4 539 * MULTICAST_ADDR register, then the packet is accepted.
JMF 0:24d3eb812fd4 540 * @param cAddress Multicast address.
JMF 0:24d3eb812fd4 541 * This parameter is an uint8_t.
JMF 0:24d3eb812fd4 542 * @retval None.
JMF 0:24d3eb812fd4 543 */
JMF 0:24d3eb812fd4 544 #define SpiritPktStackSetMulticastAddress(cAddress) SpiritPktCommonSetMulticastAddress(cAddress)
JMF 0:24d3eb812fd4 545
JMF 0:24d3eb812fd4 546
JMF 0:24d3eb812fd4 547 /**
JMF 0:24d3eb812fd4 548 * @brief Returns the multicast address.
JMF 0:24d3eb812fd4 549 * @param None.
JMF 0:24d3eb812fd4 550 * @retval uint8_t Multicast address.
JMF 0:24d3eb812fd4 551 */
JMF 0:24d3eb812fd4 552 #define SpiritPktStackGetMulticastAddress() SpiritPktCommonGetMulticastAddress()
JMF 0:24d3eb812fd4 553
JMF 0:24d3eb812fd4 554
JMF 0:24d3eb812fd4 555 /**
JMF 0:24d3eb812fd4 556 * @brief Sets the control mask. The 1 bits of the CONTROL_MASK indicate the
JMF 0:24d3eb812fd4 557 * bits to be used in filtering. (All 0s no filtering)
JMF 0:24d3eb812fd4 558 * @param lMask Control mask.
JMF 0:24d3eb812fd4 559 * This parameter is an uint32_t.
JMF 0:24d3eb812fd4 560 * @retval None.
JMF 0:24d3eb812fd4 561 */
JMF 0:24d3eb812fd4 562 #define SpiritPktStackSetCtrlMask(lMask) SpiritPktCommonSetCtrlMask(lMask)
JMF 0:24d3eb812fd4 563
JMF 0:24d3eb812fd4 564
JMF 0:24d3eb812fd4 565 /**
JMF 0:24d3eb812fd4 566 * @brief Returns the control mask. The 1 bits of the CONTROL_MASK indicate the
JMF 0:24d3eb812fd4 567 * bits to be used in filtering. (All 0s no filtering)
JMF 0:24d3eb812fd4 568 * @param None.
JMF 0:24d3eb812fd4 569 * @retval uint32_t Control mask.
JMF 0:24d3eb812fd4 570 */
JMF 0:24d3eb812fd4 571 #define SpiritPktStackGetCtrlMask() SpiritPktCommonGetCtrlMask()
JMF 0:24d3eb812fd4 572
JMF 0:24d3eb812fd4 573
JMF 0:24d3eb812fd4 574 /**
JMF 0:24d3eb812fd4 575 * @brief Sets the control field reference. If the bits enabled by the
JMF 0:24d3eb812fd4 576 * CONTROL_MASK match the ones of the control fields extracted from the received packet
JMF 0:24d3eb812fd4 577 * then the packet is accepted.
JMF 0:24d3eb812fd4 578 * @param lReference Control reference.
JMF 0:24d3eb812fd4 579 * This parameter is an uint32_t.
JMF 0:24d3eb812fd4 580 * @retval None.
JMF 0:24d3eb812fd4 581 */
JMF 0:24d3eb812fd4 582 #define SpiritPktStackSetCtrlReference(lReference) SpiritPktCommonSetCtrlReference(lReference)
JMF 0:24d3eb812fd4 583
JMF 0:24d3eb812fd4 584
JMF 0:24d3eb812fd4 585 /**
JMF 0:24d3eb812fd4 586 * @brief Returns the control field reference.
JMF 0:24d3eb812fd4 587 * @param None.
JMF 0:24d3eb812fd4 588 * @retval uint32_t Control reference.
JMF 0:24d3eb812fd4 589 */
JMF 0:24d3eb812fd4 590 #define SpiritPktStackGetCtrlReference() SpiritPktCommonGetCtrlReference()
JMF 0:24d3eb812fd4 591
JMF 0:24d3eb812fd4 592
JMF 0:24d3eb812fd4 593 /**
JMF 0:24d3eb812fd4 594 * @brief Sets the TX control field.
JMF 0:24d3eb812fd4 595 * @param lField TX CONTROL FIELD.
JMF 0:24d3eb812fd4 596 * This parameter is an uint32_t.
JMF 0:24d3eb812fd4 597 * @retval None.
JMF 0:24d3eb812fd4 598 */
JMF 0:24d3eb812fd4 599 #define SpiritPktStackSetTransmittedCtrlField(lField) SpiritPktCommonSetTransmittedCtrlField(lField)
JMF 0:24d3eb812fd4 600
JMF 0:24d3eb812fd4 601
JMF 0:24d3eb812fd4 602 /**
JMF 0:24d3eb812fd4 603 * @brief Returns the TX control field.
JMF 0:24d3eb812fd4 604 * @param None.
JMF 0:24d3eb812fd4 605 * @retval uint32_t Control field of the transmitted packet.
JMF 0:24d3eb812fd4 606 */
JMF 0:24d3eb812fd4 607 #define SpiritPktStackGetTransmittedCtrlField() SpiritPktCommonGetTransmittedCtrlField()
JMF 0:24d3eb812fd4 608
JMF 0:24d3eb812fd4 609
JMF 0:24d3eb812fd4 610 /**
JMF 0:24d3eb812fd4 611 * @brief If enabled RX packet is accepted if its destination address matches with TX_SOURCE_ADDRESS.
JMF 0:24d3eb812fd4 612 * @param xNewState new state for DEST_VS_SOURCE_ADDRESS.
JMF 0:24d3eb812fd4 613 * This parameter can be S_ENABLE or S_DISABLE.
JMF 0:24d3eb812fd4 614 * @retval None.
JMF 0:24d3eb812fd4 615 */
JMF 0:24d3eb812fd4 616 #define SpiritPktStackFilterOnMyAddress(xNewState) SpiritPktCommonFilterOnMyAddress(xNewState)
JMF 0:24d3eb812fd4 617
JMF 0:24d3eb812fd4 618
JMF 0:24d3eb812fd4 619 /**
JMF 0:24d3eb812fd4 620 * @brief If enabled RX packet is accepted if its destination address matches with MULTICAST_ADDRESS.
JMF 0:24d3eb812fd4 621 * @param xNewState new state for DEST_VS_MULTICAST_ADDRESS.
JMF 0:24d3eb812fd4 622 * This parameter can be S_ENABLE or S_DISABLE.
JMF 0:24d3eb812fd4 623 * @retval None.
JMF 0:24d3eb812fd4 624 */
JMF 0:24d3eb812fd4 625 #define SpiritPktStackFilterOnMulticastAddress(xNewState) SpiritPktCommonFilterOnMulticastAddress(xNewState)
JMF 0:24d3eb812fd4 626
JMF 0:24d3eb812fd4 627
JMF 0:24d3eb812fd4 628 /**
JMF 0:24d3eb812fd4 629 * @brief If enabled RX packet is accepted if its destination address matches with BROADCAST_ADDRESS.
JMF 0:24d3eb812fd4 630 * @param xNewState new state for DEST_VS_BROADCAST_ADDRESS.
JMF 0:24d3eb812fd4 631 * This parameter can be S_ENABLE or S_DISABLE.
JMF 0:24d3eb812fd4 632 * @retval None.
JMF 0:24d3eb812fd4 633 */
JMF 0:24d3eb812fd4 634 #define SpiritPktStackFilterOnBroadcastAddress(xNewState) SpiritPktCommonFilterOnBroadcastAddress(xNewState)
JMF 0:24d3eb812fd4 635
JMF 0:24d3eb812fd4 636
JMF 0:24d3eb812fd4 637 /**
JMF 0:24d3eb812fd4 638 * @brief Returns the enable bit of the my address filtering.
JMF 0:24d3eb812fd4 639 * @param None.
JMF 0:24d3eb812fd4 640 * @retval SpiritFunctionalStateThis parameter can be S_ENABLE or S_DISABLE.
JMF 0:24d3eb812fd4 641 */
JMF 0:24d3eb812fd4 642 #define SpiritPktStackGetFilterOnMyAddress() SpiritPktCommonGetFilterOnMyAddress();
JMF 0:24d3eb812fd4 643
JMF 0:24d3eb812fd4 644
JMF 0:24d3eb812fd4 645 /**
JMF 0:24d3eb812fd4 646 * @brief Returns the enable bit of the multicast address filtering.
JMF 0:24d3eb812fd4 647 * @param None.
JMF 0:24d3eb812fd4 648 * @retval SpiritFunctionalState This parameter can be S_ENABLE or S_DISABLE.
JMF 0:24d3eb812fd4 649 */
JMF 0:24d3eb812fd4 650 #define SpiritPktStackGetFilterOnMulticastAddress() SpiritPktCommonGetFilterOnMulticastAddress();
JMF 0:24d3eb812fd4 651
JMF 0:24d3eb812fd4 652
JMF 0:24d3eb812fd4 653 /**
JMF 0:24d3eb812fd4 654 * @brief Returns the enable bit of the broadcast address filtering.
JMF 0:24d3eb812fd4 655 * @param None.
JMF 0:24d3eb812fd4 656 * @retval SpiritFunctionalState This parameter can be S_ENABLE or S_DISABLE.
JMF 0:24d3eb812fd4 657 */
JMF 0:24d3eb812fd4 658 #define SpiritPktStackGetFilterOnBroadcastAddress() SpiritPktCommonGetFilterOnBroadcastAddress();
JMF 0:24d3eb812fd4 659
JMF 0:24d3eb812fd4 660
JMF 0:24d3eb812fd4 661 /**
JMF 0:24d3eb812fd4 662 * @brief Returns the control field of the received packet.
JMF 0:24d3eb812fd4 663 * @param None.
JMF 0:24d3eb812fd4 664 * @retval uint32_t Received control field.
JMF 0:24d3eb812fd4 665 */
JMF 0:24d3eb812fd4 666 #define SpiritPktStackGetReceivedCtrlField() SpiritPktCommonGetReceivedCtrlField()
JMF 0:24d3eb812fd4 667
JMF 0:24d3eb812fd4 668
JMF 0:24d3eb812fd4 669 /**
JMF 0:24d3eb812fd4 670 * @brief Returns the CRC field of the received packet.
JMF 0:24d3eb812fd4 671 * @param cCrcFieldVect array in which the CRC field has to be stored.
JMF 0:24d3eb812fd4 672 * This parameter is an uint8_t array of 3 elements.
JMF 0:24d3eb812fd4 673 * @retval None.
JMF 0:24d3eb812fd4 674 */
JMF 0:24d3eb812fd4 675 #define SpiritPktStackGetReceivedCrcField(cCrcFieldVect) SpiritPktCommonGetReceivedCrcField(cCrcFieldVect)
JMF 0:24d3eb812fd4 676
JMF 0:24d3eb812fd4 677 /**
JMF 0:24d3eb812fd4 678 * @brief Sets the AUTO ACKNOLEDGEMENT mechanism on the receiver. When the feature is enabled and
JMF 0:24d3eb812fd4 679 * a data packet has been correctly received, then an acknowledgement packet is sent back to the originator of the received
JMF 0:24d3eb812fd4 680 * packet. If the PIGGYBACKING bit is also set, payload data will be read from the FIFO; otherwise an empty packet is sent
JMF 0:24d3eb812fd4 681 * only containing the source and destination addresses and the sequence number of the packet being acknowledged.
JMF 0:24d3eb812fd4 682 * @param xAutoAck new state for autoack.
JMF 0:24d3eb812fd4 683 * This parameter can be: S_ENABLE or S_DISABLE.
JMF 0:24d3eb812fd4 684 * @param xPiggybacking new state for autoack.
JMF 0:24d3eb812fd4 685 * This parameter can be: S_ENABLE or S_DISABLE.
JMF 0:24d3eb812fd4 686 * @retval None.
JMF 0:24d3eb812fd4 687 */
JMF 0:24d3eb812fd4 688 #define SpiritPktStackAutoAck(xAutoAck, xPiggybacking) SpiritPktCommonAutoAck(xAutoAck, xPiggybacking)
JMF 0:24d3eb812fd4 689
JMF 0:24d3eb812fd4 690
JMF 0:24d3eb812fd4 691 /**
JMF 0:24d3eb812fd4 692 * @brief Sets the AUTO ACKNOLEDGEMENT mechanism on the transmitter. On the transmitter side, the NACK_TX field can be used to require or not an acknowledgment for each individual packet: if
JMF 0:24d3eb812fd4 693 * NACK_TX is set to "1" then acknowledgment will not be required; if NACK_TX is set to "0" then acknowledgment will be
JMF 0:24d3eb812fd4 694 * required.
JMF 0:24d3eb812fd4 695 * @param xNewState new state for TX_AUTOACK.
JMF 0:24d3eb812fd4 696 * This parameter can be: S_ENABLE or S_DISABLE.
JMF 0:24d3eb812fd4 697 * @retval None.
JMF 0:24d3eb812fd4 698 */
JMF 0:24d3eb812fd4 699 #define SpiritPktStackRequireAck(xNewState) SpiritPktCommonRequireAck(xNewState)
JMF 0:24d3eb812fd4 700
JMF 0:24d3eb812fd4 701
JMF 0:24d3eb812fd4 702 /**
JMF 0:24d3eb812fd4 703 * @brief Sets the TX sequence number to be used to start counting.
JMF 0:24d3eb812fd4 704 * @param cSeqNumberReload new value for Tx seq number reload.
JMF 0:24d3eb812fd4 705 * This parameter can be: S_ENABLE or S_DISABLE.
JMF 0:24d3eb812fd4 706 * @retval None.
JMF 0:24d3eb812fd4 707 */
JMF 0:24d3eb812fd4 708 #define SpiritPktStackSetTransmittedSeqNumberReload(cSeqNumberReload) SpiritPktCommonSetTransmittedSeqNumberReload(cSeqNumberReload)
JMF 0:24d3eb812fd4 709
JMF 0:24d3eb812fd4 710
JMF 0:24d3eb812fd4 711 /**
JMF 0:24d3eb812fd4 712 * @brief Sets the max number of automatic retransmission.
JMF 0:24d3eb812fd4 713 * @param xNMaxReTx max number of retransmission.
JMF 0:24d3eb812fd4 714 * This parameter can be any value of @ref PktNMaxReTx.
JMF 0:24d3eb812fd4 715 * @retval None.
JMF 0:24d3eb812fd4 716 */
JMF 0:24d3eb812fd4 717 #define SpiritPktStackSetNMaxReTx(xNMaxReTx) SpiritPktCommonSetNMaxReTx((PktNMaxReTx)xNMaxReTx)
JMF 0:24d3eb812fd4 718
JMF 0:24d3eb812fd4 719
JMF 0:24d3eb812fd4 720 /**
JMF 0:24d3eb812fd4 721 * @brief Returns the max number of automatic retransmission.
JMF 0:24d3eb812fd4 722 * @param None.
JMF 0:24d3eb812fd4 723 * @retval uint8_t Max number of retransmissions.
JMF 0:24d3eb812fd4 724 */
JMF 0:24d3eb812fd4 725 #define SpiritPktStackGetNMaxReTx() SpiritPktCommonGetNMaxReTx()
JMF 0:24d3eb812fd4 726
JMF 0:24d3eb812fd4 727
JMF 0:24d3eb812fd4 728 /**
JMF 0:24d3eb812fd4 729 * @brief Returns the TX ACK request.
JMF 0:24d3eb812fd4 730 * @param None.
JMF 0:24d3eb812fd4 731 * @retval SpiritFunctionalState.
JMF 0:24d3eb812fd4 732 */
JMF 0:24d3eb812fd4 733 #define SpiritPktStackGetGetTxAckRequest() SpiritPktCommonGetTxAckRequest()
JMF 0:24d3eb812fd4 734
JMF 0:24d3eb812fd4 735 /**
JMF 0:24d3eb812fd4 736 * @brief Returns the destination address of the received packet.
JMF 0:24d3eb812fd4 737 * @param None.
JMF 0:24d3eb812fd4 738 * @retval uint8_t Destination address of the received packet.
JMF 0:24d3eb812fd4 739 */
JMF 0:24d3eb812fd4 740 #define SpiritPktStackGetReceivedDestAddress() SpiritPktCommonGetReceivedDestAddress()
JMF 0:24d3eb812fd4 741
JMF 0:24d3eb812fd4 742
JMF 0:24d3eb812fd4 743 /**
JMF 0:24d3eb812fd4 744 * @brief Returns the source address of the received packet.
JMF 0:24d3eb812fd4 745 * @param None.
JMF 0:24d3eb812fd4 746 * @retval uint8_t Source address of the received packet.
JMF 0:24d3eb812fd4 747 */
JMF 0:24d3eb812fd4 748 #define SpiritPktStackGetReceivedSourceAddress() SpiritPktCommonGetReceivedSourceAddress()
JMF 0:24d3eb812fd4 749
JMF 0:24d3eb812fd4 750
JMF 0:24d3eb812fd4 751 /**
JMF 0:24d3eb812fd4 752 * @brief Returns the sequence number of the received packet.
JMF 0:24d3eb812fd4 753 * @param None.
JMF 0:24d3eb812fd4 754 * @retval uint8_t Received Sequence number.
JMF 0:24d3eb812fd4 755 */
JMF 0:24d3eb812fd4 756 #define SpiritPktStackGetReceivedSeqNumber() SpiritPktCommonGetReceivedSeqNumber()
JMF 0:24d3eb812fd4 757
JMF 0:24d3eb812fd4 758
JMF 0:24d3eb812fd4 759 /**
JMF 0:24d3eb812fd4 760 * @brief Returns the Nack bit of the received packet
JMF 0:24d3eb812fd4 761 * @param None.
JMF 0:24d3eb812fd4 762 * @retval uint8_t Value of the NAck bit.
JMF 0:24d3eb812fd4 763 */
JMF 0:24d3eb812fd4 764 #define SpiritPktStackGetReceivedNackRx() SpiritPktCommonGetReceivedNackRx()
JMF 0:24d3eb812fd4 765
JMF 0:24d3eb812fd4 766
JMF 0:24d3eb812fd4 767 /**
JMF 0:24d3eb812fd4 768 * @brief Returns the sequence number of the transmitted packet.
JMF 0:24d3eb812fd4 769 * @param None.
JMF 0:24d3eb812fd4 770 * @retval uint8_t Sequence number of the transmitted packet.
JMF 0:24d3eb812fd4 771 */
JMF 0:24d3eb812fd4 772 #define SpiritPktStackGetTransmittedSeqNumber() SpiritPktCommonGetTransmittedSeqNumber()
JMF 0:24d3eb812fd4 773
JMF 0:24d3eb812fd4 774
JMF 0:24d3eb812fd4 775 /**
JMF 0:24d3eb812fd4 776 * @brief Returns the number of retransmission done on the transmitted packet.
JMF 0:24d3eb812fd4 777 * @param None.
JMF 0:24d3eb812fd4 778 * @retval uint8_t Number of retransmissions done until now.
JMF 0:24d3eb812fd4 779 */
JMF 0:24d3eb812fd4 780 #define SpiritPktStackGetNReTx() SpiritPktCommonGetNReTx()
JMF 0:24d3eb812fd4 781
JMF 0:24d3eb812fd4 782
JMF 0:24d3eb812fd4 783 /**
JMF 0:24d3eb812fd4 784 * @brief If enabled RX packet is accepted only if the masked control field matches the
JMF 0:24d3eb812fd4 785 * masked control field reference (CONTROL_MASK & CONTROL_FIELD_REF == CONTROL_MASK & RX_CONTROL_FIELD).
JMF 0:24d3eb812fd4 786 * @param xNewState new state for Control filtering enable bit.
JMF 0:24d3eb812fd4 787 * This parameter can be S_ENABLE or S_DISABLE.
JMF 0:24d3eb812fd4 788 * @retval None.
JMF 0:24d3eb812fd4 789 * @note This filtering control is enabled by default but the control mask is by default set to 0.
JMF 0:24d3eb812fd4 790 * As a matter of fact the user has to enable the control filtering bit after the packet initialization
JMF 0:24d3eb812fd4 791 * because the PktInit routine disables it.
JMF 0:24d3eb812fd4 792 */
JMF 0:24d3eb812fd4 793 #define SpiritPktStackFilterOnControlField(xNewState) SpiritPktCommonFilterOnControlField(xNewState)
JMF 0:24d3eb812fd4 794
JMF 0:24d3eb812fd4 795
JMF 0:24d3eb812fd4 796 /**
JMF 0:24d3eb812fd4 797 * @brief Returns the enable bit of the control field filtering.
JMF 0:24d3eb812fd4 798 * @param None.
JMF 0:24d3eb812fd4 799 * @retval SpiritFunctionalState This parameter can be S_ENABLE or S_DISABLE.
JMF 0:24d3eb812fd4 800 */
JMF 0:24d3eb812fd4 801 #define SpiritPktStackGetFilterOnControlField() SpiritPktCommonGetFilterOnControlField();
JMF 0:24d3eb812fd4 802
JMF 0:24d3eb812fd4 803
JMF 0:24d3eb812fd4 804 /**
JMF 0:24d3eb812fd4 805 *@}
JMF 0:24d3eb812fd4 806 */
JMF 0:24d3eb812fd4 807
JMF 0:24d3eb812fd4 808
JMF 0:24d3eb812fd4 809 /**
JMF 0:24d3eb812fd4 810 * @defgroup PktStack_Exported_Functions Pkt STack Exported Functions
JMF 0:24d3eb812fd4 811 * @{
JMF 0:24d3eb812fd4 812 */
JMF 0:24d3eb812fd4 813
JMF 0:24d3eb812fd4 814 void SpiritPktStackInit(PktStackInit* pxPktStackInit);
JMF 0:24d3eb812fd4 815 void SpiritPktStackGetInfo(PktStackInit* pxPktStackInit);
JMF 0:24d3eb812fd4 816 void SpiritPktStackAddressesInit(PktStackAddressesInit* pxPktStackAddresses);
JMF 0:24d3eb812fd4 817 void SpiritPktStackGetAddressesInfo(PktStackAddressesInit* pxPktStackAddresses);
JMF 0:24d3eb812fd4 818 void SpiritPktStackLlpInit(PktStackLlpInit* pxPktStackLlpInit);
JMF 0:24d3eb812fd4 819 void SpiritPktStackLlpGetInfo(PktStackLlpInit* pxPktStackLlpInit);
JMF 0:24d3eb812fd4 820 void SpiritPktStackSetFormat(void);
JMF 0:24d3eb812fd4 821 void SpiritPktStackSetPayloadLength(uint16_t nPayloadLength);
JMF 0:24d3eb812fd4 822 uint16_t SpiritPktStackGetPayloadLength(void);
JMF 0:24d3eb812fd4 823 void SpiritPktStackSetVarLengthWidth(uint16_t nMaxPayloadLength, StackControlLength xControlLength);
JMF 0:24d3eb812fd4 824 void SpiritPktStackSetRxSourceMask(uint8_t cMask);
JMF 0:24d3eb812fd4 825 uint8_t SpiritPktStackGetRxSourceMask(void);
JMF 0:24d3eb812fd4 826 uint16_t SpiritPktStackGetReceivedPktLength(void);
JMF 0:24d3eb812fd4 827 void SpiritPktStackFilterOnSourceAddress(SpiritFunctionalState xNewState);
JMF 0:24d3eb812fd4 828 void SpiritPktStackSetAddressLength(void);
JMF 0:24d3eb812fd4 829
JMF 0:24d3eb812fd4 830 /**
JMF 0:24d3eb812fd4 831 *@}
JMF 0:24d3eb812fd4 832 */
JMF 0:24d3eb812fd4 833
JMF 0:24d3eb812fd4 834 /**
JMF 0:24d3eb812fd4 835 *@}
JMF 0:24d3eb812fd4 836 */
JMF 0:24d3eb812fd4 837
JMF 0:24d3eb812fd4 838
JMF 0:24d3eb812fd4 839 /**
JMF 0:24d3eb812fd4 840 *@}
JMF 0:24d3eb812fd4 841 */
JMF 0:24d3eb812fd4 842
JMF 0:24d3eb812fd4 843 #ifdef __cplusplus
JMF 0:24d3eb812fd4 844 }
JMF 0:24d3eb812fd4 845 #endif
JMF 0:24d3eb812fd4 846
JMF 0:24d3eb812fd4 847 #endif
JMF 0:24d3eb812fd4 848
JMF 0:24d3eb812fd4 849 /******************* (C) COPYRIGHT 2015 STMicroelectronics *****END OF FILE****/