Added support for the WNC M14A2A Cellular LTE Data Module.

Dependencies:   WNC14A2AInterface

Easy Connect

Easily add all supported connectivity methods to your mbed OS project

This project is derived from https://developer.mbed.org/teams/sandbox/code/simple-mbed-client-example/file/dd6231df71bb/easy-connect.lib. It give user the ability to switch between connectivity methods and includes support for the WNC14A2A Data Module. The `NetworkInterface` API makes this easy, but you still need a mechanism for the user to select the connection method, The selection is made by modifying the `mbed_app.json` file and using `easy_connect()` from your application.

Specifying connectivity method

To add support for the WNC14A2A, add the following to your ``mbed_app.json`` file:

mbed_app.json

{
    "config": {
        "network-interface":{
            "help": "options are ETHERNET,WIFI_ESP8266,WIFI_ODIN,MESH_LOWPAN_ND,MESH_THREAD,WNC14A2A",
            "value": "WNC14A2A"
        }
    },
}

After you choose `WNC14A2A` you'll also need to indicate if you want debug output or not by Enabling (true) or Disabling (false) WNC_DEBUG.

If WNC_DEBUG is enabled, there are 3 different levels of debug output (selected via bit settings). These debug levels are set using the following values:

ValueDescription
1Basic WNC driver debug output
2Comprehensive WNC driver debug output
4Network Layer debug output

You can have any combination of these three bit values for a total value of 0 – 7.

WNC Debug Settings

    "config": {
        "WNC_DEBUG": {
            "value": false
        },
        "WNC_DEBUG_SETTING": {
            "value": 4
        },
    }

Using Easy Connect from your application

Easy Connect has just one function which will either return a `NetworkInterface`-pointer or `NULL`:

Sample Code

#include "easy-connect.h"

int main(int, char**) {
    NetworkInterface* network = easy_connect(true); /* has 1 argument, enable_logging (pass in true to log to serial port) */
    if (!network) {
        printf("Connecting to the network failed... See serial output.\r\n");
        return 1;
    }
 
    // Rest of your program
}

Tested on

  • K64F with Ethernet.
  • AT&T Cellular IoT Starter Kit with WNC M14A2A Cellular Data Module

The WNCInterface class currently supports the following version(s):

  • MPSS: M14A2A_v11.50.164451 APSS: M14A2A_v11.53.164451

License

This library is released under the Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License and may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Committer:
group-Avnet
Date:
Wed Apr 19 01:08:11 2017 +0000
Revision:
0:478cfd88041f
Initial commit

Who changed what in which revision?

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