Easily add all supported connectivity methods to your mbed OS project

Dependencies:   type-yd-driver

Committer:
MACRUM
Date:
Wed Jul 12 10:52:58 2017 +0000
Revision:
0:615f90842ce8
Initial commit

Who changed what in which revision?

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