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_PktBasic.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 Basic 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 Basic
JMF 0:24d3eb812fd4 12 * packets.
JMF 0:24d3eb812fd4 13 * The user can obtain a packet configuration filling the structure
JMF 0:24d3eb812fd4 14 * <i>@ref PktBasicInit</i>, defining in it some general parameters
JMF 0:24d3eb812fd4 15 * for the Spirit Basic packet format.
JMF 0:24d3eb812fd4 16 * Another structure the user can fill is <i>@ref PktBasicAddressesInit</i>
JMF 0:24d3eb812fd4 17 * to define the addresses which will be used during the communication.
JMF 0:24d3eb812fd4 18 * Moreover, functions to set the payload length and the destination address
JMF 0:24d3eb812fd4 19 * are provided.
JMF 0:24d3eb812fd4 20 *
JMF 0:24d3eb812fd4 21 * <b>Example:</b>
JMF 0:24d3eb812fd4 22 * @code
JMF 0:24d3eb812fd4 23 *
JMF 0:24d3eb812fd4 24 * PktBasicInit basicInit={
JMF 0:24d3eb812fd4 25 * PKT_PREAMBLE_LENGTH_08BYTES, // preamble length in bytes
JMF 0:24d3eb812fd4 26 * PKT_SYNC_LENGTH_4BYTES, // sync word length in bytes
JMF 0:24d3eb812fd4 27 * 0x1A2635A8, // sync word
JMF 0:24d3eb812fd4 28 * PKT_LENGTH_VAR, // variable or fixed payload length
JMF 0:24d3eb812fd4 29 * 7, // length field width in bits (used only for variable length)
JMF 0:24d3eb812fd4 30 * PKT_NO_CRC, // CRC mode
JMF 0:24d3eb812fd4 31 * PKT_CONTROL_LENGTH_0BYTES, // control field length
JMF 0:24d3eb812fd4 32 * S_ENABLE, // address field
JMF 0:24d3eb812fd4 33 * S_DISABLE, // FEC
JMF 0:24d3eb812fd4 34 * S_ENABLE // whitening
JMF 0:24d3eb812fd4 35 * };
JMF 0:24d3eb812fd4 36 *
JMF 0:24d3eb812fd4 37 * PktBasicAddressesInit addressInit={
JMF 0:24d3eb812fd4 38 * S_ENABLE, // enable/disable filtering on my address
JMF 0:24d3eb812fd4 39 * 0x34, // my address (address of the current node)
JMF 0:24d3eb812fd4 40 * S_DISABLE, // enable/disable filtering on multicast address
JMF 0:24d3eb812fd4 41 * 0xEE, // multicast address
JMF 0:24d3eb812fd4 42 * S_DISABLE, // enable/disable filtering on broadcast address
JMF 0:24d3eb812fd4 43 * 0xFF // broadcast address
JMF 0:24d3eb812fd4 44 * };
JMF 0:24d3eb812fd4 45 *
JMF 0:24d3eb812fd4 46 * ...
JMF 0:24d3eb812fd4 47 *
JMF 0:24d3eb812fd4 48 * SpiritPktBasicInit(&basicInit);
JMF 0:24d3eb812fd4 49 * SpiritPktBasicAddressesInit(&addressInit);
JMF 0:24d3eb812fd4 50 *
JMF 0:24d3eb812fd4 51 * ...
JMF 0:24d3eb812fd4 52 *
JMF 0:24d3eb812fd4 53 * SpiritPktBasicSetPayloadLength(20);
JMF 0:24d3eb812fd4 54 * SpiritPktBasicSetDestinationAddress(0x44);
JMF 0:24d3eb812fd4 55 *
JMF 0:24d3eb812fd4 56 * ...
JMF 0:24d3eb812fd4 57 *
JMF 0:24d3eb812fd4 58 * @endcode
JMF 0:24d3eb812fd4 59 *
JMF 0:24d3eb812fd4 60 * The module provides some other functions that can be used to modify
JMF 0:24d3eb812fd4 61 * or read only some configuration parameters.
JMF 0:24d3eb812fd4 62 *
JMF 0:24d3eb812fd4 63 *
JMF 0:24d3eb812fd4 64 * @attention
JMF 0:24d3eb812fd4 65 *
JMF 0:24d3eb812fd4 66 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
JMF 0:24d3eb812fd4 67 *
JMF 0:24d3eb812fd4 68 * Redistribution and use in source and binary forms, with or without modification,
JMF 0:24d3eb812fd4 69 * are permitted provided that the following conditions are met:
JMF 0:24d3eb812fd4 70 * 1. Redistributions of source code must retain the above copyright notice,
JMF 0:24d3eb812fd4 71 * this list of conditions and the following disclaimer.
JMF 0:24d3eb812fd4 72 * 2. Redistributions in binary form must reproduce the above copyright notice,
JMF 0:24d3eb812fd4 73 * this list of conditions and the following disclaimer in the documentation
JMF 0:24d3eb812fd4 74 * and/or other materials provided with the distribution.
JMF 0:24d3eb812fd4 75 * 3. Neither the name of STMicroelectronics nor the names of its contributors
JMF 0:24d3eb812fd4 76 * may be used to endorse or promote products derived from this software
JMF 0:24d3eb812fd4 77 * without specific prior written permission.
JMF 0:24d3eb812fd4 78 *
JMF 0:24d3eb812fd4 79 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
JMF 0:24d3eb812fd4 80 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
JMF 0:24d3eb812fd4 81 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
JMF 0:24d3eb812fd4 82 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
JMF 0:24d3eb812fd4 83 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
JMF 0:24d3eb812fd4 84 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
JMF 0:24d3eb812fd4 85 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
JMF 0:24d3eb812fd4 86 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
JMF 0:24d3eb812fd4 87 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
JMF 0:24d3eb812fd4 88 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
JMF 0:24d3eb812fd4 89 *
JMF 0:24d3eb812fd4 90 ******************************************************************************
JMF 0:24d3eb812fd4 91 */
JMF 0:24d3eb812fd4 92
JMF 0:24d3eb812fd4 93 /* Define to prevent recursive inclusion -------------------------------------*/
JMF 0:24d3eb812fd4 94 #ifndef __SPIRIT_PKT_BASIC_H
JMF 0:24d3eb812fd4 95 #define __SPIRIT_PKT_BASIC_H
JMF 0:24d3eb812fd4 96
JMF 0:24d3eb812fd4 97 /* Includes ------------------------------------------------------------------*/
JMF 0:24d3eb812fd4 98
JMF 0:24d3eb812fd4 99 #include "SPIRIT_Regs.h"
JMF 0:24d3eb812fd4 100 #include "SPIRIT_Types.h"
JMF 0:24d3eb812fd4 101 #include "SPIRIT_PktCommon.h"
JMF 0:24d3eb812fd4 102
JMF 0:24d3eb812fd4 103 #ifdef __cplusplus
JMF 0:24d3eb812fd4 104 extern "C" {
JMF 0:24d3eb812fd4 105 #endif
JMF 0:24d3eb812fd4 106
JMF 0:24d3eb812fd4 107
JMF 0:24d3eb812fd4 108
JMF 0:24d3eb812fd4 109 /**
JMF 0:24d3eb812fd4 110 * @addtogroup SPIRIT_Libraries
JMF 0:24d3eb812fd4 111 * @{
JMF 0:24d3eb812fd4 112 */
JMF 0:24d3eb812fd4 113
JMF 0:24d3eb812fd4 114
JMF 0:24d3eb812fd4 115 /**
JMF 0:24d3eb812fd4 116 * @defgroup SPIRIT_PktBasic Pkt Basic
JMF 0:24d3eb812fd4 117 * @brief Configuration and management of SPIRIT Basic packets.
JMF 0:24d3eb812fd4 118 * @details See the file <i>@ref SPIRIT_PktBasic.h</i> for more details.
JMF 0:24d3eb812fd4 119 * @{
JMF 0:24d3eb812fd4 120 */
JMF 0:24d3eb812fd4 121
JMF 0:24d3eb812fd4 122 /**
JMF 0:24d3eb812fd4 123 * @defgroup PktBasic_Exported_Types Pkt Basic Exported Types
JMF 0:24d3eb812fd4 124 * @{
JMF 0:24d3eb812fd4 125 */
JMF 0:24d3eb812fd4 126
JMF 0:24d3eb812fd4 127
JMF 0:24d3eb812fd4 128 /**
JMF 0:24d3eb812fd4 129 * @brief Preamble length in bytes enumeration.
JMF 0:24d3eb812fd4 130 */
JMF 0:24d3eb812fd4 131 typedef PktPreambleLength BasicPreambleLength;
JMF 0:24d3eb812fd4 132
JMF 0:24d3eb812fd4 133 #define IS_BASIC_PREAMBLE_LENGTH IS_PKT_PREAMBLE_LENGTH
JMF 0:24d3eb812fd4 134
JMF 0:24d3eb812fd4 135 /**
JMF 0:24d3eb812fd4 136 * @brief Sync length in bytes enumeration.
JMF 0:24d3eb812fd4 137 */
JMF 0:24d3eb812fd4 138 typedef PktSyncLength BasicSyncLength;
JMF 0:24d3eb812fd4 139
JMF 0:24d3eb812fd4 140 #define IS_BASIC_SYNC_LENGTH IS_PKT_SYNC_LENGTH
JMF 0:24d3eb812fd4 141
JMF 0:24d3eb812fd4 142
JMF 0:24d3eb812fd4 143
JMF 0:24d3eb812fd4 144 /**
JMF 0:24d3eb812fd4 145 * @brief CRC length in bytes enumeration.
JMF 0:24d3eb812fd4 146 */
JMF 0:24d3eb812fd4 147 typedef PktCrcMode BasicCrcMode;
JMF 0:24d3eb812fd4 148
JMF 0:24d3eb812fd4 149 #define IS_BASIC_CRC_MODE IS_PKT_CRC_MODE
JMF 0:24d3eb812fd4 150
JMF 0:24d3eb812fd4 151
JMF 0:24d3eb812fd4 152 /**
JMF 0:24d3eb812fd4 153 * @brief Fixed or variable payload length enumeration.
JMF 0:24d3eb812fd4 154 */
JMF 0:24d3eb812fd4 155 typedef PktFixVarLength BasicFixVarLength;
JMF 0:24d3eb812fd4 156
JMF 0:24d3eb812fd4 157 #define IS_BASIC_FIX_VAR_LENGTH IS_PKT_FIX_VAR_LENGTH
JMF 0:24d3eb812fd4 158
JMF 0:24d3eb812fd4 159 /**
JMF 0:24d3eb812fd4 160 * @brief Control length in bytes enumeration.
JMF 0:24d3eb812fd4 161 */
JMF 0:24d3eb812fd4 162 typedef PktControlLength BasicControlLength;
JMF 0:24d3eb812fd4 163
JMF 0:24d3eb812fd4 164 #define IS_BASIC_CONTROL_LENGTH IS_PKT_CONTROL_LENGTH
JMF 0:24d3eb812fd4 165
JMF 0:24d3eb812fd4 166 /**
JMF 0:24d3eb812fd4 167 * @brief Sync words enumeration.
JMF 0:24d3eb812fd4 168 */
JMF 0:24d3eb812fd4 169 typedef PktSyncX BasicSyncX;
JMF 0:24d3eb812fd4 170
JMF 0:24d3eb812fd4 171 #define IS_BASIC_SYNCx IS_PKT_SYNCx
JMF 0:24d3eb812fd4 172
JMF 0:24d3eb812fd4 173
JMF 0:24d3eb812fd4 174 /**
JMF 0:24d3eb812fd4 175 * @brief SPIRIT Basic Packet Init structure definition. This structure allows users to set the main options
JMF 0:24d3eb812fd4 176 * for the Basic packet.
JMF 0:24d3eb812fd4 177 */
JMF 0:24d3eb812fd4 178 typedef struct
JMF 0:24d3eb812fd4 179 {
JMF 0:24d3eb812fd4 180
JMF 0:24d3eb812fd4 181 BasicPreambleLength xPreambleLength; /*!< Specifies the preamble length.
JMF 0:24d3eb812fd4 182 This parameter can be any value of @ref BasicPreambleLength */
JMF 0:24d3eb812fd4 183 BasicSyncLength xSyncLength; /*!< Specifies the sync word length. The 32bit word passed (lSyncWords) will be stored in the SYNCx registers from the MSb
JMF 0:24d3eb812fd4 184 until the number of bytes in xSyncLength has been stored.
JMF 0:24d3eb812fd4 185 This parameter can be any value of @ref BasicSyncLength */
JMF 0:24d3eb812fd4 186 uint32_t lSyncWords; /*!< Specifies the sync words.
JMF 0:24d3eb812fd4 187 This parameter is a uint32_t word with format: 0x|SYNC1|SYNC2|SYNC3|SYNC4| */
JMF 0:24d3eb812fd4 188 BasicFixVarLength xFixVarLength; /*!< Specifies if a fixed length of packet has to be used.
JMF 0:24d3eb812fd4 189 This parameter can be any value of @ref BasicFixVarLength */
JMF 0:24d3eb812fd4 190 uint8_t cPktLengthWidth; /*!< Specifies the size of the length of packet in bits. This field is useful only if
JMF 0:24d3eb812fd4 191 the field xFixVarLength is set to BASIC_LENGTH_VAR. For Basic packets the length width
JMF 0:24d3eb812fd4 192 is log2( max payload length + control length (0 to 4) + address length (0 or 1)).
JMF 0:24d3eb812fd4 193 This parameter is an uint8_t */
JMF 0:24d3eb812fd4 194 BasicCrcMode xCrcMode; /*!< Specifies the CRC word length of packet.
JMF 0:24d3eb812fd4 195 This parameter can be any value of @ref BasicCrcMode */
JMF 0:24d3eb812fd4 196 BasicControlLength xControlLength; /*!< Specifies the length of a control field to be sent.
JMF 0:24d3eb812fd4 197 This parameter can be any value of @ref BasicControlLength */
JMF 0:24d3eb812fd4 198 SpiritFunctionalState xAddressField; /*!< Specifies if the destination address has to be sent.
JMF 0:24d3eb812fd4 199 This parameter can be S_ENABLE or S_DISABLE */
JMF 0:24d3eb812fd4 200 SpiritFunctionalState xFec; /*!< Specifies if FEC has to be enabled.
JMF 0:24d3eb812fd4 201 This parameter can be S_ENABLE or S_DISABLE */
JMF 0:24d3eb812fd4 202 SpiritFunctionalState xDataWhitening; /*!< Specifies if data whitening has to be enabled.
JMF 0:24d3eb812fd4 203 This parameter can be S_ENABLE or S_DISABLE */
JMF 0:24d3eb812fd4 204 }PktBasicInit;
JMF 0:24d3eb812fd4 205
JMF 0:24d3eb812fd4 206
JMF 0:24d3eb812fd4 207 /**
JMF 0:24d3eb812fd4 208 * @brief SPIRIT Basic Packet address structure definition. This structure allows users to specify
JMF 0:24d3eb812fd4 209 * the node/multicast/broadcast addresses and the correspondent filtering options.
JMF 0:24d3eb812fd4 210 */
JMF 0:24d3eb812fd4 211 typedef struct
JMF 0:24d3eb812fd4 212 {
JMF 0:24d3eb812fd4 213
JMF 0:24d3eb812fd4 214 SpiritFunctionalState xFilterOnMyAddress; /*!< If set RX packet is accepted if its destination address matches with cMyAddress.
JMF 0:24d3eb812fd4 215 This parameter can be S_ENABLE or S_DISABLE */
JMF 0:24d3eb812fd4 216 uint8_t cMyAddress; /*!< Specifies the TX packet source address (address of this node).
JMF 0:24d3eb812fd4 217 This parameter is an uint8_t */
JMF 0:24d3eb812fd4 218 SpiritFunctionalState xFilterOnMulticastAddress; /*!< If set RX packet is accepted if its destination address matches with cMulticastAddress.
JMF 0:24d3eb812fd4 219 This parameter can be S_ENABLE or S_DISABLE */
JMF 0:24d3eb812fd4 220 uint8_t cMulticastAddress; /*!< Specifies the Multicast group address for this node.
JMF 0:24d3eb812fd4 221 This parameter is an uint8_t */
JMF 0:24d3eb812fd4 222 SpiritFunctionalState xFilterOnBroadcastAddress; /*!< If set RX packet is accepted if its destination address matches with cBroadcastAddress.
JMF 0:24d3eb812fd4 223 This parameter can be S_ENABLE or S_DISABLE */
JMF 0:24d3eb812fd4 224 uint8_t cBroadcastAddress; /*!< Specifies the Broadcast address for this node.
JMF 0:24d3eb812fd4 225 This parameter is an uint8_t */
JMF 0:24d3eb812fd4 226 }PktBasicAddressesInit;
JMF 0:24d3eb812fd4 227
JMF 0:24d3eb812fd4 228 /**
JMF 0:24d3eb812fd4 229 *@}
JMF 0:24d3eb812fd4 230 */
JMF 0:24d3eb812fd4 231
JMF 0:24d3eb812fd4 232
JMF 0:24d3eb812fd4 233 /**
JMF 0:24d3eb812fd4 234 * @defgroup PktBasic_Exported_Constants Pkt Basic Exported Constants
JMF 0:24d3eb812fd4 235 * @{
JMF 0:24d3eb812fd4 236 */
JMF 0:24d3eb812fd4 237
JMF 0:24d3eb812fd4 238 #define IS_BASIC_LENGTH_WIDTH_BITS IS_PKT_LENGTH_WIDTH_BITS
JMF 0:24d3eb812fd4 239
JMF 0:24d3eb812fd4 240
JMF 0:24d3eb812fd4 241 /**
JMF 0:24d3eb812fd4 242 *@}
JMF 0:24d3eb812fd4 243 */
JMF 0:24d3eb812fd4 244
JMF 0:24d3eb812fd4 245
JMF 0:24d3eb812fd4 246 /**
JMF 0:24d3eb812fd4 247 * @defgroup PktBasic_Exported_Macros Pkt Basic Exported Macros
JMF 0:24d3eb812fd4 248 * @{
JMF 0:24d3eb812fd4 249 */
JMF 0:24d3eb812fd4 250
JMF 0:24d3eb812fd4 251 /**
JMF 0:24d3eb812fd4 252 * @brief Macro used to compute per lower part of the packet length
JMF 0:24d3eb812fd4 253 * for Spirit Basic packets, to write in the PCKTLEN0 register.
JMF 0:24d3eb812fd4 254 * @param nLength Length of the packet payload.
JMF 0:24d3eb812fd4 255 * This parameter is an uint16_t.
JMF 0:24d3eb812fd4 256 * @retval None.
JMF 0:24d3eb812fd4 257 */
JMF 0:24d3eb812fd4 258 #define BASIC_BUILD_PCKTLEN0(nLength) BUILD_PCKTLEN0(nLength)
JMF 0:24d3eb812fd4 259
JMF 0:24d3eb812fd4 260
JMF 0:24d3eb812fd4 261 /**
JMF 0:24d3eb812fd4 262 * @brief Macro used to compute per upper part of the packet length
JMF 0:24d3eb812fd4 263 * for Spirit Basic packets, to write the PCKTLEN1 register.
JMF 0:24d3eb812fd4 264 * @param nLengthLength of the packet payload.
JMF 0:24d3eb812fd4 265 * This parameter is an uint16_t.
JMF 0:24d3eb812fd4 266 * @retval None.
JMF 0:24d3eb812fd4 267 */
JMF 0:24d3eb812fd4 268 #define BASIC_BUILD_PCKTLEN1(nLength) BUILD_PCKTLEN1(nLength)
JMF 0:24d3eb812fd4 269
JMF 0:24d3eb812fd4 270 /**
JMF 0:24d3eb812fd4 271 * @brief Sets the CONTROL field length for SPIRIT Basic packets.
JMF 0:24d3eb812fd4 272 * @param xControlLength length of CONTROL field in bytes.
JMF 0:24d3eb812fd4 273 * This parameter can be any value of @ref PktControlLength.
JMF 0:24d3eb812fd4 274 * @retval None.
JMF 0:24d3eb812fd4 275 */
JMF 0:24d3eb812fd4 276 #define SpiritPktBasicSetControlLength(xControlLength) SpiritPktCommonSetControlLength(xControlLength)
JMF 0:24d3eb812fd4 277
JMF 0:24d3eb812fd4 278
JMF 0:24d3eb812fd4 279 /**
JMF 0:24d3eb812fd4 280 * @brief Returns the CONTROL field length for SPIRIT Basic packets.
JMF 0:24d3eb812fd4 281 * @param None.
JMF 0:24d3eb812fd4 282 * @retval uint8_t Control field length.
JMF 0:24d3eb812fd4 283 */
JMF 0:24d3eb812fd4 284 #define SpiritPktBasicGetControlLength() SpiritPktCommonGetControlLength()
JMF 0:24d3eb812fd4 285
JMF 0:24d3eb812fd4 286
JMF 0:24d3eb812fd4 287 /**
JMF 0:24d3eb812fd4 288 * @brief Sets the PREAMBLE field length for SPIRIT Basic packets.
JMF 0:24d3eb812fd4 289 * @param xPreambleLength length of PREAMBLE field in bytes.
JMF 0:24d3eb812fd4 290 * This parameter can be any value of @ref BasicPreambleLength.
JMF 0:24d3eb812fd4 291 * @retval None.
JMF 0:24d3eb812fd4 292 */
JMF 0:24d3eb812fd4 293 #define SpiritPktBasicSetPreambleLength(xPreambleLength) SpiritPktCommonSetPreambleLength((PktPreambleLength)xPreambleLength)
JMF 0:24d3eb812fd4 294
JMF 0:24d3eb812fd4 295
JMF 0:24d3eb812fd4 296 /**
JMF 0:24d3eb812fd4 297 * @brief Returns the PREAMBLE field length mode for SPIRIT Basic packets.
JMF 0:24d3eb812fd4 298 * @param None.
JMF 0:24d3eb812fd4 299 * @retval uint8_t Preamble field length in bytes.
JMF 0:24d3eb812fd4 300 */
JMF 0:24d3eb812fd4 301 #define SpiritPktBasicGetPreambleLength() SpiritPktCommonGetPreambleLength()
JMF 0:24d3eb812fd4 302
JMF 0:24d3eb812fd4 303
JMF 0:24d3eb812fd4 304 /**
JMF 0:24d3eb812fd4 305 * @brief Sets the SYNC field length for SPIRIT Basic packets.
JMF 0:24d3eb812fd4 306 * @param xSyncLength length of SYNC field in bytes.
JMF 0:24d3eb812fd4 307 * This parameter can be any value of @ref BasicSyncLength.
JMF 0:24d3eb812fd4 308 * @retval None.
JMF 0:24d3eb812fd4 309 */
JMF 0:24d3eb812fd4 310 #define SpiritPktBasicSetSyncLength(xSyncLength) SpiritPktCommonSetSyncLength((PktSyncLength)xSyncLength)
JMF 0:24d3eb812fd4 311
JMF 0:24d3eb812fd4 312
JMF 0:24d3eb812fd4 313 /**
JMF 0:24d3eb812fd4 314 * @brief Returns the SYNC field length for SPIRIT Basic packets.
JMF 0:24d3eb812fd4 315 * @param None.
JMF 0:24d3eb812fd4 316 * @retval uint8_t SYNC field length in bytes.
JMF 0:24d3eb812fd4 317 */
JMF 0:24d3eb812fd4 318 #define SpiritPktBasicGetSyncLength() SpiritPktCommonGetSyncLength()
JMF 0:24d3eb812fd4 319
JMF 0:24d3eb812fd4 320
JMF 0:24d3eb812fd4 321 /**
JMF 0:24d3eb812fd4 322 * @brief Sets fixed or variable payload length mode for SPIRIT packets.
JMF 0:24d3eb812fd4 323 * @param xFixVarLength variable or fixed length.
JMF 0:24d3eb812fd4 324 * BASIC_FIXED_LENGTH_VAR -> variable (the length is extracted from the received packet).
JMF 0:24d3eb812fd4 325 * BASIC_FIXED_LENGTH_FIX -> fix (the length is set by PCKTLEN0 and PCKTLEN1).
JMF 0:24d3eb812fd4 326 * @retval None.
JMF 0:24d3eb812fd4 327 */
JMF 0:24d3eb812fd4 328 #define SpiritPktBasicSetFixVarLength(xFixVarLength) SpiritPktCommonSetFixVarLength((PktFixVarLength)xFixVarLength)
JMF 0:24d3eb812fd4 329
JMF 0:24d3eb812fd4 330
JMF 0:24d3eb812fd4 331 /**
JMF 0:24d3eb812fd4 332 * @brief Enables or Disables the CRC filtering.
JMF 0:24d3eb812fd4 333 * @param xNewState new state for CRC_CHECK.
JMF 0:24d3eb812fd4 334 * This parameter can be S_ENABLE or S_DISABLE.
JMF 0:24d3eb812fd4 335 * @retval None.
JMF 0:24d3eb812fd4 336 */
JMF 0:24d3eb812fd4 337 #define SpiritPktBasicFilterOnCrc(xNewState) SpiritPktCommonFilterOnCrc(xNewState)
JMF 0:24d3eb812fd4 338
JMF 0:24d3eb812fd4 339
JMF 0:24d3eb812fd4 340 /**
JMF 0:24d3eb812fd4 341 * @brief Returns the CRC filtering bit.
JMF 0:24d3eb812fd4 342 * @param None.
JMF 0:24d3eb812fd4 343 * @retval SpiritFunctionalState This parameter can be S_ENABLE or S_DISABLE.
JMF 0:24d3eb812fd4 344 */
JMF 0:24d3eb812fd4 345 #define SpiritPktBasicGetFilterOnCrc() SpiritPktCommonGetFilterOnCrc()
JMF 0:24d3eb812fd4 346
JMF 0:24d3eb812fd4 347
JMF 0:24d3eb812fd4 348 /**
JMF 0:24d3eb812fd4 349 * @brief Sets the CRC mode for SPIRIT Basic packets.
JMF 0:24d3eb812fd4 350 * @param xCrcMode CRC mode.
JMF 0:24d3eb812fd4 351 * This parameter can be any value of @ref BasicCrcMode.
JMF 0:24d3eb812fd4 352 * @retval None.
JMF 0:24d3eb812fd4 353 */
JMF 0:24d3eb812fd4 354 #define SpiritPktBasicSetCrcMode(xCrcMode) SpiritPktCommonSetCrcMode((PktCrcMode)xCrcMode)
JMF 0:24d3eb812fd4 355
JMF 0:24d3eb812fd4 356
JMF 0:24d3eb812fd4 357 /**
JMF 0:24d3eb812fd4 358 * @brief Returns the CRC mode for SPIRIT Basic packets.
JMF 0:24d3eb812fd4 359 * @param None.
JMF 0:24d3eb812fd4 360 * @retval BasicCrcMode Crc mode.
JMF 0:24d3eb812fd4 361 */
JMF 0:24d3eb812fd4 362 #define SpiritPktBasicGetCrcMode() (BasicCrcMode)SpiritPktCommonGetCrcMode()
JMF 0:24d3eb812fd4 363
JMF 0:24d3eb812fd4 364
JMF 0:24d3eb812fd4 365 /**
JMF 0:24d3eb812fd4 366 * @brief Enables or Disables WHITENING for SPIRIT packets.
JMF 0:24d3eb812fd4 367 * @param xNewState new state for WHITENING mode.
JMF 0:24d3eb812fd4 368 * This parameter can be S_ENABLE or S_DISABLE.
JMF 0:24d3eb812fd4 369 * @retval None.
JMF 0:24d3eb812fd4 370 */
JMF 0:24d3eb812fd4 371 #define SpiritPktBasicWhitening(xNewState) SpiritPktCommonWhitening(xNewState)
JMF 0:24d3eb812fd4 372
JMF 0:24d3eb812fd4 373
JMF 0:24d3eb812fd4 374 /**
JMF 0:24d3eb812fd4 375 * @brief Enables or Disables FEC for SPIRIT Basic packets.
JMF 0:24d3eb812fd4 376 * @param xNewState new state for FEC mode.
JMF 0:24d3eb812fd4 377 * This parameter can be S_ENABLE or S_DISABLE.
JMF 0:24d3eb812fd4 378 * @retval None.
JMF 0:24d3eb812fd4 379 */
JMF 0:24d3eb812fd4 380 #define SpiritPktBasicFec(xNewState) SpiritPktCommonFec(xNewState)
JMF 0:24d3eb812fd4 381
JMF 0:24d3eb812fd4 382
JMF 0:24d3eb812fd4 383 /**
JMF 0:24d3eb812fd4 384 * @brief Sets a specific SYNC word for SPIRIT Basic packets.
JMF 0:24d3eb812fd4 385 * @param xSyncX SYNC word number to be set.
JMF 0:24d3eb812fd4 386 * This parameter can be any value of @ref BasicSyncX.
JMF 0:24d3eb812fd4 387 * @param cSyncWord SYNC word.
JMF 0:24d3eb812fd4 388 * This parameter is an uint8_t.
JMF 0:24d3eb812fd4 389 * @retval None.
JMF 0:24d3eb812fd4 390 */
JMF 0:24d3eb812fd4 391 #define SpiritPktBasicSetSyncxWord(xSyncX, cSyncWord) SpiritPktCommonSetSyncxWord((PktSyncX)xSyncX, cSyncWord)
JMF 0:24d3eb812fd4 392
JMF 0:24d3eb812fd4 393
JMF 0:24d3eb812fd4 394 /**
JMF 0:24d3eb812fd4 395 * @brief Returns a specific SYNC words for SPIRIT Basic packets.
JMF 0:24d3eb812fd4 396 * @param xSyncX SYNC word number to be get.
JMF 0:24d3eb812fd4 397 * This parameter can be any value of @ref BasicSyncX.
JMF 0:24d3eb812fd4 398 * @retval uint8_t Sync word x.
JMF 0:24d3eb812fd4 399 */
JMF 0:24d3eb812fd4 400 #define SpiritPktBasicGetSyncxWord(xSyncX) SpiritPktCommonGetSyncxWord(xSyncX)
JMF 0:24d3eb812fd4 401
JMF 0:24d3eb812fd4 402
JMF 0:24d3eb812fd4 403 /**
JMF 0:24d3eb812fd4 404 * @brief Sets multiple SYNC words for SPIRIT Basic packets.
JMF 0:24d3eb812fd4 405 * @param lSyncWords SYNC words to be set with format: 0x|SYNC1|SYNC2|SYNC3|SYNC4|.
JMF 0:24d3eb812fd4 406 * This parameter is a uint32_t.
JMF 0:24d3eb812fd4 407 * @param xSyncLength SYNC length in bytes. The 32bit word passed will be stored in the SYNCx registers from the MSb
JMF 0:24d3eb812fd4 408 * until the number of bytes in xSyncLength has been stored.
JMF 0:24d3eb812fd4 409 * This parameter is a @ref BasicSyncLength.
JMF 0:24d3eb812fd4 410 * @retval None.
JMF 0:24d3eb812fd4 411 */
JMF 0:24d3eb812fd4 412 #define SpiritPktBasicSetSyncWords(lSyncWords, xSyncLength) SpiritPktCommonSetSyncWords(lSyncWords, (PktSyncLength)xSyncLength)
JMF 0:24d3eb812fd4 413
JMF 0:24d3eb812fd4 414
JMF 0:24d3eb812fd4 415 /**
JMF 0:24d3eb812fd4 416 * @brief Returns multiple SYNC words for SPIRIT Basic packets.
JMF 0:24d3eb812fd4 417 * @param xSyncLength SYNC length in bytes. The 32bit word passed will be stored in the SYNCx registers from the MSb
JMF 0:24d3eb812fd4 418 * until the number of bytes in xSyncLength has been stored.
JMF 0:24d3eb812fd4 419 * This parameter is a pointer to @ref BasicSyncLength.
JMF 0:24d3eb812fd4 420 * @retval uint32_t Sync words. The format of the read 32 bit word is 0x|SYNC1|SYNC2|SYNC3|SYNC4|.
JMF 0:24d3eb812fd4 421 */
JMF 0:24d3eb812fd4 422 #define SpiritPktBasicGetSyncWords(xSyncLength) SpiritPktCommonGetSyncWords((PktSyncLength)xSyncLength)
JMF 0:24d3eb812fd4 423
JMF 0:24d3eb812fd4 424
JMF 0:24d3eb812fd4 425 /**
JMF 0:24d3eb812fd4 426 * @brief Returns the SPIRIT variable length width (in number of bits).
JMF 0:24d3eb812fd4 427 * @param None.
JMF 0:24d3eb812fd4 428 * @retval Variable length width in bits.
JMF 0:24d3eb812fd4 429 */
JMF 0:24d3eb812fd4 430 #define SpiritPktBasicGetVarLengthWidth() SpiritPktCommonGetVarLengthWidth()
JMF 0:24d3eb812fd4 431
JMF 0:24d3eb812fd4 432
JMF 0:24d3eb812fd4 433 /**
JMF 0:24d3eb812fd4 434 * @brief Sets the destination address for the Tx packet.
JMF 0:24d3eb812fd4 435 * @param cAddress destination address.
JMF 0:24d3eb812fd4 436 * This parameter is an uint8_t.
JMF 0:24d3eb812fd4 437 * @retval None.
JMF 0:24d3eb812fd4 438 */
JMF 0:24d3eb812fd4 439 #define SpiritPktBasicSetDestinationAddress(cAddress) SpiritPktCommonSetDestinationAddress(cAddress)
JMF 0:24d3eb812fd4 440
JMF 0:24d3eb812fd4 441
JMF 0:24d3eb812fd4 442 /**
JMF 0:24d3eb812fd4 443 * @brief Returns the settled destination address.
JMF 0:24d3eb812fd4 444 * @param None.
JMF 0:24d3eb812fd4 445 * @retval uint8_t Transmitted destination address.
JMF 0:24d3eb812fd4 446 */
JMF 0:24d3eb812fd4 447 #define SpiritPktBasicGetTransmittedDestAddress() SpiritPktCommonGetTransmittedDestAddress()
JMF 0:24d3eb812fd4 448
JMF 0:24d3eb812fd4 449
JMF 0:24d3eb812fd4 450 /**
JMF 0:24d3eb812fd4 451 * @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 452 * my address, then the packet is accepted (this is the address of the node).
JMF 0:24d3eb812fd4 453 * @param cAddress Address of the present node.
JMF 0:24d3eb812fd4 454 * This parameter is an uint8_t.
JMF 0:24d3eb812fd4 455 * @retval None.
JMF 0:24d3eb812fd4 456 */
JMF 0:24d3eb812fd4 457 #define SpiritPktBasicSetMyAddress(cAddress) SpiritPktCommonSetMyAddress(cAddress)
JMF 0:24d3eb812fd4 458
JMF 0:24d3eb812fd4 459
JMF 0:24d3eb812fd4 460 /**
JMF 0:24d3eb812fd4 461 * @brief Returns the address of the present node.
JMF 0:24d3eb812fd4 462 * @param None.
JMF 0:24d3eb812fd4 463 * @retval uint8_t My address (address of this node).
JMF 0:24d3eb812fd4 464 */
JMF 0:24d3eb812fd4 465 #define SpiritPktBasicGetMyAddress() SpiritPktCommonGetMyAddress()
JMF 0:24d3eb812fd4 466
JMF 0:24d3eb812fd4 467
JMF 0:24d3eb812fd4 468 /**
JMF 0:24d3eb812fd4 469 * @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 470 * BROADCAST_ADDR register, then the packet is accepted.
JMF 0:24d3eb812fd4 471 * @param cAddress Broadcast address.
JMF 0:24d3eb812fd4 472 * This parameter is an uint8_t.
JMF 0:24d3eb812fd4 473 * @retval None.
JMF 0:24d3eb812fd4 474 */
JMF 0:24d3eb812fd4 475 #define SpiritPktBasicSetBroadcastAddress(cAddress) SpiritPktCommonSetBroadcastAddress(cAddress)
JMF 0:24d3eb812fd4 476
JMF 0:24d3eb812fd4 477
JMF 0:24d3eb812fd4 478 /**
JMF 0:24d3eb812fd4 479 * @brief Returns the broadcast address.
JMF 0:24d3eb812fd4 480 * @param None.
JMF 0:24d3eb812fd4 481 * @retval uint8_t Broadcast address.
JMF 0:24d3eb812fd4 482 */
JMF 0:24d3eb812fd4 483 #define SpiritPktBasicGetBroadcastAddress() SpiritPktCommonGetBroadcastAddress()
JMF 0:24d3eb812fd4 484
JMF 0:24d3eb812fd4 485
JMF 0:24d3eb812fd4 486 /**
JMF 0:24d3eb812fd4 487 * @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 488 * MULTICAST_ADDR register, then the packet is accepted.
JMF 0:24d3eb812fd4 489 * @param cAddress Multicast address.
JMF 0:24d3eb812fd4 490 * This parameter is an uint8_t.
JMF 0:24d3eb812fd4 491 * @retval None.
JMF 0:24d3eb812fd4 492 */
JMF 0:24d3eb812fd4 493 #define SpiritPktBasicSetMulticastAddress(cAddress) SpiritPktCommonSetMulticastAddress(cAddress)
JMF 0:24d3eb812fd4 494
JMF 0:24d3eb812fd4 495
JMF 0:24d3eb812fd4 496 /**
JMF 0:24d3eb812fd4 497 * @brief Returns the multicast address.
JMF 0:24d3eb812fd4 498 * @param None.
JMF 0:24d3eb812fd4 499 * @retval uint8_t Multicast address.
JMF 0:24d3eb812fd4 500 */
JMF 0:24d3eb812fd4 501 #define SpiritPktBasicGetMulticastAddress() SpiritPktCommonGetMulticastAddress()
JMF 0:24d3eb812fd4 502
JMF 0:24d3eb812fd4 503
JMF 0:24d3eb812fd4 504 /**
JMF 0:24d3eb812fd4 505 * @brief Sets the control mask. The 1 bits of the CONTROL_MASK indicate the
JMF 0:24d3eb812fd4 506 * bits to be used in filtering. (All 0s no filtering)
JMF 0:24d3eb812fd4 507 * @param lMask Control mask.
JMF 0:24d3eb812fd4 508 * This parameter is an uint32_t.
JMF 0:24d3eb812fd4 509 * @retval None.
JMF 0:24d3eb812fd4 510 */
JMF 0:24d3eb812fd4 511 #define SpiritPktBasicSetCtrlMask(lMask) SpiritPktCommonSetCtrlMask(lMask)
JMF 0:24d3eb812fd4 512
JMF 0:24d3eb812fd4 513
JMF 0:24d3eb812fd4 514 /**
JMF 0:24d3eb812fd4 515 * @brief Returns the control mask. The 1 bits of the CONTROL_MASK indicate the
JMF 0:24d3eb812fd4 516 * bits to be used in filtering. (All 0s no filtering)
JMF 0:24d3eb812fd4 517 * @param None.
JMF 0:24d3eb812fd4 518 * @retval uint32_t Control mask.
JMF 0:24d3eb812fd4 519 */
JMF 0:24d3eb812fd4 520 #define SpiritPktBasicGetCtrlMask() SpiritPktCommonGetCtrlMask()
JMF 0:24d3eb812fd4 521
JMF 0:24d3eb812fd4 522
JMF 0:24d3eb812fd4 523 /**
JMF 0:24d3eb812fd4 524 * @brief Sets the control field reference. If the bits enabled by the
JMF 0:24d3eb812fd4 525 * CONTROL_MASK match the ones of the control fields extracted from the received packet
JMF 0:24d3eb812fd4 526 * then the packet is accepted.
JMF 0:24d3eb812fd4 527 * @param lReference Control reference.
JMF 0:24d3eb812fd4 528 * This parameter is an uint32_t.
JMF 0:24d3eb812fd4 529 * @retval None.
JMF 0:24d3eb812fd4 530 */
JMF 0:24d3eb812fd4 531 #define SpiritPktBasicSetCtrlReference(lReference) SpiritPktCommonSetCtrlReference(lReference)
JMF 0:24d3eb812fd4 532
JMF 0:24d3eb812fd4 533
JMF 0:24d3eb812fd4 534 /**
JMF 0:24d3eb812fd4 535 * @brief Returns the control field reference.
JMF 0:24d3eb812fd4 536 * @param None.
JMF 0:24d3eb812fd4 537 * @retval uint32_t Control reference.
JMF 0:24d3eb812fd4 538 */
JMF 0:24d3eb812fd4 539 #define SpiritPktBasicGetCtrlReference() SpiritPktCommonGetCtrlReference()
JMF 0:24d3eb812fd4 540
JMF 0:24d3eb812fd4 541
JMF 0:24d3eb812fd4 542 /**
JMF 0:24d3eb812fd4 543 * @brief Sets the TX control field.
JMF 0:24d3eb812fd4 544 * @param lField Tx control field.
JMF 0:24d3eb812fd4 545 * This parameter is an uint32_t.
JMF 0:24d3eb812fd4 546 * @retval None.
JMF 0:24d3eb812fd4 547 */
JMF 0:24d3eb812fd4 548 #define SpiritPktBasicSetTransmittedCtrlField(lField) SpiritPktCommonSetTransmittedCtrlField(lField)
JMF 0:24d3eb812fd4 549
JMF 0:24d3eb812fd4 550
JMF 0:24d3eb812fd4 551 /**
JMF 0:24d3eb812fd4 552 * @brief Returns the TX control field.
JMF 0:24d3eb812fd4 553 * @param None.
JMF 0:24d3eb812fd4 554 * @retval uint32_t Control field of the transmitted packet.
JMF 0:24d3eb812fd4 555 */
JMF 0:24d3eb812fd4 556 #define SpiritPktBasicGetTransmittedCtrlField() SpiritPktCommonGetTransmittedCtrlField()
JMF 0:24d3eb812fd4 557
JMF 0:24d3eb812fd4 558
JMF 0:24d3eb812fd4 559 /**
JMF 0:24d3eb812fd4 560 * @brief If enabled RX packet is accepted if its destination address matches with My address.
JMF 0:24d3eb812fd4 561 * @param xNewState new state for DEST_VS_SOURCE_ADDRESS.
JMF 0:24d3eb812fd4 562 * This parameter can be S_ENABLE or S_DISABLE.
JMF 0:24d3eb812fd4 563 * @retval None.
JMF 0:24d3eb812fd4 564 */
JMF 0:24d3eb812fd4 565 #define SpiritPktBasicFilterOnMyAddress(xNewState) SpiritPktCommonFilterOnMyAddress(xNewState)
JMF 0:24d3eb812fd4 566
JMF 0:24d3eb812fd4 567
JMF 0:24d3eb812fd4 568 /**
JMF 0:24d3eb812fd4 569 * @brief If enabled RX packet is accepted if its destination address matches with multicast address.
JMF 0:24d3eb812fd4 570 * @param xNewState new state for DEST_VS_MULTICAST_ADDRESS.
JMF 0:24d3eb812fd4 571 * This parameter can be S_ENABLE or S_DISABLE.
JMF 0:24d3eb812fd4 572 * @retval None.
JMF 0:24d3eb812fd4 573 */
JMF 0:24d3eb812fd4 574 #define SpiritPktBasicFilterOnMulticastAddress(xNewState) SpiritPktCommonFilterOnMulticastAddress(xNewState)
JMF 0:24d3eb812fd4 575
JMF 0:24d3eb812fd4 576
JMF 0:24d3eb812fd4 577 /**
JMF 0:24d3eb812fd4 578 * @brief If enabled RX packet is accepted if its destination address matches with broadcast address.
JMF 0:24d3eb812fd4 579 * @param xNewState new state for DEST_VS_BROADCAST_ADDRESS.
JMF 0:24d3eb812fd4 580 * This parameter can be S_ENABLE or S_DISABLE.
JMF 0:24d3eb812fd4 581 * @retval None.
JMF 0:24d3eb812fd4 582 */
JMF 0:24d3eb812fd4 583 #define SpiritPktBasicFilterOnBroadcastAddress(xNewState) SpiritPktCommonFilterOnBroadcastAddress(xNewState)
JMF 0:24d3eb812fd4 584
JMF 0:24d3eb812fd4 585
JMF 0:24d3eb812fd4 586 /**
JMF 0:24d3eb812fd4 587 * @brief Returns the enable bit of the my address filtering.
JMF 0:24d3eb812fd4 588 * @param None.
JMF 0:24d3eb812fd4 589 * @retval SpiritFunctionalState This parameter can be S_ENABLE or S_DISABLE.
JMF 0:24d3eb812fd4 590 */
JMF 0:24d3eb812fd4 591 #define SpiritPktBasicGetFilterOnMyAddress() SpiritPktCommonGetFilterOnMyAddress();
JMF 0:24d3eb812fd4 592
JMF 0:24d3eb812fd4 593
JMF 0:24d3eb812fd4 594 /**
JMF 0:24d3eb812fd4 595 * @brief Returns the enable bit of the multicast address filtering.
JMF 0:24d3eb812fd4 596 * @param None.
JMF 0:24d3eb812fd4 597 * @retval SpiritFunctionalState This parameter can be S_ENABLE or S_DISABLE.
JMF 0:24d3eb812fd4 598 */
JMF 0:24d3eb812fd4 599 #define SpiritPktBasicGetFilterOnMulticastAddress() SpiritPktCommonGetFilterOnMulticastAddress();
JMF 0:24d3eb812fd4 600
JMF 0:24d3eb812fd4 601
JMF 0:24d3eb812fd4 602 /**
JMF 0:24d3eb812fd4 603 * @brief Returns the enable bit of the broadcast address filtering.
JMF 0:24d3eb812fd4 604 * @param None.
JMF 0:24d3eb812fd4 605 * @retval SpiritFunctionalState This parameter can be S_ENABLE or S_DISABLE.
JMF 0:24d3eb812fd4 606 */
JMF 0:24d3eb812fd4 607 #define SpiritPktBasicGetFilterOnBroadcastAddress() SpiritPktCommonGetFilterOnBroadcastAddress();
JMF 0:24d3eb812fd4 608
JMF 0:24d3eb812fd4 609
JMF 0:24d3eb812fd4 610 /**
JMF 0:24d3eb812fd4 611 * @brief Returns the destination address of the received packet.
JMF 0:24d3eb812fd4 612 * @param None.
JMF 0:24d3eb812fd4 613 * @retval uint8_t Destination address of the received packet.
JMF 0:24d3eb812fd4 614 */
JMF 0:24d3eb812fd4 615 #define SpiritPktBasicGetReceivedDestAddress() SpiritPktCommonGetReceivedDestAddress()
JMF 0:24d3eb812fd4 616
JMF 0:24d3eb812fd4 617
JMF 0:24d3eb812fd4 618 /**
JMF 0:24d3eb812fd4 619 * @brief Returns the control field of the received packet.
JMF 0:24d3eb812fd4 620 * @param None.
JMF 0:24d3eb812fd4 621 * @retval uint32_t Received control field.
JMF 0:24d3eb812fd4 622 */
JMF 0:24d3eb812fd4 623 #define SpiritPktBasicGetReceivedCtrlField() SpiritPktCommonGetReceivedCtrlField()
JMF 0:24d3eb812fd4 624
JMF 0:24d3eb812fd4 625
JMF 0:24d3eb812fd4 626 /**
JMF 0:24d3eb812fd4 627 * @brief Returns the CRC field of the received packet.
JMF 0:24d3eb812fd4 628 * @param cCrcFieldVect array in which the CRC field has to be stored.
JMF 0:24d3eb812fd4 629 * This parameter is an uint8_t array of 3 elements.
JMF 0:24d3eb812fd4 630 * @retval None.
JMF 0:24d3eb812fd4 631 */
JMF 0:24d3eb812fd4 632 #define SpiritPktBasicGetReceivedCrcField(cCrcFieldVect) SpiritPktCommonGetReceivedCrcField(cCrcFieldVect)
JMF 0:24d3eb812fd4 633
JMF 0:24d3eb812fd4 634
JMF 0:24d3eb812fd4 635 /**
JMF 0:24d3eb812fd4 636 * @brief If enabled RX packet is accepted only if the masked control field matches the
JMF 0:24d3eb812fd4 637 * masked control field reference (CONTROL_MASK & CONTROL_FIELD_REF == CONTROL_MASK & RX_CONTROL_FIELD).
JMF 0:24d3eb812fd4 638 * @param xNewState new state for Control filtering enable bit.
JMF 0:24d3eb812fd4 639 * This parameter can be S_ENABLE or S_DISABLE.
JMF 0:24d3eb812fd4 640 * @retval None.
JMF 0:24d3eb812fd4 641 * @note This filtering control is enabled by default but the control mask is by default set to 0.
JMF 0:24d3eb812fd4 642 * As a matter of fact the user has to enable the control filtering bit after the packet initialization
JMF 0:24d3eb812fd4 643 * because the PktInit routine disables it.
JMF 0:24d3eb812fd4 644 */
JMF 0:24d3eb812fd4 645 #define SpiritPktBasicFilterOnControlField(xNewState) SpiritPktCommonFilterOnControlField(xNewState)
JMF 0:24d3eb812fd4 646
JMF 0:24d3eb812fd4 647
JMF 0:24d3eb812fd4 648 /**
JMF 0:24d3eb812fd4 649 * @brief Returns the enable bit of the control field filtering.
JMF 0:24d3eb812fd4 650 * @param None.
JMF 0:24d3eb812fd4 651 * @retval SpiritFunctionalState This parameter can be S_ENABLE or S_DISABLE.
JMF 0:24d3eb812fd4 652 */
JMF 0:24d3eb812fd4 653 #define SpiritPktBasicGetFilterOnControlField() SpiritPktCommonGetFilterOnControlField();
JMF 0:24d3eb812fd4 654
JMF 0:24d3eb812fd4 655 /**
JMF 0:24d3eb812fd4 656 *@}
JMF 0:24d3eb812fd4 657 */
JMF 0:24d3eb812fd4 658
JMF 0:24d3eb812fd4 659
JMF 0:24d3eb812fd4 660 /**
JMF 0:24d3eb812fd4 661 * @defgroup PktBasic_Exported_Functions Pkt Basic Exported Functions
JMF 0:24d3eb812fd4 662 * @{
JMF 0:24d3eb812fd4 663 */
JMF 0:24d3eb812fd4 664
JMF 0:24d3eb812fd4 665 void SpiritPktBasicInit(PktBasicInit* pxPktBasicInit);
JMF 0:24d3eb812fd4 666 void SpiritPktBasicGetInfo(PktBasicInit* pxPktBasicInit);
JMF 0:24d3eb812fd4 667 void SpiritPktBasicAddressesInit(PktBasicAddressesInit* pxPktBasicAddresses);
JMF 0:24d3eb812fd4 668 void SpiritPktBasicGetAddressesInfo(PktBasicAddressesInit* pxPktBasicAddresses);
JMF 0:24d3eb812fd4 669 void SpiritPktBasicSetFormat(void);
JMF 0:24d3eb812fd4 670 void SpiritPktBasicAddressField(SpiritFunctionalState xAddressField);
JMF 0:24d3eb812fd4 671 SpiritFunctionalState SpiritPktBasicGetAddressField(void);
JMF 0:24d3eb812fd4 672 void SpiritPktBasicSetPayloadLength(uint16_t nPayloadLength);
JMF 0:24d3eb812fd4 673 uint16_t SpiritPktBasicGetPayloadLength(void);
JMF 0:24d3eb812fd4 674 uint16_t SpiritPktBasicGetReceivedPktLength(void);
JMF 0:24d3eb812fd4 675 void SpiritPktBasicSetVarLengthWidth(uint16_t nMaxPayloadLength,SpiritFunctionalState xAddressField, BasicControlLength xControlLength);
JMF 0:24d3eb812fd4 676
JMF 0:24d3eb812fd4 677 /**
JMF 0:24d3eb812fd4 678 *@}
JMF 0:24d3eb812fd4 679 */
JMF 0:24d3eb812fd4 680
JMF 0:24d3eb812fd4 681 /**
JMF 0:24d3eb812fd4 682 *@}
JMF 0:24d3eb812fd4 683 */
JMF 0:24d3eb812fd4 684
JMF 0:24d3eb812fd4 685
JMF 0:24d3eb812fd4 686 /**
JMF 0:24d3eb812fd4 687 *@}
JMF 0:24d3eb812fd4 688 */
JMF 0:24d3eb812fd4 689
JMF 0:24d3eb812fd4 690 #ifdef __cplusplus
JMF 0:24d3eb812fd4 691 }
JMF 0:24d3eb812fd4 692 #endif
JMF 0:24d3eb812fd4 693
JMF 0:24d3eb812fd4 694 #endif
JMF 0:24d3eb812fd4 695
JMF 0:24d3eb812fd4 696 /******************* (C) COPYRIGHT 2015 STMicroelectronics *****END OF FILE****/