Fork of my MQTTGateway

Dependencies:   mbed-http

Committer:
vpcola
Date:
Sat Apr 08 14:45:51 2017 +0000
Revision:
0:f1d3878b8dd9
Initial commit

Who changed what in which revision?

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