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:
| Value | Description |
|---|---|
| 1 | Basic WNC driver debug output |
| 2 | Comprehensive WNC driver debug output |
| 4 | Network 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.
stm-spirit1-rf-driver/source/libs/spirit1/SPIRIT1_Library/Inc/SPIRIT_Radio.h@0:478cfd88041f, 2017-04-19 (annotated)
- Committer:
- group-Avnet
- Date:
- Wed Apr 19 01:08:11 2017 +0000
- Revision:
- 0:478cfd88041f
Initial commit
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| group-Avnet | 0:478cfd88041f | 1 | /** |
| group-Avnet | 0:478cfd88041f | 2 | ****************************************************************************** |
| group-Avnet | 0:478cfd88041f | 3 | * @file SPIRIT_Radio.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 This file provides all the low level API to manage Analog and Digital |
| group-Avnet | 0:478cfd88041f | 8 | * radio part of SPIRIT. |
| group-Avnet | 0:478cfd88041f | 9 | * @details |
| group-Avnet | 0:478cfd88041f | 10 | * |
| group-Avnet | 0:478cfd88041f | 11 | * In order to configure the Radio main parameters, the user can |
| group-Avnet | 0:478cfd88041f | 12 | * fit <i>SRadioInit</i> structure the and call the <i>SpiritRadioInit()</i> |
| group-Avnet | 0:478cfd88041f | 13 | * function passing its pointer as an argument. |
| group-Avnet | 0:478cfd88041f | 14 | * |
| group-Avnet | 0:478cfd88041f | 15 | * <b>Example:</b> |
| group-Avnet | 0:478cfd88041f | 16 | * @code |
| group-Avnet | 0:478cfd88041f | 17 | * |
| group-Avnet | 0:478cfd88041f | 18 | * SRadioInit radioInit = { |
| group-Avnet | 0:478cfd88041f | 19 | * 0, // Xtal offset in ppm |
| group-Avnet | 0:478cfd88041f | 20 | * 433.4e6, // base frequency |
| group-Avnet | 0:478cfd88041f | 21 | * 20e3, // channel space |
| group-Avnet | 0:478cfd88041f | 22 | * 0, // channel number |
| group-Avnet | 0:478cfd88041f | 23 | * FSK, // modulation select |
| group-Avnet | 0:478cfd88041f | 24 | * 38400, // datarate |
| group-Avnet | 0:478cfd88041f | 25 | * 20e3, // frequency deviation |
| group-Avnet | 0:478cfd88041f | 26 | * 100.5e3 // channel filter bandwidth |
| group-Avnet | 0:478cfd88041f | 27 | * }; |
| group-Avnet | 0:478cfd88041f | 28 | * |
| group-Avnet | 0:478cfd88041f | 29 | * ... |
| group-Avnet | 0:478cfd88041f | 30 | * |
| group-Avnet | 0:478cfd88041f | 31 | * SpiritRadioInit(&radioInit); |
| group-Avnet | 0:478cfd88041f | 32 | * @endcode |
| group-Avnet | 0:478cfd88041f | 33 | * |
| group-Avnet | 0:478cfd88041f | 34 | * Another important parameter for the radio configuration is the |
| group-Avnet | 0:478cfd88041f | 35 | * transmission power. |
| group-Avnet | 0:478cfd88041f | 36 | * The user is allowed to configure it using the function <i>SpiritRadioSetPALeveldBm()</i> |
| group-Avnet | 0:478cfd88041f | 37 | * which sets the PA LEVEL specified by the first argument to the |
| group-Avnet | 0:478cfd88041f | 38 | * power expressed in dBm by the second parameter. |
| group-Avnet | 0:478cfd88041f | 39 | * |
| group-Avnet | 0:478cfd88041f | 40 | * <b>Example:</b> |
| group-Avnet | 0:478cfd88041f | 41 | * @code |
| group-Avnet | 0:478cfd88041f | 42 | * |
| group-Avnet | 0:478cfd88041f | 43 | * SpiritRadioSetPALeveldBm(0 , 10.0); |
| group-Avnet | 0:478cfd88041f | 44 | * |
| group-Avnet | 0:478cfd88041f | 45 | * @endcode |
| group-Avnet | 0:478cfd88041f | 46 | * |
| group-Avnet | 0:478cfd88041f | 47 | * |
| group-Avnet | 0:478cfd88041f | 48 | * @note The effective power that is set can be a little different from the |
| group-Avnet | 0:478cfd88041f | 49 | * passed argument in dBm because the function performs an approximation. |
| group-Avnet | 0:478cfd88041f | 50 | * |
| group-Avnet | 0:478cfd88041f | 51 | |
| group-Avnet | 0:478cfd88041f | 52 | * @attention |
| group-Avnet | 0:478cfd88041f | 53 | * |
| group-Avnet | 0:478cfd88041f | 54 | * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> |
| group-Avnet | 0:478cfd88041f | 55 | * |
| group-Avnet | 0:478cfd88041f | 56 | * Redistribution and use in source and binary forms, with or without modification, |
| group-Avnet | 0:478cfd88041f | 57 | * are permitted provided that the following conditions are met: |
| group-Avnet | 0:478cfd88041f | 58 | * 1. Redistributions of source code must retain the above copyright notice, |
| group-Avnet | 0:478cfd88041f | 59 | * this list of conditions and the following disclaimer. |
| group-Avnet | 0:478cfd88041f | 60 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
| group-Avnet | 0:478cfd88041f | 61 | * this list of conditions and the following disclaimer in the documentation |
| group-Avnet | 0:478cfd88041f | 62 | * and/or other materials provided with the distribution. |
| group-Avnet | 0:478cfd88041f | 63 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
| group-Avnet | 0:478cfd88041f | 64 | * may be used to endorse or promote products derived from this software |
| group-Avnet | 0:478cfd88041f | 65 | * without specific prior written permission. |
| group-Avnet | 0:478cfd88041f | 66 | * |
| group-Avnet | 0:478cfd88041f | 67 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| group-Avnet | 0:478cfd88041f | 68 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| group-Avnet | 0:478cfd88041f | 69 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| group-Avnet | 0:478cfd88041f | 70 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
| group-Avnet | 0:478cfd88041f | 71 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| group-Avnet | 0:478cfd88041f | 72 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| group-Avnet | 0:478cfd88041f | 73 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| group-Avnet | 0:478cfd88041f | 74 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| group-Avnet | 0:478cfd88041f | 75 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| group-Avnet | 0:478cfd88041f | 76 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| group-Avnet | 0:478cfd88041f | 77 | * |
| group-Avnet | 0:478cfd88041f | 78 | ****************************************************************************** |
| group-Avnet | 0:478cfd88041f | 79 | */ |
| group-Avnet | 0:478cfd88041f | 80 | |
| group-Avnet | 0:478cfd88041f | 81 | /* Define to prevent recursive inclusion -------------------------------------*/ |
| group-Avnet | 0:478cfd88041f | 82 | #ifndef __SPIRIT_RADIO_H |
| group-Avnet | 0:478cfd88041f | 83 | #define __SPIRIT_RADIO_H |
| group-Avnet | 0:478cfd88041f | 84 | |
| group-Avnet | 0:478cfd88041f | 85 | |
| group-Avnet | 0:478cfd88041f | 86 | /* Includes ------------------------------------------------------------------*/ |
| group-Avnet | 0:478cfd88041f | 87 | |
| group-Avnet | 0:478cfd88041f | 88 | #include "SPIRIT_Regs.h" |
| group-Avnet | 0:478cfd88041f | 89 | #include "SPIRIT_Types.h" |
| group-Avnet | 0:478cfd88041f | 90 | #include "SPIRIT_Config.h" |
| group-Avnet | 0:478cfd88041f | 91 | |
| group-Avnet | 0:478cfd88041f | 92 | |
| group-Avnet | 0:478cfd88041f | 93 | #ifdef __cplusplus |
| group-Avnet | 0:478cfd88041f | 94 | extern "C" { |
| group-Avnet | 0:478cfd88041f | 95 | #endif |
| group-Avnet | 0:478cfd88041f | 96 | |
| group-Avnet | 0:478cfd88041f | 97 | |
| group-Avnet | 0:478cfd88041f | 98 | /** @addtogroup SPIRIT_Libraries |
| group-Avnet | 0:478cfd88041f | 99 | * @{ |
| group-Avnet | 0:478cfd88041f | 100 | */ |
| group-Avnet | 0:478cfd88041f | 101 | |
| group-Avnet | 0:478cfd88041f | 102 | |
| group-Avnet | 0:478cfd88041f | 103 | /** @defgroup SPIRIT_Radio Radio |
| group-Avnet | 0:478cfd88041f | 104 | * @brief Configuration and management of SPIRIT RF Analog and Digital part. |
| group-Avnet | 0:478cfd88041f | 105 | * @details See the file <i>@ref SPIRIT_Radio.h</i> for more details. |
| 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 | |
| group-Avnet | 0:478cfd88041f | 111 | /** @defgroup Radio_Exported_Types Radio Exported Types |
| 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 | /** |
| group-Avnet | 0:478cfd88041f | 117 | * @brief SPIRIT XTAL frequency enumeration |
| group-Avnet | 0:478cfd88041f | 118 | */ |
| group-Avnet | 0:478cfd88041f | 119 | typedef enum |
| group-Avnet | 0:478cfd88041f | 120 | { |
| group-Avnet | 0:478cfd88041f | 121 | XTAL_FLAG_24_MHz = 0x00, /*!< 24 MHz Xtal selected */ |
| group-Avnet | 0:478cfd88041f | 122 | XTAL_FLAG_26_MHz = 0x01 /*!< 26 MHz Xtal selected */ |
| group-Avnet | 0:478cfd88041f | 123 | |
| group-Avnet | 0:478cfd88041f | 124 | }XtalFlag; |
| group-Avnet | 0:478cfd88041f | 125 | |
| group-Avnet | 0:478cfd88041f | 126 | |
| group-Avnet | 0:478cfd88041f | 127 | #define IS_XTAL_FLAG(FLAG) (((FLAG) == XTAL_FLAG_24_MHz) || \ |
| group-Avnet | 0:478cfd88041f | 128 | ((FLAG) == XTAL_FLAG_26_MHz)) |
| group-Avnet | 0:478cfd88041f | 129 | |
| group-Avnet | 0:478cfd88041f | 130 | /** |
| group-Avnet | 0:478cfd88041f | 131 | * @brief SPIRIT Band enumeration |
| group-Avnet | 0:478cfd88041f | 132 | */ |
| group-Avnet | 0:478cfd88041f | 133 | typedef enum |
| group-Avnet | 0:478cfd88041f | 134 | { |
| group-Avnet | 0:478cfd88041f | 135 | HIGH_BAND = 0x00, /*!< High_Band selected: from 779 MHz to 915 MHz */ |
| group-Avnet | 0:478cfd88041f | 136 | MIDDLE_BAND = 0x01, /*!< Middle Band selected: from 387 MHz to 470 MHz */ |
| group-Avnet | 0:478cfd88041f | 137 | LOW_BAND = 0x02, /*!< Low Band selected: from 300 MHz to 348 MHz */ |
| group-Avnet | 0:478cfd88041f | 138 | VERY_LOW_BAND = 0x03 /*!< Vary low Band selected: from 150 MHz to 174 MHz */ |
| group-Avnet | 0:478cfd88041f | 139 | }BandSelect; |
| group-Avnet | 0:478cfd88041f | 140 | |
| group-Avnet | 0:478cfd88041f | 141 | |
| group-Avnet | 0:478cfd88041f | 142 | #define IS_BAND_SELECTED(BAND) ((BAND == HIGH_BAND) || \ |
| group-Avnet | 0:478cfd88041f | 143 | (BAND == MIDDLE_BAND) || \ |
| group-Avnet | 0:478cfd88041f | 144 | (BAND == LOW_BAND) || \ |
| group-Avnet | 0:478cfd88041f | 145 | (BAND == VERY_LOW_BAND)) |
| group-Avnet | 0:478cfd88041f | 146 | |
| group-Avnet | 0:478cfd88041f | 147 | /** |
| group-Avnet | 0:478cfd88041f | 148 | * @brief SPIRIT Modulation enumeration |
| group-Avnet | 0:478cfd88041f | 149 | */ |
| group-Avnet | 0:478cfd88041f | 150 | typedef enum |
| group-Avnet | 0:478cfd88041f | 151 | { |
| group-Avnet | 0:478cfd88041f | 152 | FSK = 0x00, /*!< 2-FSK modulation selected */ |
| group-Avnet | 0:478cfd88041f | 153 | GFSK_BT05 = 0x50, /*!< GFSK modulation selected with BT=0.5 */ |
| group-Avnet | 0:478cfd88041f | 154 | GFSK_BT1 = 0x10, /*!< GFSK modulation selected with BT=1 */ |
| group-Avnet | 0:478cfd88041f | 155 | ASK_OOK = 0x20, /*!< ASK or OOK modulation selected. ASK will use power ramping */ |
| group-Avnet | 0:478cfd88041f | 156 | MSK = 0x30 /*!< MSK modulation selected */ |
| group-Avnet | 0:478cfd88041f | 157 | |
| group-Avnet | 0:478cfd88041f | 158 | }ModulationSelect; |
| group-Avnet | 0:478cfd88041f | 159 | |
| group-Avnet | 0:478cfd88041f | 160 | |
| group-Avnet | 0:478cfd88041f | 161 | #define IS_MODULATION_SELECTED(MOD) (((MOD) == FSK) || \ |
| group-Avnet | 0:478cfd88041f | 162 | ((MOD) == GFSK_BT05) || \ |
| group-Avnet | 0:478cfd88041f | 163 | ((MOD) == GFSK_BT1) || \ |
| group-Avnet | 0:478cfd88041f | 164 | ((MOD) == ASK_OOK) || \ |
| group-Avnet | 0:478cfd88041f | 165 | ((MOD) == MSK)) |
| group-Avnet | 0:478cfd88041f | 166 | |
| group-Avnet | 0:478cfd88041f | 167 | |
| group-Avnet | 0:478cfd88041f | 168 | /** |
| group-Avnet | 0:478cfd88041f | 169 | * @brief SPIRIT PA additional load capacitors bank enumeration |
| group-Avnet | 0:478cfd88041f | 170 | */ |
| group-Avnet | 0:478cfd88041f | 171 | typedef enum |
| group-Avnet | 0:478cfd88041f | 172 | { |
| group-Avnet | 0:478cfd88041f | 173 | LOAD_0_PF = PA_POWER0_CWC_0, /*!< No additional PA load capacitor */ |
| group-Avnet | 0:478cfd88041f | 174 | LOAD_1_2_PF = PA_POWER0_CWC_1_2P, /*!< 1.2pF additional PA load capacitor */ |
| group-Avnet | 0:478cfd88041f | 175 | LOAD_2_4_PF = PA_POWER0_CWC_2_4P, /*!< 2.4pF additional PA load capacitor */ |
| group-Avnet | 0:478cfd88041f | 176 | LOAD_3_6_PF = PA_POWER0_CWC_3_6P /*!< 3.6pF additional PA load capacitor */ |
| group-Avnet | 0:478cfd88041f | 177 | |
| group-Avnet | 0:478cfd88041f | 178 | }PALoadCapacitor; |
| group-Avnet | 0:478cfd88041f | 179 | |
| group-Avnet | 0:478cfd88041f | 180 | #define IS_PA_LOAD_CAP(CWC) (((CWC) == LOAD_0_PF) || \ |
| group-Avnet | 0:478cfd88041f | 181 | ((CWC) == LOAD_1_2_PF) || \ |
| group-Avnet | 0:478cfd88041f | 182 | ((CWC) == LOAD_2_4_PF) || \ |
| group-Avnet | 0:478cfd88041f | 183 | ((CWC) == LOAD_3_6_PF)) |
| group-Avnet | 0:478cfd88041f | 184 | |
| group-Avnet | 0:478cfd88041f | 185 | |
| group-Avnet | 0:478cfd88041f | 186 | /** |
| group-Avnet | 0:478cfd88041f | 187 | * @brief SPIRIT AFC Mode selection |
| group-Avnet | 0:478cfd88041f | 188 | */ |
| group-Avnet | 0:478cfd88041f | 189 | typedef enum |
| group-Avnet | 0:478cfd88041f | 190 | { |
| group-Avnet | 0:478cfd88041f | 191 | AFC_SLICER_CORRECTION = AFC2_AFC_MODE_SLICER, /*!< AFC loop closed on slicer */ |
| group-Avnet | 0:478cfd88041f | 192 | AFC_2ND_IF_CORRECTION = AFC2_AFC_MODE_MIXER /*!< AFC loop closed on 2nd conversion stage */ |
| group-Avnet | 0:478cfd88041f | 193 | |
| group-Avnet | 0:478cfd88041f | 194 | }AFCMode; |
| group-Avnet | 0:478cfd88041f | 195 | |
| group-Avnet | 0:478cfd88041f | 196 | #define IS_AFC_MODE(MODE) ((MODE) == AFC_SLICER_CORRECTION || (MODE) == AFC_2ND_IF_CORRECTION) |
| group-Avnet | 0:478cfd88041f | 197 | |
| group-Avnet | 0:478cfd88041f | 198 | |
| group-Avnet | 0:478cfd88041f | 199 | /** |
| group-Avnet | 0:478cfd88041f | 200 | * @brief SPIRIT AGC Mode selection |
| group-Avnet | 0:478cfd88041f | 201 | */ |
| group-Avnet | 0:478cfd88041f | 202 | typedef enum |
| group-Avnet | 0:478cfd88041f | 203 | { |
| group-Avnet | 0:478cfd88041f | 204 | AGC_LINEAR_MODE = AGCCTRL0_AGC_MODE_LINEAR, /*!< AGC works in linear mode */ |
| group-Avnet | 0:478cfd88041f | 205 | AGC_BINARY_MODE = AGCCTRL0_AGC_MODE_BINARY /*!< AGC works in binary mode */ |
| group-Avnet | 0:478cfd88041f | 206 | |
| group-Avnet | 0:478cfd88041f | 207 | }AGCMode; |
| group-Avnet | 0:478cfd88041f | 208 | |
| group-Avnet | 0:478cfd88041f | 209 | #define IS_AGC_MODE(MODE) ((MODE) == AGC_LINEAR_MODE || (MODE) == AGC_BINARY_MODE) |
| group-Avnet | 0:478cfd88041f | 210 | |
| group-Avnet | 0:478cfd88041f | 211 | |
| group-Avnet | 0:478cfd88041f | 212 | /** |
| group-Avnet | 0:478cfd88041f | 213 | * @brief SPIRIT Clock Recovery Mode selection |
| group-Avnet | 0:478cfd88041f | 214 | */ |
| group-Avnet | 0:478cfd88041f | 215 | typedef enum |
| group-Avnet | 0:478cfd88041f | 216 | { |
| group-Avnet | 0:478cfd88041f | 217 | CLK_REC_PLL = FDEV0_CLOCK_REG_ALGO_SEL_PLL, /*!< PLL alogrithm for clock recovery */ |
| group-Avnet | 0:478cfd88041f | 218 | CLK_REC_DLL = FDEV0_CLOCK_REG_ALGO_SEL_DLL /*!< DLL alogrithm for clock recovery */ |
| group-Avnet | 0:478cfd88041f | 219 | |
| group-Avnet | 0:478cfd88041f | 220 | }ClkRecMode; |
| group-Avnet | 0:478cfd88041f | 221 | |
| group-Avnet | 0:478cfd88041f | 222 | #define IS_CLK_REC_MODE(MODE) ((MODE) == CLK_REC_PLL || (MODE) == CLK_REC_DLL) |
| group-Avnet | 0:478cfd88041f | 223 | |
| group-Avnet | 0:478cfd88041f | 224 | |
| group-Avnet | 0:478cfd88041f | 225 | /** |
| group-Avnet | 0:478cfd88041f | 226 | * @brief SPIRIT Postfilter length |
| group-Avnet | 0:478cfd88041f | 227 | */ |
| group-Avnet | 0:478cfd88041f | 228 | typedef enum |
| group-Avnet | 0:478cfd88041f | 229 | { |
| group-Avnet | 0:478cfd88041f | 230 | PSTFLT_LENGTH_8 = 0x00, /*!< Postfilter length is 8 symbols */ |
| group-Avnet | 0:478cfd88041f | 231 | PSTFLT_LENGTH_16 = 0x10 /*!< Postfilter length is 16 symbols */ |
| group-Avnet | 0:478cfd88041f | 232 | |
| group-Avnet | 0:478cfd88041f | 233 | }PstFltLength; |
| group-Avnet | 0:478cfd88041f | 234 | |
| group-Avnet | 0:478cfd88041f | 235 | #define IS_PST_FLT_LENGTH(LENGTH) ((LENGTH) == PSTFLT_LENGTH_8 || (LENGTH) == PSTFLT_LENGTH_16) |
| group-Avnet | 0:478cfd88041f | 236 | |
| group-Avnet | 0:478cfd88041f | 237 | |
| group-Avnet | 0:478cfd88041f | 238 | /** |
| group-Avnet | 0:478cfd88041f | 239 | * @brief SPIRIT OOK Peak Decay |
| group-Avnet | 0:478cfd88041f | 240 | */ |
| group-Avnet | 0:478cfd88041f | 241 | typedef enum |
| group-Avnet | 0:478cfd88041f | 242 | { |
| group-Avnet | 0:478cfd88041f | 243 | FAST_DECAY = 0x00, /*!< Peak decay control for OOK: fast decay */ |
| group-Avnet | 0:478cfd88041f | 244 | MEDIUM_FAST_DECAY = 0x01, /*!< Peak decay control for OOK: medium_fast decay */ |
| group-Avnet | 0:478cfd88041f | 245 | MEDIUM_SLOW_DECAY = 0x02, /*!< Peak decay control for OOK: medium_fast decay */ |
| group-Avnet | 0:478cfd88041f | 246 | SLOW_DECAY = 0x03 /*!< Peak decay control for OOK: slow decay */ |
| group-Avnet | 0:478cfd88041f | 247 | |
| group-Avnet | 0:478cfd88041f | 248 | }OokPeakDecay; |
| group-Avnet | 0:478cfd88041f | 249 | |
| group-Avnet | 0:478cfd88041f | 250 | #define IS_OOK_PEAK_DECAY(DECAY) (((DECAY) == FAST_DECAY) ||\ |
| group-Avnet | 0:478cfd88041f | 251 | ((DECAY) == MEDIUM_FAST_DECAY) ||\ |
| group-Avnet | 0:478cfd88041f | 252 | ((DECAY) == MEDIUM_SLOW_DECAY) ||\ |
| group-Avnet | 0:478cfd88041f | 253 | ((DECAY) == SLOW_DECAY)) |
| group-Avnet | 0:478cfd88041f | 254 | |
| group-Avnet | 0:478cfd88041f | 255 | |
| group-Avnet | 0:478cfd88041f | 256 | /** |
| group-Avnet | 0:478cfd88041f | 257 | * @brief SPIRIT Radio Init structure definition |
| group-Avnet | 0:478cfd88041f | 258 | */ |
| group-Avnet | 0:478cfd88041f | 259 | typedef struct |
| group-Avnet | 0:478cfd88041f | 260 | { |
| group-Avnet | 0:478cfd88041f | 261 | int16_t nXtalOffsetPpm; /*!< Specifies the offset frequency (in ppm) |
| group-Avnet | 0:478cfd88041f | 262 | to compensate crystal inaccuracy expressed |
| group-Avnet | 0:478cfd88041f | 263 | as signed value.*/ |
| group-Avnet | 0:478cfd88041f | 264 | |
| group-Avnet | 0:478cfd88041f | 265 | uint32_t lFrequencyBase; /*!< Specifies the base carrier frequency (in Hz), |
| group-Avnet | 0:478cfd88041f | 266 | i.e. the carrier frequency of channel #0. |
| group-Avnet | 0:478cfd88041f | 267 | This parameter can be in one of the following ranges: |
| group-Avnet | 0:478cfd88041f | 268 | High_Band: from 779 MHz to 915 MHz |
| group-Avnet | 0:478cfd88041f | 269 | Middle Band: from 387 MHz to 470 MHz |
| group-Avnet | 0:478cfd88041f | 270 | Low Band: from 300 MHz to 348 MHz */ |
| group-Avnet | 0:478cfd88041f | 271 | uint32_t nChannelSpace; /*!< Specifies the channel spacing expressed in Hz. |
| group-Avnet | 0:478cfd88041f | 272 | The channel spacing is expressed as: |
| group-Avnet | 0:478cfd88041f | 273 | NxFREQUENCY_STEPS, where FREQUENCY STEPS |
| group-Avnet | 0:478cfd88041f | 274 | is F_Xo/2^15. |
| group-Avnet | 0:478cfd88041f | 275 | This parameter can be in the range: [0, F_Xo/2^15*255] Hz */ |
| group-Avnet | 0:478cfd88041f | 276 | uint8_t cChannelNumber; /*!< Specifies the channel number. This value |
| group-Avnet | 0:478cfd88041f | 277 | is multiplied by the channel spacing and |
| group-Avnet | 0:478cfd88041f | 278 | added to synthesizer base frequency to |
| group-Avnet | 0:478cfd88041f | 279 | generate the actual RF carrier frequency */ |
| group-Avnet | 0:478cfd88041f | 280 | ModulationSelect xModulationSelect; /*!< Specifies the modulation. This |
| group-Avnet | 0:478cfd88041f | 281 | parameter can be any value of |
| group-Avnet | 0:478cfd88041f | 282 | @ref ModulationSelect */ |
| group-Avnet | 0:478cfd88041f | 283 | uint32_t lDatarate; /*!< Specifies the datarate expressed in bps. |
| group-Avnet | 0:478cfd88041f | 284 | This parameter can be in the range between |
| group-Avnet | 0:478cfd88041f | 285 | 100 bps and 500 kbps */ |
| group-Avnet | 0:478cfd88041f | 286 | uint32_t lFreqDev; /*!< Specifies the frequency deviation expressed in Hz. |
| group-Avnet | 0:478cfd88041f | 287 | This parameter can be in the range: [F_Xo*8/2^18, F_Xo*7680/2^18] Hz */ |
| group-Avnet | 0:478cfd88041f | 288 | uint32_t lBandwidth; /*!< Specifies the channel filter bandwidth |
| group-Avnet | 0:478cfd88041f | 289 | expressed in Hz. This parameter can be |
| group-Avnet | 0:478cfd88041f | 290 | in the range between 1100 and 800100 Hz */ |
| group-Avnet | 0:478cfd88041f | 291 | |
| group-Avnet | 0:478cfd88041f | 292 | }SRadioInit; |
| group-Avnet | 0:478cfd88041f | 293 | |
| group-Avnet | 0:478cfd88041f | 294 | /** |
| group-Avnet | 0:478cfd88041f | 295 | * @} |
| group-Avnet | 0:478cfd88041f | 296 | */ |
| group-Avnet | 0:478cfd88041f | 297 | |
| group-Avnet | 0:478cfd88041f | 298 | |
| group-Avnet | 0:478cfd88041f | 299 | |
| group-Avnet | 0:478cfd88041f | 300 | /** @defgroup Radio_Exported_Constants Radio Exported Constants |
| group-Avnet | 0:478cfd88041f | 301 | * @{ |
| group-Avnet | 0:478cfd88041f | 302 | */ |
| group-Avnet | 0:478cfd88041f | 303 | |
| group-Avnet | 0:478cfd88041f | 304 | /** @defgroup Radio_Band |
| group-Avnet | 0:478cfd88041f | 305 | * @{ |
| group-Avnet | 0:478cfd88041f | 306 | */ |
| group-Avnet | 0:478cfd88041f | 307 | |
| group-Avnet | 0:478cfd88041f | 308 | #define FBASE_DIVIDER 262144 /*!< 2^18 factor dividing fxo in fbase formula */ |
| group-Avnet | 0:478cfd88041f | 309 | |
| group-Avnet | 0:478cfd88041f | 310 | #define HIGH_BAND_FACTOR 6 /*!< Band select factor for high band. Factor B in the equation 2 */ |
| group-Avnet | 0:478cfd88041f | 311 | #define MIDDLE_BAND_FACTOR 12 /*!< Band select factor for middle band. Factor B in the equation 2 */ |
| group-Avnet | 0:478cfd88041f | 312 | #define LOW_BAND_FACTOR 16 /*!< Band select factor for low band. Factor B in the equation 2 */ |
| group-Avnet | 0:478cfd88041f | 313 | #define VERY_LOW_BAND_FACTOR 32 /*!< Band select factor for very low band. Factor B in the equation 2 */ |
| group-Avnet | 0:478cfd88041f | 314 | |
| group-Avnet | 0:478cfd88041f | 315 | #define HIGH_BAND_LOWER_LIMIT 778000000 /*!< Lower limit of the high band: 779 MHz */ |
| group-Avnet | 0:478cfd88041f | 316 | #define HIGH_BAND_UPPER_LIMIT 957100000 /*!< Upper limit of the high band: 956 MHz */ |
| group-Avnet | 0:478cfd88041f | 317 | #define MIDDLE_BAND_LOWER_LIMIT 386000000 /*!< Lower limit of the middle band: 387 MHz */ |
| group-Avnet | 0:478cfd88041f | 318 | #define MIDDLE_BAND_UPPER_LIMIT 471100000 /*!< Upper limit of the middle band: 470 MHz */ |
| group-Avnet | 0:478cfd88041f | 319 | #define LOW_BAND_LOWER_LIMIT 299000000 /*!< Lower limit of the low band: 300 MHz */ |
| group-Avnet | 0:478cfd88041f | 320 | #define LOW_BAND_UPPER_LIMIT 349100000 /*!< Upper limit of the low band: 348 MHz */ |
| group-Avnet | 0:478cfd88041f | 321 | #define VERY_LOW_BAND_LOWER_LIMIT 149000000 /*!< Lower limit of the very low band: 150 MHz */ |
| group-Avnet | 0:478cfd88041f | 322 | #define VERY_LOW_BAND_UPPER_LIMIT 175100000 /*!< Upper limit of the very low band: 174 MHz */ |
| group-Avnet | 0:478cfd88041f | 323 | |
| group-Avnet | 0:478cfd88041f | 324 | #define IS_FREQUENCY_BAND_HIGH(FREQUENCY) ((FREQUENCY)>=HIGH_BAND_LOWER_LIMIT && \ |
| group-Avnet | 0:478cfd88041f | 325 | (FREQUENCY)<=HIGH_BAND_UPPER_LIMIT) |
| group-Avnet | 0:478cfd88041f | 326 | |
| group-Avnet | 0:478cfd88041f | 327 | #define IS_FREQUENCY_BAND_MIDDLE(FREQUENCY) ((FREQUENCY)>=MIDDLE_BAND_LOWER_LIMIT && \ |
| group-Avnet | 0:478cfd88041f | 328 | (FREQUENCY)<=MIDDLE_BAND_UPPER_LIMIT) |
| group-Avnet | 0:478cfd88041f | 329 | |
| group-Avnet | 0:478cfd88041f | 330 | #define IS_FREQUENCY_BAND_LOW(FREQUENCY) ((FREQUENCY)>=LOW_BAND_LOWER_LIMIT && \ |
| group-Avnet | 0:478cfd88041f | 331 | (FREQUENCY)<=LOW_BAND_UPPER_LIMIT) |
| group-Avnet | 0:478cfd88041f | 332 | |
| group-Avnet | 0:478cfd88041f | 333 | #define IS_FREQUENCY_BAND_VERY_LOW(FREQUENCY) ((FREQUENCY)>=VERY_LOW_BAND_LOWER_LIMIT && \ |
| group-Avnet | 0:478cfd88041f | 334 | (FREQUENCY)<=VERY_LOW_BAND_UPPER_LIMIT) |
| group-Avnet | 0:478cfd88041f | 335 | |
| group-Avnet | 0:478cfd88041f | 336 | #define IS_FREQUENCY_BAND(FREQUENCY) (IS_FREQUENCY_BAND_HIGH(FREQUENCY)|| \ |
| group-Avnet | 0:478cfd88041f | 337 | IS_FREQUENCY_BAND_MIDDLE(FREQUENCY)|| \ |
| group-Avnet | 0:478cfd88041f | 338 | IS_FREQUENCY_BAND_LOW(FREQUENCY)|| \ |
| group-Avnet | 0:478cfd88041f | 339 | IS_FREQUENCY_BAND_VERY_LOW(FREQUENCY)) |
| group-Avnet | 0:478cfd88041f | 340 | |
| group-Avnet | 0:478cfd88041f | 341 | /** |
| group-Avnet | 0:478cfd88041f | 342 | * @} |
| group-Avnet | 0:478cfd88041f | 343 | */ |
| group-Avnet | 0:478cfd88041f | 344 | |
| group-Avnet | 0:478cfd88041f | 345 | |
| group-Avnet | 0:478cfd88041f | 346 | /** @defgroup Radio_IF_Offset Radio IF Offset |
| group-Avnet | 0:478cfd88041f | 347 | * @{ |
| group-Avnet | 0:478cfd88041f | 348 | */ |
| group-Avnet | 0:478cfd88041f | 349 | #define IF_OFFSET_ANA(F_Xo) (lroundf(480140.0/(F_Xo)*12288-64.0)) /*!< It represents the IF_OFFSET_ANA in order |
| group-Avnet | 0:478cfd88041f | 350 | to have an intermediate frequency of 480 kHz */ |
| group-Avnet | 0:478cfd88041f | 351 | /** |
| group-Avnet | 0:478cfd88041f | 352 | * @} |
| group-Avnet | 0:478cfd88041f | 353 | */ |
| group-Avnet | 0:478cfd88041f | 354 | |
| group-Avnet | 0:478cfd88041f | 355 | |
| group-Avnet | 0:478cfd88041f | 356 | /** @defgroup Radio_FC_Offset Radio FC Offset |
| group-Avnet | 0:478cfd88041f | 357 | * @{ |
| group-Avnet | 0:478cfd88041f | 358 | */ |
| group-Avnet | 0:478cfd88041f | 359 | #define F_OFFSET_DIVIDER 262144 /*!< 2^18 factor dividing fxo in foffset formula */ |
| group-Avnet | 0:478cfd88041f | 360 | #define PPM_FACTOR 1000000 /*!< 10^6 factor to use with Xtal_offset_ppm */ |
| group-Avnet | 0:478cfd88041f | 361 | |
| group-Avnet | 0:478cfd88041f | 362 | |
| group-Avnet | 0:478cfd88041f | 363 | #define F_OFFSET_LOWER_LIMIT(F_Xo) ((-(int32_t)F_Xo)/F_OFFSET_DIVIDER*2048) |
| group-Avnet | 0:478cfd88041f | 364 | #define F_OFFSET_UPPER_LIMIT(F_Xo) ((int32_t)(F_Xo/F_OFFSET_DIVIDER*2047)) |
| group-Avnet | 0:478cfd88041f | 365 | |
| group-Avnet | 0:478cfd88041f | 366 | #define IS_FREQUENCY_OFFSET(OFFSET, F_Xo) (OFFSET>=F_OFFSET_LOWER_LIMIT(F_Xo) && OFFSET<=F_OFFSET_UPPER_LIMIT(F_Xo)) |
| group-Avnet | 0:478cfd88041f | 367 | |
| group-Avnet | 0:478cfd88041f | 368 | |
| group-Avnet | 0:478cfd88041f | 369 | /** |
| group-Avnet | 0:478cfd88041f | 370 | * @} |
| group-Avnet | 0:478cfd88041f | 371 | */ |
| group-Avnet | 0:478cfd88041f | 372 | |
| group-Avnet | 0:478cfd88041f | 373 | |
| group-Avnet | 0:478cfd88041f | 374 | /** @defgroup Radio_Channel_Space Radio Channel Space |
| group-Avnet | 0:478cfd88041f | 375 | * @{ |
| group-Avnet | 0:478cfd88041f | 376 | */ |
| group-Avnet | 0:478cfd88041f | 377 | |
| group-Avnet | 0:478cfd88041f | 378 | |
| group-Avnet | 0:478cfd88041f | 379 | #define CHSPACE_DIVIDER 32768 /*!< 2^15 factor dividing fxo in channel space formula */ |
| group-Avnet | 0:478cfd88041f | 380 | |
| group-Avnet | 0:478cfd88041f | 381 | #define IS_CHANNEL_SPACE(CHANNELSPACE, F_Xo) (CHANNELSPACE<=(F_Xo/32768*255)) |
| group-Avnet | 0:478cfd88041f | 382 | |
| group-Avnet | 0:478cfd88041f | 383 | |
| group-Avnet | 0:478cfd88041f | 384 | |
| group-Avnet | 0:478cfd88041f | 385 | |
| group-Avnet | 0:478cfd88041f | 386 | |
| group-Avnet | 0:478cfd88041f | 387 | /** |
| group-Avnet | 0:478cfd88041f | 388 | * @} |
| group-Avnet | 0:478cfd88041f | 389 | */ |
| group-Avnet | 0:478cfd88041f | 390 | |
| group-Avnet | 0:478cfd88041f | 391 | |
| group-Avnet | 0:478cfd88041f | 392 | /** @defgroup Radio_Datarate Radio Datarate |
| group-Avnet | 0:478cfd88041f | 393 | * @{ |
| group-Avnet | 0:478cfd88041f | 394 | */ |
| group-Avnet | 0:478cfd88041f | 395 | #define MINIMUM_DATARATE 100 /*!< Minimum datarate supported by SPIRIT1 100 bps */ |
| group-Avnet | 0:478cfd88041f | 396 | #define MAXIMUM_DATARATE 510000 /*!< Maximum datarate supported by SPIRIT1 500 kbps */ |
| group-Avnet | 0:478cfd88041f | 397 | |
| group-Avnet | 0:478cfd88041f | 398 | #define IS_DATARATE(DATARATE) (DATARATE>=MINIMUM_DATARATE && DATARATE<=MAXIMUM_DATARATE) |
| group-Avnet | 0:478cfd88041f | 399 | |
| group-Avnet | 0:478cfd88041f | 400 | /** |
| group-Avnet | 0:478cfd88041f | 401 | * @} |
| group-Avnet | 0:478cfd88041f | 402 | */ |
| group-Avnet | 0:478cfd88041f | 403 | |
| group-Avnet | 0:478cfd88041f | 404 | |
| group-Avnet | 0:478cfd88041f | 405 | /** @defgroup Radio_Frequency_Deviation Radio Frequency Deviation |
| group-Avnet | 0:478cfd88041f | 406 | * @{ |
| group-Avnet | 0:478cfd88041f | 407 | */ |
| group-Avnet | 0:478cfd88041f | 408 | #define F_DEV_MANTISSA_UPPER_LIMIT 7 /*!< Maximum value for the mantissa in frequency deviation formula */ |
| group-Avnet | 0:478cfd88041f | 409 | #define F_DEV_EXPONENT_UPPER_LIMIT 9 /*!< Maximum value for the exponent in frequency deviation formula */ |
| group-Avnet | 0:478cfd88041f | 410 | |
| group-Avnet | 0:478cfd88041f | 411 | #define F_DEV_LOWER_LIMIT(F_Xo) (F_Xo>>16) |
| group-Avnet | 0:478cfd88041f | 412 | #define F_DEV_UPPER_LIMIT(F_Xo) ((F_Xo*15)>>10) |
| group-Avnet | 0:478cfd88041f | 413 | |
| group-Avnet | 0:478cfd88041f | 414 | #define IS_F_DEV(FDEV,F_Xo) (FDEV>=F_DEV_LOWER_LIMIT(F_Xo) && FDEV<=F_DEV_UPPER_LIMIT(F_Xo)) |
| group-Avnet | 0:478cfd88041f | 415 | |
| group-Avnet | 0:478cfd88041f | 416 | |
| group-Avnet | 0:478cfd88041f | 417 | /** |
| group-Avnet | 0:478cfd88041f | 418 | * @} |
| group-Avnet | 0:478cfd88041f | 419 | */ |
| group-Avnet | 0:478cfd88041f | 420 | |
| group-Avnet | 0:478cfd88041f | 421 | |
| group-Avnet | 0:478cfd88041f | 422 | /** @defgroup Radio_Channel_Bandwidth Radio Channel Bandwidth |
| group-Avnet | 0:478cfd88041f | 423 | * @{ |
| group-Avnet | 0:478cfd88041f | 424 | */ |
| group-Avnet | 0:478cfd88041f | 425 | #define CH_BW_LOWER_LIMIT(F_Xo) 1100*(F_Xo/1000000)/26 /*!< Minimum value of the channel filter bandwidth */ |
| group-Avnet | 0:478cfd88041f | 426 | #define CH_BW_UPPER_LIMIT(F_Xo) 800100*(F_Xo/1000000)/26 /*!< Maximum value of the channel filter bandwidth */ |
| group-Avnet | 0:478cfd88041f | 427 | |
| group-Avnet | 0:478cfd88041f | 428 | #define IS_CH_BW(BW,F_Xo) ((BW)>=CH_BW_LOWER_LIMIT(F_Xo) && (BW)<=CH_BW_UPPER_LIMIT(F_Xo)) |
| group-Avnet | 0:478cfd88041f | 429 | |
| group-Avnet | 0:478cfd88041f | 430 | /** |
| group-Avnet | 0:478cfd88041f | 431 | * @} |
| group-Avnet | 0:478cfd88041f | 432 | */ |
| group-Avnet | 0:478cfd88041f | 433 | |
| group-Avnet | 0:478cfd88041f | 434 | |
| group-Avnet | 0:478cfd88041f | 435 | /** @defgroup Radio_Power_Amplifier Radio Power Amplifier |
| group-Avnet | 0:478cfd88041f | 436 | * @{ |
| group-Avnet | 0:478cfd88041f | 437 | */ |
| group-Avnet | 0:478cfd88041f | 438 | |
| group-Avnet | 0:478cfd88041f | 439 | #define IS_PA_MAX_INDEX(INDEX) ((INDEX)<=7) |
| group-Avnet | 0:478cfd88041f | 440 | #define IS_PAPOWER_DBM(PATABLE) ((PATABLE)>= (-31) && (PATABLE)<=(12)) |
| group-Avnet | 0:478cfd88041f | 441 | #define IS_PAPOWER(PATABLE) ((PATABLE)<=90) |
| group-Avnet | 0:478cfd88041f | 442 | #define IS_PA_STEP_WIDTH(WIDTH) ((WIDTH)>=1 && (WIDTH)<=4) |
| group-Avnet | 0:478cfd88041f | 443 | |
| group-Avnet | 0:478cfd88041f | 444 | /** |
| group-Avnet | 0:478cfd88041f | 445 | * @} |
| group-Avnet | 0:478cfd88041f | 446 | */ |
| group-Avnet | 0:478cfd88041f | 447 | |
| group-Avnet | 0:478cfd88041f | 448 | |
| group-Avnet | 0:478cfd88041f | 449 | /** @defgroup Radio_Automatic_Frequency_Correction Radio Automatic Frequency Correction |
| group-Avnet | 0:478cfd88041f | 450 | * @{ |
| group-Avnet | 0:478cfd88041f | 451 | */ |
| group-Avnet | 0:478cfd88041f | 452 | |
| group-Avnet | 0:478cfd88041f | 453 | #define IS_AFC_FAST_GAIN(GAIN) ((GAIN)<=15) |
| group-Avnet | 0:478cfd88041f | 454 | #define IS_AFC_SLOW_GAIN(GAIN) ((GAIN)<=15) |
| group-Avnet | 0:478cfd88041f | 455 | #define IS_AFC_PD_LEAKAGE(LEAKAGE) ((LEAKAGE)<=31) |
| group-Avnet | 0:478cfd88041f | 456 | |
| group-Avnet | 0:478cfd88041f | 457 | /** |
| group-Avnet | 0:478cfd88041f | 458 | * @} |
| group-Avnet | 0:478cfd88041f | 459 | */ |
| group-Avnet | 0:478cfd88041f | 460 | |
| group-Avnet | 0:478cfd88041f | 461 | /** @defgroup Radio_Automatic_Gain_Control Radio Automatic Gain Control |
| group-Avnet | 0:478cfd88041f | 462 | * @{ |
| group-Avnet | 0:478cfd88041f | 463 | */ |
| group-Avnet | 0:478cfd88041f | 464 | |
| group-Avnet | 0:478cfd88041f | 465 | #define AGC_MEASURE_TIME_UPPER_LIMIT_US(F_Xo) (393216.0/F_Xo) |
| group-Avnet | 0:478cfd88041f | 466 | |
| group-Avnet | 0:478cfd88041f | 467 | #define IS_AGC_MEASURE_TIME_US(TIME, F_Xo) (TIME<=AGC_MEASURE_TIME_UPPER_LIMIT_US(F_Xo)) |
| group-Avnet | 0:478cfd88041f | 468 | |
| group-Avnet | 0:478cfd88041f | 469 | #define IS_AGC_MEASURE_TIME(TIME) (TIME<=15) |
| group-Avnet | 0:478cfd88041f | 470 | |
| group-Avnet | 0:478cfd88041f | 471 | #define AGC_HOLD_TIME_UPPER_LIMIT_US(F_Xo) (756.0/F_Xo) |
| group-Avnet | 0:478cfd88041f | 472 | |
| group-Avnet | 0:478cfd88041f | 473 | #define IS_AGC_HOLD_TIME_US(TIME,F_Xo) (TIME<=AGC_HOLD_TIME_UPPER_LIMIT_US(F_Xo)) |
| group-Avnet | 0:478cfd88041f | 474 | |
| group-Avnet | 0:478cfd88041f | 475 | |
| group-Avnet | 0:478cfd88041f | 476 | #define IS_AGC_HOLD_TIME(TIME) (TIME<=63) |
| group-Avnet | 0:478cfd88041f | 477 | |
| group-Avnet | 0:478cfd88041f | 478 | #define IS_AGC_THRESHOLD(THRESHOLD) (THRESHOLD<=15) |
| group-Avnet | 0:478cfd88041f | 479 | |
| group-Avnet | 0:478cfd88041f | 480 | /** |
| group-Avnet | 0:478cfd88041f | 481 | * @} |
| group-Avnet | 0:478cfd88041f | 482 | */ |
| group-Avnet | 0:478cfd88041f | 483 | |
| group-Avnet | 0:478cfd88041f | 484 | |
| group-Avnet | 0:478cfd88041f | 485 | /** @defgroup Radio_Clock_Recovery Radio Clock Recovery |
| group-Avnet | 0:478cfd88041f | 486 | * @{ |
| group-Avnet | 0:478cfd88041f | 487 | */ |
| group-Avnet | 0:478cfd88041f | 488 | |
| group-Avnet | 0:478cfd88041f | 489 | #define IS_CLK_REC_P_GAIN(GAIN) ((GAIN)<=7) |
| group-Avnet | 0:478cfd88041f | 490 | #define IS_CLK_REC_I_GAIN(GAIN) ((GAIN)<=15) |
| group-Avnet | 0:478cfd88041f | 491 | |
| group-Avnet | 0:478cfd88041f | 492 | /** |
| group-Avnet | 0:478cfd88041f | 493 | * @} |
| group-Avnet | 0:478cfd88041f | 494 | */ |
| group-Avnet | 0:478cfd88041f | 495 | |
| group-Avnet | 0:478cfd88041f | 496 | /** |
| group-Avnet | 0:478cfd88041f | 497 | * @} |
| group-Avnet | 0:478cfd88041f | 498 | */ |
| group-Avnet | 0:478cfd88041f | 499 | |
| group-Avnet | 0:478cfd88041f | 500 | |
| group-Avnet | 0:478cfd88041f | 501 | |
| group-Avnet | 0:478cfd88041f | 502 | /** @defgroup Radio_Exported_Macros Radio Exported Macros |
| group-Avnet | 0:478cfd88041f | 503 | * @{ |
| group-Avnet | 0:478cfd88041f | 504 | */ |
| group-Avnet | 0:478cfd88041f | 505 | |
| group-Avnet | 0:478cfd88041f | 506 | |
| group-Avnet | 0:478cfd88041f | 507 | /** |
| group-Avnet | 0:478cfd88041f | 508 | * @} |
| group-Avnet | 0:478cfd88041f | 509 | */ |
| group-Avnet | 0:478cfd88041f | 510 | |
| group-Avnet | 0:478cfd88041f | 511 | /** @defgroup Radio_Exported_Functions Radio Exported Functions |
| group-Avnet | 0:478cfd88041f | 512 | * @{ |
| group-Avnet | 0:478cfd88041f | 513 | */ |
| group-Avnet | 0:478cfd88041f | 514 | |
| group-Avnet | 0:478cfd88041f | 515 | uint8_t SpiritRadioInit(SRadioInit* pxSRadioInitStruct); |
| group-Avnet | 0:478cfd88041f | 516 | void SpiritRadioGetInfo(SRadioInit* pxSRadioInitStruct); |
| group-Avnet | 0:478cfd88041f | 517 | void SpiritRadioSetXtalFlag(XtalFlag xXtal); |
| group-Avnet | 0:478cfd88041f | 518 | XtalFlag SpiritRadioGetXtalFlag(void); |
| group-Avnet | 0:478cfd88041f | 519 | uint8_t SpiritRadioSearchWCP(uint32_t lFc); |
| group-Avnet | 0:478cfd88041f | 520 | void SpiritRadioSetSynthWord(uint32_t lSynthWord); |
| group-Avnet | 0:478cfd88041f | 521 | uint32_t SpiritRadioGetSynthWord(void); |
| group-Avnet | 0:478cfd88041f | 522 | void SpiritRadioSetBand(BandSelect xBand); |
| group-Avnet | 0:478cfd88041f | 523 | BandSelect SpiritRadioGetBand(void); |
| group-Avnet | 0:478cfd88041f | 524 | void SpiritRadioSetChannel(uint8_t cChannel); |
| group-Avnet | 0:478cfd88041f | 525 | uint8_t SpiritRadioGetChannel(void); |
| group-Avnet | 0:478cfd88041f | 526 | void SpiritRadioSetChannelSpace(uint32_t lChannelSpace); |
| group-Avnet | 0:478cfd88041f | 527 | uint32_t SpiritRadioGetChannelSpace(void); |
| group-Avnet | 0:478cfd88041f | 528 | void SpiritRadioSetFrequencyOffsetPpm(int16_t nXtalPpm); |
| group-Avnet | 0:478cfd88041f | 529 | void SpiritRadioSetFrequencyOffset(int32_t lFOffset); |
| group-Avnet | 0:478cfd88041f | 530 | int32_t SpiritRadioGetFrequencyOffset(void); |
| group-Avnet | 0:478cfd88041f | 531 | void SpiritRadioVcoCalibrationWAFB(SpiritFunctionalState xNewstate); |
| group-Avnet | 0:478cfd88041f | 532 | uint8_t SpiritRadioSetFrequencyBase(uint32_t lFBase); |
| group-Avnet | 0:478cfd88041f | 533 | uint32_t SpiritRadioGetFrequencyBase(void); |
| group-Avnet | 0:478cfd88041f | 534 | uint32_t SpiritRadioGetCenterFrequency(void); |
| group-Avnet | 0:478cfd88041f | 535 | void SpiritRadioSearchDatarateME(uint32_t lDatarate, uint8_t* pcM, uint8_t* pcE); |
| group-Avnet | 0:478cfd88041f | 536 | void SpiritRadioSearchFreqDevME(uint32_t lFDev, uint8_t* pcM, uint8_t* pcE); |
| group-Avnet | 0:478cfd88041f | 537 | void SpiritRadioSearchChannelBwME(uint32_t lBandwidth, uint8_t* pcM, uint8_t* pcE); |
| group-Avnet | 0:478cfd88041f | 538 | void SpiritRadioSetDatarate(uint32_t lDatarate); |
| group-Avnet | 0:478cfd88041f | 539 | uint32_t SpiritRadioGetDatarate(void); |
| group-Avnet | 0:478cfd88041f | 540 | void SpiritRadioSetFrequencyDev(uint32_t lFDev); |
| group-Avnet | 0:478cfd88041f | 541 | uint32_t SpiritRadioGetFrequencyDev(void); |
| group-Avnet | 0:478cfd88041f | 542 | void SpiritRadioSetChannelBW(uint32_t lBandwidth); |
| group-Avnet | 0:478cfd88041f | 543 | uint32_t SpiritRadioGetChannelBW(void); |
| group-Avnet | 0:478cfd88041f | 544 | void SpiritRadioSetModulation(ModulationSelect xModulation); |
| group-Avnet | 0:478cfd88041f | 545 | ModulationSelect SpiritRadioGetModulation(void); |
| group-Avnet | 0:478cfd88041f | 546 | void SpiritRadioCWTransmitMode(SpiritFunctionalState xNewState); |
| group-Avnet | 0:478cfd88041f | 547 | void SpiritRadioSetOokPeakDecay(OokPeakDecay xOokDecay); |
| group-Avnet | 0:478cfd88041f | 548 | OokPeakDecay SpiritRadioGetOokPeakDecay(void); |
| group-Avnet | 0:478cfd88041f | 549 | uint8_t SpiritRadioGetdBm2Reg(uint32_t lFBase, float fPowerdBm); |
| group-Avnet | 0:478cfd88041f | 550 | float SpiritRadioGetReg2dBm(uint32_t lFBase, uint8_t cPowerReg); |
| group-Avnet | 0:478cfd88041f | 551 | void SpiritRadioSetPATabledBm(uint8_t cPALevelMaxIndex, uint8_t cWidth, PALoadCapacitor xCLoad, float* pfPAtabledBm); |
| group-Avnet | 0:478cfd88041f | 552 | void SpiritRadioGetPATabledBm(uint8_t* pcPALevelMaxIndex, float* pfPAtabledBm); |
| group-Avnet | 0:478cfd88041f | 553 | void SpiritRadioSetPATable(uint8_t cPALevelMaxIndex, uint8_t cWidth, PALoadCapacitor xCLoad, uint8_t* pcPAtable); |
| group-Avnet | 0:478cfd88041f | 554 | void SpiritRadioGetPATable(uint8_t* pcPALevelMaxIndex, uint8_t* pcPAtable); |
| group-Avnet | 0:478cfd88041f | 555 | void SpiritRadioSetPALeveldBm(uint8_t cIndex, float fPowerdBm); |
| group-Avnet | 0:478cfd88041f | 556 | float SpiritRadioGetPALeveldBm(uint8_t cIndex); |
| group-Avnet | 0:478cfd88041f | 557 | void SpiritRadioSetPALevel(uint8_t cIndex, uint8_t cPower); |
| group-Avnet | 0:478cfd88041f | 558 | uint8_t SpiritRadioGetPALevel(uint8_t cIndex); |
| group-Avnet | 0:478cfd88041f | 559 | void SpiritRadioSetPACwc(PALoadCapacitor xCLoad); |
| group-Avnet | 0:478cfd88041f | 560 | PALoadCapacitor SpiritRadioGetPACwc(void); |
| group-Avnet | 0:478cfd88041f | 561 | void SpiritRadioSetPALevelMaxIndex(uint8_t cIndex); |
| group-Avnet | 0:478cfd88041f | 562 | uint8_t SpiritRadioGetPALevelMaxIndex(void); |
| group-Avnet | 0:478cfd88041f | 563 | void SpiritRadioSetPAStepWidth(uint8_t cWidth); |
| group-Avnet | 0:478cfd88041f | 564 | uint8_t SpiritRadioGetPAStepWidth(void); |
| group-Avnet | 0:478cfd88041f | 565 | void SpiritRadioPARamping(SpiritFunctionalState xNewState); |
| group-Avnet | 0:478cfd88041f | 566 | SpiritFunctionalState SpiritRadioGetPARamping(void); |
| group-Avnet | 0:478cfd88041f | 567 | void SpiritRadioAFC(SpiritFunctionalState xNewState); |
| group-Avnet | 0:478cfd88041f | 568 | void SpiritRadioAFCFreezeOnSync(SpiritFunctionalState xNewState); |
| group-Avnet | 0:478cfd88041f | 569 | void SpiritRadioSetAFCMode(AFCMode xMode); |
| group-Avnet | 0:478cfd88041f | 570 | AFCMode SpiritRadioGetAFCMode(void); |
| group-Avnet | 0:478cfd88041f | 571 | void SpiritRadioSetAFCPDLeakage(uint8_t cLeakage); |
| group-Avnet | 0:478cfd88041f | 572 | uint8_t SpiritRadioGetAFCPDLeakage(void); |
| group-Avnet | 0:478cfd88041f | 573 | void SpiritRadioSetAFCFastPeriod(uint8_t cLength); |
| group-Avnet | 0:478cfd88041f | 574 | uint8_t SpiritRadioGetAFCFastPeriod(void); |
| group-Avnet | 0:478cfd88041f | 575 | void SpiritRadioSetAFCFastGain(uint8_t cGain); |
| group-Avnet | 0:478cfd88041f | 576 | uint8_t SpiritRadioGetAFCFastGain(void); |
| group-Avnet | 0:478cfd88041f | 577 | void SpiritRadioSetAFCSlowGain(uint8_t cGain); |
| group-Avnet | 0:478cfd88041f | 578 | uint8_t SpiritRadioGetAFCSlowGain(void); |
| group-Avnet | 0:478cfd88041f | 579 | int8_t SpiritRadioGetAFCCorrectionReg(void); |
| group-Avnet | 0:478cfd88041f | 580 | int32_t SpiritRadioGetAFCCorrectionHz(void); |
| group-Avnet | 0:478cfd88041f | 581 | void SpiritRadioAGC(SpiritFunctionalState xNewState); |
| group-Avnet | 0:478cfd88041f | 582 | void SpiritRadioSetAGCMode(AGCMode xMode); |
| group-Avnet | 0:478cfd88041f | 583 | AGCMode SpiritRadioGetAGCMode(void); |
| group-Avnet | 0:478cfd88041f | 584 | void SpiritRadioAGCFreezeOnSteady(SpiritFunctionalState xNewState); |
| group-Avnet | 0:478cfd88041f | 585 | void SpiritRadioAGCFreezeOnSync(SpiritFunctionalState xNewState); |
| group-Avnet | 0:478cfd88041f | 586 | void SpiritRadioAGCStartMaxAttenuation(SpiritFunctionalState xNewState); |
| group-Avnet | 0:478cfd88041f | 587 | void SpiritRadioSetAGCMeasureTimeUs(uint16_t nTime); |
| group-Avnet | 0:478cfd88041f | 588 | uint16_t SpiritRadioGetAGCMeasureTimeUs(void); |
| group-Avnet | 0:478cfd88041f | 589 | void SpiritRadioSetAGCMeasureTime(uint8_t cTime); |
| group-Avnet | 0:478cfd88041f | 590 | uint8_t SpiritRadioGetAGCMeasureTime(void); |
| group-Avnet | 0:478cfd88041f | 591 | void SpiritRadioSetAGCHoldTimeUs(uint8_t cTime); |
| group-Avnet | 0:478cfd88041f | 592 | uint8_t SpiritRadioGetAGCHoldTimeUs(void); |
| group-Avnet | 0:478cfd88041f | 593 | void SpiritRadioSetAGCHoldTime(uint8_t cTime); |
| group-Avnet | 0:478cfd88041f | 594 | uint8_t SpiritRadioGetAGCHoldTime(void); |
| group-Avnet | 0:478cfd88041f | 595 | void SpiritRadioSetAGCHighThreshold(uint8_t cHighThreshold); |
| group-Avnet | 0:478cfd88041f | 596 | uint8_t SpiritRadioGetAGCHighThreshold(void); |
| group-Avnet | 0:478cfd88041f | 597 | void SpiritRadioSetAGCLowThreshold(uint8_t cLowThreshold); |
| group-Avnet | 0:478cfd88041f | 598 | uint8_t SpiritRadioGetAGCLowThreshold(void); |
| group-Avnet | 0:478cfd88041f | 599 | void SpiritRadioSetClkRecMode(ClkRecMode xMode); |
| group-Avnet | 0:478cfd88041f | 600 | ClkRecMode SpiritRadioGetClkRecMode(void); |
| group-Avnet | 0:478cfd88041f | 601 | void SpiritRadioSetClkRecPGain(uint8_t cPGain); |
| group-Avnet | 0:478cfd88041f | 602 | uint8_t SpiritRadioGetClkRecPGain(void); |
| group-Avnet | 0:478cfd88041f | 603 | void SpiritRadioSetClkRecIGain(uint8_t cIGain); |
| group-Avnet | 0:478cfd88041f | 604 | uint8_t SpiritRadioGetClkRecIGain(void); |
| group-Avnet | 0:478cfd88041f | 605 | void SpiritRadioSetClkRecPstFltLength(PstFltLength xLength); |
| group-Avnet | 0:478cfd88041f | 606 | PstFltLength SpiritRadioGetClkRecPstFltLength(void); |
| group-Avnet | 0:478cfd88041f | 607 | void SpiritRadioCsBlanking(SpiritFunctionalState xNewState); |
| group-Avnet | 0:478cfd88041f | 608 | void SpiritRadioPersistenRx(SpiritFunctionalState xNewState); |
| group-Avnet | 0:478cfd88041f | 609 | uint32_t SpiritRadioGetXtalFrequency(void); |
| group-Avnet | 0:478cfd88041f | 610 | void SpiritRadioSetXtalFrequency(uint32_t lXtalFrequency); |
| group-Avnet | 0:478cfd88041f | 611 | void SpiritRadioSetRefDiv(SpiritFunctionalState xNewState); |
| group-Avnet | 0:478cfd88041f | 612 | SpiritFunctionalState SpiritRadioGetRefDiv(void); |
| group-Avnet | 0:478cfd88041f | 613 | void SpiritRadioSetDigDiv(SpiritFunctionalState xNewState); |
| group-Avnet | 0:478cfd88041f | 614 | SpiritFunctionalState SpiritRadioGetDigDiv(void); |
| group-Avnet | 0:478cfd88041f | 615 | /** |
| group-Avnet | 0:478cfd88041f | 616 | * @} |
| group-Avnet | 0:478cfd88041f | 617 | */ |
| group-Avnet | 0:478cfd88041f | 618 | |
| group-Avnet | 0:478cfd88041f | 619 | /** |
| group-Avnet | 0:478cfd88041f | 620 | * @} |
| group-Avnet | 0:478cfd88041f | 621 | */ |
| group-Avnet | 0:478cfd88041f | 622 | |
| group-Avnet | 0:478cfd88041f | 623 | |
| group-Avnet | 0:478cfd88041f | 624 | /** |
| group-Avnet | 0:478cfd88041f | 625 | * @} |
| group-Avnet | 0:478cfd88041f | 626 | */ |
| group-Avnet | 0:478cfd88041f | 627 | |
| group-Avnet | 0:478cfd88041f | 628 | |
| group-Avnet | 0:478cfd88041f | 629 | |
| group-Avnet | 0:478cfd88041f | 630 | #ifdef __cplusplus |
| group-Avnet | 0:478cfd88041f | 631 | } |
| group-Avnet | 0:478cfd88041f | 632 | #endif |
| group-Avnet | 0:478cfd88041f | 633 | |
| group-Avnet | 0:478cfd88041f | 634 | #endif |
| group-Avnet | 0:478cfd88041f | 635 | |
| group-Avnet | 0:478cfd88041f | 636 | /******************* (C) COPYRIGHT 2015 STMicroelectronics *****END OF FILE****/ |
Avnet ATT WNC 14A2A Cellular IoT Kit