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