Added support for the WNC M14A2A Cellular LTE Data Module.

Dependencies:   WNC14A2AInterface

Easy Connect

Easily add all supported connectivity methods to your mbed OS project

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

Specifying connectivity method

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

mbed_app.json

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

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

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

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

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

WNC Debug Settings

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

Using Easy Connect from your application

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

Sample Code

#include "easy-connect.h"

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

Tested on

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

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

  • MPSS: M14A2A_v11.50.164451 APSS: M14A2A_v11.53.164451

License

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

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

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

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

Who changed what in which revision?

UserRevisionLine numberNew contents of line
group-Avnet 0:478cfd88041f 1 /**
group-Avnet 0:478cfd88041f 2 ******************************************************************************
group-Avnet 0:478cfd88041f 3 * @file SPIRIT_Irq.h
group-Avnet 0:478cfd88041f 4 * @author VMA division - AMS
group-Avnet 0:478cfd88041f 5 * @version 3.2.2
group-Avnet 0:478cfd88041f 6 * @date 08-July-2015
group-Avnet 0:478cfd88041f 7 * @brief Configuration and management of SPIRIT IRQs.
group-Avnet 0:478cfd88041f 8 *
group-Avnet 0:478cfd88041f 9 * @details
group-Avnet 0:478cfd88041f 10 *
group-Avnet 0:478cfd88041f 11 * On the Spirit side specific IRQs can be enabled by setting a specific bitmask.
group-Avnet 0:478cfd88041f 12 * The Spirit libraries allow the user to do this in two different ways:
group-Avnet 0:478cfd88041f 13 * <ul>
group-Avnet 0:478cfd88041f 14 *
group-Avnet 0:478cfd88041f 15 * <li>The first enables the IRQs one by one, i.e. using an SPI transaction for each
group-Avnet 0:478cfd88041f 16 * IRQ to enable.
group-Avnet 0:478cfd88041f 17 *
group-Avnet 0:478cfd88041f 18 * <b>Example:</b>
group-Avnet 0:478cfd88041f 19 * @code
group-Avnet 0:478cfd88041f 20 *
group-Avnet 0:478cfd88041f 21 * SpiritIrqDeInit(NULL); // this call is used to reset the IRQ mask registers
group-Avnet 0:478cfd88041f 22 * SpiritIrq(RX_DATA_READY , S_ENABLE);
group-Avnet 0:478cfd88041f 23 * SpiritIrq(VALID_SYNC , S_ENABLE);
group-Avnet 0:478cfd88041f 24 * SpiritIrq(RX_TIMEOUT , S_ENABLE);
group-Avnet 0:478cfd88041f 25 *
group-Avnet 0:478cfd88041f 26 * @endcode
group-Avnet 0:478cfd88041f 27 *
group-Avnet 0:478cfd88041f 28 * </li>
group-Avnet 0:478cfd88041f 29 *
group-Avnet 0:478cfd88041f 30 * <li>The second strategy is to set the IRQ bitfields structure. So, during the initialization the user
group-Avnet 0:478cfd88041f 31 * has to fill the @ref SpiritIrqs structure setting to one the single field related to the IRQ he
group-Avnet 0:478cfd88041f 32 * wants to enable, and to zero the single field related to all the IRQs he wants to disable.
group-Avnet 0:478cfd88041f 33 *
group-Avnet 0:478cfd88041f 34 * <b>Example:</b>
group-Avnet 0:478cfd88041f 35 * @code
group-Avnet 0:478cfd88041f 36 *
group-Avnet 0:478cfd88041f 37 * SpiritIrqs irqMask;
group-Avnet 0:478cfd88041f 38 *
group-Avnet 0:478cfd88041f 39 * ...
group-Avnet 0:478cfd88041f 40 *
group-Avnet 0:478cfd88041f 41 * SpiritIrqDeInit(&irqMask); // this call is used to reset the IRQ mask registers
group-Avnet 0:478cfd88041f 42 * // and to set to 0x00000000 the irq mask in order to disable
group-Avnet 0:478cfd88041f 43 * // all IRQs (disabled by default on startup)
group-Avnet 0:478cfd88041f 44 * irqMask.IRQ_RX_DATA_READY = 1;
group-Avnet 0:478cfd88041f 45 * irqMask.IRQ_VALID_SYNC = 1;
group-Avnet 0:478cfd88041f 46 * irqMask.IRQ_RX_TIMEOUT = 1;
group-Avnet 0:478cfd88041f 47 *
group-Avnet 0:478cfd88041f 48 * ...
group-Avnet 0:478cfd88041f 49 * @endcode
group-Avnet 0:478cfd88041f 50 * </li>
group-Avnet 0:478cfd88041f 51 * </ul>
group-Avnet 0:478cfd88041f 52 *
group-Avnet 0:478cfd88041f 53 * The most applications will require a Spirit IRQ notification on an microcontroller EXTI line.
group-Avnet 0:478cfd88041f 54 * Then, the user can check which IRQ has been raised using two different ways.
group-Avnet 0:478cfd88041f 55 *
group-Avnet 0:478cfd88041f 56 * On the ISR of the EXTI line phisically linked to the Spirit pin configured for IRQ:
group-Avnet 0:478cfd88041f 57 *
group-Avnet 0:478cfd88041f 58 * <ul>
group-Avnet 0:478cfd88041f 59 * <li> Check <b>only one</b> Spirit IRQ (because the Spirit IRQ status register automatically blanks itself
group-Avnet 0:478cfd88041f 60 * after an SPI reading) into the ISR.
group-Avnet 0:478cfd88041f 61 *
group-Avnet 0:478cfd88041f 62 * <b>Example:</b>
group-Avnet 0:478cfd88041f 63 * @code
group-Avnet 0:478cfd88041f 64 *
group-Avnet 0:478cfd88041f 65 * if(SpiritIrqCheckFlag(RX_DATA_READY))
group-Avnet 0:478cfd88041f 66 * {
group-Avnet 0:478cfd88041f 67 * // do something...
group-Avnet 0:478cfd88041f 68 * }
group-Avnet 0:478cfd88041f 69 *
group-Avnet 0:478cfd88041f 70 * @endcode
group-Avnet 0:478cfd88041f 71 * </li>
group-Avnet 0:478cfd88041f 72 *
group-Avnet 0:478cfd88041f 73 * <li> Check more than one Spirit IRQ status by storing the entire IRQ status registers into a bitfields <i>@ref SpiritIrqs</i> structure
group-Avnet 0:478cfd88041f 74 * and then check the interested bits.
group-Avnet 0:478cfd88041f 75 *
group-Avnet 0:478cfd88041f 76 * <b>Example:</b>
group-Avnet 0:478cfd88041f 77 * @code
group-Avnet 0:478cfd88041f 78 *
group-Avnet 0:478cfd88041f 79 * SpiritIrqGetStatus(&irqStatus);
group-Avnet 0:478cfd88041f 80 *
group-Avnet 0:478cfd88041f 81 * if(irqStatus.IRQ_RX_DATA_READY)
group-Avnet 0:478cfd88041f 82 * {
group-Avnet 0:478cfd88041f 83 * // do something...
group-Avnet 0:478cfd88041f 84 * }
group-Avnet 0:478cfd88041f 85 * if(irqStatus.IRQ_VALID_SYNC)
group-Avnet 0:478cfd88041f 86 * {
group-Avnet 0:478cfd88041f 87 * // do something...
group-Avnet 0:478cfd88041f 88 * }
group-Avnet 0:478cfd88041f 89 * if(irqStatus.RX_TIMEOUT)
group-Avnet 0:478cfd88041f 90 * {
group-Avnet 0:478cfd88041f 91 * // do something...
group-Avnet 0:478cfd88041f 92 * }
group-Avnet 0:478cfd88041f 93 *
group-Avnet 0:478cfd88041f 94 * @endcode
group-Avnet 0:478cfd88041f 95 * </li>
group-Avnet 0:478cfd88041f 96 * </ul>
group-Avnet 0:478cfd88041f 97 *
group-Avnet 0:478cfd88041f 98
group-Avnet 0:478cfd88041f 99 * @attention
group-Avnet 0:478cfd88041f 100 *
group-Avnet 0:478cfd88041f 101 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
group-Avnet 0:478cfd88041f 102 *
group-Avnet 0:478cfd88041f 103 * Redistribution and use in source and binary forms, with or without modification,
group-Avnet 0:478cfd88041f 104 * are permitted provided that the following conditions are met:
group-Avnet 0:478cfd88041f 105 * 1. Redistributions of source code must retain the above copyright notice,
group-Avnet 0:478cfd88041f 106 * this list of conditions and the following disclaimer.
group-Avnet 0:478cfd88041f 107 * 2. Redistributions in binary form must reproduce the above copyright notice,
group-Avnet 0:478cfd88041f 108 * this list of conditions and the following disclaimer in the documentation
group-Avnet 0:478cfd88041f 109 * and/or other materials provided with the distribution.
group-Avnet 0:478cfd88041f 110 * 3. Neither the name of STMicroelectronics nor the names of its contributors
group-Avnet 0:478cfd88041f 111 * may be used to endorse or promote products derived from this software
group-Avnet 0:478cfd88041f 112 * without specific prior written permission.
group-Avnet 0:478cfd88041f 113 *
group-Avnet 0:478cfd88041f 114 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
group-Avnet 0:478cfd88041f 115 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
group-Avnet 0:478cfd88041f 116 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
group-Avnet 0:478cfd88041f 117 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
group-Avnet 0:478cfd88041f 118 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
group-Avnet 0:478cfd88041f 119 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
group-Avnet 0:478cfd88041f 120 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
group-Avnet 0:478cfd88041f 121 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
group-Avnet 0:478cfd88041f 122 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
group-Avnet 0:478cfd88041f 123 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
group-Avnet 0:478cfd88041f 124 *
group-Avnet 0:478cfd88041f 125 ******************************************************************************
group-Avnet 0:478cfd88041f 126 */
group-Avnet 0:478cfd88041f 127
group-Avnet 0:478cfd88041f 128 /* Define to prevent recursive inclusion -------------------------------------*/
group-Avnet 0:478cfd88041f 129 #ifndef __SPIRIT1_IRQ_H
group-Avnet 0:478cfd88041f 130 #define __SPIRIT1_IRQ_H
group-Avnet 0:478cfd88041f 131
group-Avnet 0:478cfd88041f 132
group-Avnet 0:478cfd88041f 133 /* Includes ------------------------------------------------------------------*/
group-Avnet 0:478cfd88041f 134
group-Avnet 0:478cfd88041f 135 #include "SPIRIT_Regs.h"
group-Avnet 0:478cfd88041f 136 #include "SPIRIT_Types.h"
group-Avnet 0:478cfd88041f 137
group-Avnet 0:478cfd88041f 138
group-Avnet 0:478cfd88041f 139 #ifdef __cplusplus
group-Avnet 0:478cfd88041f 140 extern "C" {
group-Avnet 0:478cfd88041f 141 #endif
group-Avnet 0:478cfd88041f 142
group-Avnet 0:478cfd88041f 143
group-Avnet 0:478cfd88041f 144 /**
group-Avnet 0:478cfd88041f 145 * @addtogroup SPIRIT_Libraries
group-Avnet 0:478cfd88041f 146 * @{
group-Avnet 0:478cfd88041f 147 */
group-Avnet 0:478cfd88041f 148
group-Avnet 0:478cfd88041f 149
group-Avnet 0:478cfd88041f 150 /**
group-Avnet 0:478cfd88041f 151 * @defgroup SPIRIT_Irq IRQ
group-Avnet 0:478cfd88041f 152 * @brief Configuration and management of SPIRIT IRQs.
group-Avnet 0:478cfd88041f 153 * @details See the file <i>@ref SPIRIT_Irq.h</i> for more details.
group-Avnet 0:478cfd88041f 154 * @{
group-Avnet 0:478cfd88041f 155 */
group-Avnet 0:478cfd88041f 156
group-Avnet 0:478cfd88041f 157 /**
group-Avnet 0:478cfd88041f 158 * @defgroup Irq_Exported_Types IRQ Exported Types
group-Avnet 0:478cfd88041f 159 * @{
group-Avnet 0:478cfd88041f 160 */
group-Avnet 0:478cfd88041f 161
group-Avnet 0:478cfd88041f 162
group-Avnet 0:478cfd88041f 163 /**
group-Avnet 0:478cfd88041f 164 * @brief IRQ bitfield structure for SPIRIT. This structure is used to read or write the single IRQ bit.
group-Avnet 0:478cfd88041f 165 * During the initialization the user has to fill this structure setting to one the single field related
group-Avnet 0:478cfd88041f 166 * to the IRQ he wants to enable, and to zero the single field related to all the IRQs he wants to disable.
group-Avnet 0:478cfd88041f 167 * The same structure can be used to retrieve all the IRQ events from the IRQ registers IRQ_STATUS[3:0],
group-Avnet 0:478cfd88041f 168 * and read if one or more specific IRQ raised.
group-Avnet 0:478cfd88041f 169 * @note The fields order in the structure depends on used endianness (little or big
group-Avnet 0:478cfd88041f 170 * endian). The actual definition is valid ONLY for LITTLE ENDIAN mode. Be sure to
group-Avnet 0:478cfd88041f 171 * change opportunely the fields order when use a different endianness.
group-Avnet 0:478cfd88041f 172 */
group-Avnet 0:478cfd88041f 173 typedef struct
group-Avnet 0:478cfd88041f 174 {
group-Avnet 0:478cfd88041f 175 SpiritFlagStatus IRQ_SYNTH_LOCK_TIMEOUT:1; /*!< IRQ: only for debug; LOCK state timeout */
group-Avnet 0:478cfd88041f 176 SpiritFlagStatus IRQ_SYNTH_LOCK_STARTUP:1; /*!< IRQ: only for debug; see CALIBR_START_COUNTER */
group-Avnet 0:478cfd88041f 177 SpiritFlagStatus IRQ_SYNTH_CAL_TIMEOUT:1; /*!< IRQ: only for debug; SYNTH calibration timeout */
group-Avnet 0:478cfd88041f 178 SpiritFlagStatus IRQ_TX_START_TIME:1; /*!< IRQ: only for debug; TX circuitry startup time; see TX_START_COUNTER */
group-Avnet 0:478cfd88041f 179 SpiritFlagStatus IRQ_RX_START_TIME:1; /*!< IRQ: only for debug; RX circuitry startup time; see TX_START_COUNTER */
group-Avnet 0:478cfd88041f 180 SpiritFlagStatus IRQ_RX_TIMEOUT:1; /*!< IRQ: RX operation timeout */
group-Avnet 0:478cfd88041f 181 SpiritFlagStatus IRQ_AES_END:1; /*!< IRQ: AES End of operation */
group-Avnet 0:478cfd88041f 182 SpiritFlagStatus reserved:1; /*!< Reserved bit */
group-Avnet 0:478cfd88041f 183
group-Avnet 0:478cfd88041f 184 SpiritFlagStatus IRQ_READY:1; /*!< IRQ: READY state */
group-Avnet 0:478cfd88041f 185 SpiritFlagStatus IRQ_STANDBY_DELAYED:1; /*!< IRQ: STANDBY state after MCU_CK_CONF_CLOCK_TAIL_X clock cycles */
group-Avnet 0:478cfd88041f 186 SpiritFlagStatus IRQ_LOW_BATT_LVL:1; /*!< IRQ: Battery level below threshold*/
group-Avnet 0:478cfd88041f 187 SpiritFlagStatus IRQ_POR:1; /*!< IRQ: Power On Reset */
group-Avnet 0:478cfd88041f 188 SpiritFlagStatus IRQ_BOR:1; /*!< IRQ: Brown out event (both accurate and inaccurate)*/
group-Avnet 0:478cfd88041f 189 SpiritFlagStatus IRQ_LOCK:1; /*!< IRQ: LOCK state */
group-Avnet 0:478cfd88041f 190 SpiritFlagStatus IRQ_PM_COUNT_EXPIRED:1; /*!< IRQ: only for debug; Power Management startup timer expiration (see reg PM_START_COUNTER, 0xB5) */
group-Avnet 0:478cfd88041f 191 SpiritFlagStatus IRQ_XO_COUNT_EXPIRED:1; /*!< IRQ: only for debug; Crystal oscillator settling time counter expired */
group-Avnet 0:478cfd88041f 192
group-Avnet 0:478cfd88041f 193 SpiritFlagStatus IRQ_TX_FIFO_ALMOST_EMPTY:1; /*!< IRQ: TX FIFO almost empty */
group-Avnet 0:478cfd88041f 194 SpiritFlagStatus IRQ_RX_FIFO_ALMOST_FULL:1; /*!< IRQ: RX FIFO almost full */
group-Avnet 0:478cfd88041f 195 SpiritFlagStatus IRQ_RX_FIFO_ALMOST_EMPTY:1; /*!< IRQ: RX FIFO almost empty */
group-Avnet 0:478cfd88041f 196 SpiritFlagStatus IRQ_MAX_BO_CCA_REACH:1; /*!< IRQ: Max number of back-off during CCA */
group-Avnet 0:478cfd88041f 197 SpiritFlagStatus IRQ_VALID_PREAMBLE:1; /*!< IRQ: Valid preamble detected */
group-Avnet 0:478cfd88041f 198 SpiritFlagStatus IRQ_VALID_SYNC:1; /*!< IRQ: Sync word detected */
group-Avnet 0:478cfd88041f 199 SpiritFlagStatus IRQ_RSSI_ABOVE_TH:1; /*!< IRQ: RSSI above threshold */
group-Avnet 0:478cfd88041f 200 SpiritFlagStatus IRQ_WKUP_TOUT_LDC:1; /*!< IRQ: Wake-up timeout in LDC mode */
group-Avnet 0:478cfd88041f 201
group-Avnet 0:478cfd88041f 202 SpiritFlagStatus IRQ_RX_DATA_READY:1; /*!< IRQ: RX data ready */
group-Avnet 0:478cfd88041f 203 SpiritFlagStatus IRQ_RX_DATA_DISC:1; /*!< IRQ: RX data discarded (upon filtering) */
group-Avnet 0:478cfd88041f 204 SpiritFlagStatus IRQ_TX_DATA_SENT:1; /*!< IRQ: TX data sent */
group-Avnet 0:478cfd88041f 205 SpiritFlagStatus IRQ_MAX_RE_TX_REACH:1; /*!< IRQ: Max re-TX reached */
group-Avnet 0:478cfd88041f 206 SpiritFlagStatus IRQ_CRC_ERROR:1; /*!< IRQ: CRC error */
group-Avnet 0:478cfd88041f 207 SpiritFlagStatus IRQ_TX_FIFO_ERROR:1; /*!< IRQ: TX FIFO underflow/overflow error */
group-Avnet 0:478cfd88041f 208 SpiritFlagStatus IRQ_RX_FIFO_ERROR:1; /*!< IRQ: RX FIFO underflow/overflow error */
group-Avnet 0:478cfd88041f 209 SpiritFlagStatus IRQ_TX_FIFO_ALMOST_FULL:1; /*!< IRQ: TX FIFO almost full */
group-Avnet 0:478cfd88041f 210 } SpiritIrqs;
group-Avnet 0:478cfd88041f 211
group-Avnet 0:478cfd88041f 212 // betzw: uint32_t masks
group-Avnet 0:478cfd88041f 213 #define IRQ_TX_FIFO_ALMOST_EMPTY_MASK (0x00010000) /* (1<<16) */
group-Avnet 0:478cfd88041f 214 #define IRQ_RX_FIFO_ALMOST_FULL_MASK (0x00020000) /* (1<<17) */
group-Avnet 0:478cfd88041f 215 #define IRQ_VALID_SYNC_MASK (0x00200000) /* (1<<21) */
group-Avnet 0:478cfd88041f 216 #define IRQ_RX_DATA_READY_MASK (0x01000000) /* (1<<24) */
group-Avnet 0:478cfd88041f 217 #define IRQ_RX_DATA_DISC_MASK (0x02000000) /* (1<<25) */
group-Avnet 0:478cfd88041f 218 #define IRQ_TX_DATA_SENT_MASK (0x04000000) /* (1<<26) */
group-Avnet 0:478cfd88041f 219 #define IRQ_TX_FIFO_ERROR_MASK (0x20000000) /* (1<<29) */
group-Avnet 0:478cfd88041f 220 #define IRQ_RX_FIFO_ERROR_MASK (0x40000000) /* (1<<30) */
group-Avnet 0:478cfd88041f 221
group-Avnet 0:478cfd88041f 222 /**
group-Avnet 0:478cfd88041f 223 * @brief IRQ list enumeration for SPIRIT. This enumeration type can be used to address a
group-Avnet 0:478cfd88041f 224 * specific IRQ.
group-Avnet 0:478cfd88041f 225 */
group-Avnet 0:478cfd88041f 226 typedef enum
group-Avnet 0:478cfd88041f 227 {
group-Avnet 0:478cfd88041f 228 RX_DATA_READY = 0x00000001, /*!< IRQ: RX data ready */
group-Avnet 0:478cfd88041f 229 RX_DATA_DISC = 0x00000002, /*!< IRQ: RX data discarded (upon filtering) */
group-Avnet 0:478cfd88041f 230 TX_DATA_SENT = 0x00000004, /*!< IRQ: TX data sent */
group-Avnet 0:478cfd88041f 231 MAX_RE_TX_REACH = 0x00000008, /*!< IRQ: Max re-TX reached */
group-Avnet 0:478cfd88041f 232 CRC_ERROR = 0x00000010, /*!< IRQ: CRC error */
group-Avnet 0:478cfd88041f 233 TX_FIFO_ERROR = 0x00000020, /*!< IRQ: TX FIFO underflow/overflow error */
group-Avnet 0:478cfd88041f 234 RX_FIFO_ERROR = 0x00000040, /*!< IRQ: RX FIFO underflow/overflow error */
group-Avnet 0:478cfd88041f 235 TX_FIFO_ALMOST_FULL = 0x00000080, /*!< IRQ: TX FIFO almost full */
group-Avnet 0:478cfd88041f 236 TX_FIFO_ALMOST_EMPTY = 0x00000100, /*!< IRQ: TX FIFO almost empty */
group-Avnet 0:478cfd88041f 237 RX_FIFO_ALMOST_FULL = 0x00000200, /*!< IRQ: RX FIFO almost full */
group-Avnet 0:478cfd88041f 238 RX_FIFO_ALMOST_EMPTY = 0x00000400, /*!< IRQ: RX FIFO almost empty */
group-Avnet 0:478cfd88041f 239 MAX_BO_CCA_REACH = 0x00000800, /*!< IRQ: Max number of back-off during CCA */
group-Avnet 0:478cfd88041f 240 VALID_PREAMBLE = 0x00001000, /*!< IRQ: Valid preamble detected */
group-Avnet 0:478cfd88041f 241 VALID_SYNC = 0x00002000, /*!< IRQ: Sync word detected */
group-Avnet 0:478cfd88041f 242 RSSI_ABOVE_TH = 0x00004000, /*!< IRQ: RSSI above threshold */
group-Avnet 0:478cfd88041f 243 WKUP_TOUT_LDC = 0x00008000, /*!< IRQ: Wake-up timeout in LDC mode */
group-Avnet 0:478cfd88041f 244 READY = 0x00010000, /*!< IRQ: READY state */
group-Avnet 0:478cfd88041f 245 STANDBY_DELAYED = 0x00020000, /*!< IRQ: STANDBY state after MCU_CK_CONF_CLOCK_TAIL_X clock cycles */
group-Avnet 0:478cfd88041f 246 LOW_BATT_LVL = 0x00040000, /*!< IRQ: Battery level below threshold*/
group-Avnet 0:478cfd88041f 247 POR = 0x00080000, /*!< IRQ: Power On Reset */
group-Avnet 0:478cfd88041f 248 BOR = 0x00100000, /*!< IRQ: Brown out event (both accurate and inaccurate)*/
group-Avnet 0:478cfd88041f 249 LOCK = 0x00200000, /*!< IRQ: LOCK state */
group-Avnet 0:478cfd88041f 250 PM_COUNT_EXPIRED = 0x00400000, /*!< IRQ: only for debug; Power Management startup timer expiration (see reg PM_START_COUNTER, 0xB5) */
group-Avnet 0:478cfd88041f 251 XO_COUNT_EXPIRED = 0x00800000, /*!< IRQ: only for debug; Crystal oscillator settling time counter expired */
group-Avnet 0:478cfd88041f 252 SYNTH_LOCK_TIMEOUT = 0x01000000, /*!< IRQ: only for debug; LOCK state timeout */
group-Avnet 0:478cfd88041f 253 SYNTH_LOCK_STARTUP = 0x02000000, /*!< IRQ: only for debug; see CALIBR_START_COUNTER */
group-Avnet 0:478cfd88041f 254 SYNTH_CAL_TIMEOUT = 0x04000000, /*!< IRQ: only for debug; SYNTH calibration timeout */
group-Avnet 0:478cfd88041f 255 TX_START_TIME = 0x08000000, /*!< IRQ: only for debug; TX circuitry startup time; see TX_START_COUNTER */
group-Avnet 0:478cfd88041f 256 RX_START_TIME = 0x10000000, /*!< IRQ: only for debug; RX circuitry startup time; see TX_START_COUNTER */
group-Avnet 0:478cfd88041f 257 RX_TIMEOUT = 0x20000000, /*!< IRQ: RX operation timeout */
group-Avnet 0:478cfd88041f 258 AES_END = 0x40000000, /*!< IRQ: AES End of operation */
group-Avnet 0:478cfd88041f 259 ALL_IRQ = 0x7FFFFFFF /*!< All the above mentioned IRQs */
group-Avnet 0:478cfd88041f 260
group-Avnet 0:478cfd88041f 261 } IrqList;
group-Avnet 0:478cfd88041f 262
group-Avnet 0:478cfd88041f 263 #define IS_SPIRIT_IRQ_LIST(VALUE) ((VALUE == RX_DATA_READY) || \
group-Avnet 0:478cfd88041f 264 (VALUE == RX_DATA_DISC) || \
group-Avnet 0:478cfd88041f 265 (VALUE == TX_DATA_SENT) || \
group-Avnet 0:478cfd88041f 266 (VALUE == MAX_RE_TX_REACH) || \
group-Avnet 0:478cfd88041f 267 (VALUE == CRC_ERROR) || \
group-Avnet 0:478cfd88041f 268 (VALUE == TX_FIFO_ERROR) || \
group-Avnet 0:478cfd88041f 269 (VALUE == RX_FIFO_ERROR) || \
group-Avnet 0:478cfd88041f 270 (VALUE == TX_FIFO_ALMOST_FULL) || \
group-Avnet 0:478cfd88041f 271 (VALUE == TX_FIFO_ALMOST_EMPTY) || \
group-Avnet 0:478cfd88041f 272 (VALUE == RX_FIFO_ALMOST_FULL) || \
group-Avnet 0:478cfd88041f 273 (VALUE == RX_FIFO_ALMOST_EMPTY) || \
group-Avnet 0:478cfd88041f 274 (VALUE == MAX_BO_CCA_REACH) || \
group-Avnet 0:478cfd88041f 275 (VALUE == VALID_PREAMBLE) || \
group-Avnet 0:478cfd88041f 276 (VALUE == VALID_SYNC) || \
group-Avnet 0:478cfd88041f 277 (VALUE == RSSI_ABOVE_TH) || \
group-Avnet 0:478cfd88041f 278 (VALUE == WKUP_TOUT_LDC) || \
group-Avnet 0:478cfd88041f 279 (VALUE == READY) || \
group-Avnet 0:478cfd88041f 280 (VALUE == STANDBY_DELAYED) || \
group-Avnet 0:478cfd88041f 281 (VALUE == LOW_BATT_LVL) || \
group-Avnet 0:478cfd88041f 282 (VALUE == POR) || \
group-Avnet 0:478cfd88041f 283 (VALUE == BOR) || \
group-Avnet 0:478cfd88041f 284 (VALUE == LOCK) || \
group-Avnet 0:478cfd88041f 285 (VALUE == PM_COUNT_EXPIRED) || \
group-Avnet 0:478cfd88041f 286 (VALUE == XO_COUNT_EXPIRED) || \
group-Avnet 0:478cfd88041f 287 (VALUE == SYNTH_LOCK_TIMEOUT) || \
group-Avnet 0:478cfd88041f 288 (VALUE == SYNTH_LOCK_STARTUP) || \
group-Avnet 0:478cfd88041f 289 (VALUE == SYNTH_CAL_TIMEOUT) || \
group-Avnet 0:478cfd88041f 290 (VALUE == TX_START_TIME) || \
group-Avnet 0:478cfd88041f 291 (VALUE == RX_START_TIME) || \
group-Avnet 0:478cfd88041f 292 (VALUE == RX_TIMEOUT) || \
group-Avnet 0:478cfd88041f 293 (VALUE == AES_END) || \
group-Avnet 0:478cfd88041f 294 (VALUE == ALL_IRQ ))
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
group-Avnet 0:478cfd88041f 301
group-Avnet 0:478cfd88041f 302 /**
group-Avnet 0:478cfd88041f 303 * @defgroup Irq_Exported_Constants IRQ Exported Constants
group-Avnet 0:478cfd88041f 304 * @{
group-Avnet 0:478cfd88041f 305 */
group-Avnet 0:478cfd88041f 306
group-Avnet 0:478cfd88041f 307
group-Avnet 0:478cfd88041f 308 /**
group-Avnet 0:478cfd88041f 309 * @}
group-Avnet 0:478cfd88041f 310 */
group-Avnet 0:478cfd88041f 311
group-Avnet 0:478cfd88041f 312
group-Avnet 0:478cfd88041f 313 /**
group-Avnet 0:478cfd88041f 314 * @defgroup Irq_Exported_Macros IRQ Exported Macros
group-Avnet 0:478cfd88041f 315 * @{
group-Avnet 0:478cfd88041f 316 */
group-Avnet 0:478cfd88041f 317
group-Avnet 0:478cfd88041f 318
group-Avnet 0:478cfd88041f 319 /**
group-Avnet 0:478cfd88041f 320 * @}
group-Avnet 0:478cfd88041f 321 */
group-Avnet 0:478cfd88041f 322
group-Avnet 0:478cfd88041f 323
group-Avnet 0:478cfd88041f 324 /**
group-Avnet 0:478cfd88041f 325 * @defgroup Irq_Exported_Functions IRQ Exported Functions
group-Avnet 0:478cfd88041f 326 * @{
group-Avnet 0:478cfd88041f 327 */
group-Avnet 0:478cfd88041f 328
group-Avnet 0:478cfd88041f 329 void SpiritIrqDeInit(SpiritIrqs* pxIrqInit);
group-Avnet 0:478cfd88041f 330 void SpiritIrqInit(SpiritIrqs* pxIrqInit);
group-Avnet 0:478cfd88041f 331 void SpiritIrq(IrqList xIrq, SpiritFunctionalState xNewState);
group-Avnet 0:478cfd88041f 332 void SpiritIrqGetMask(SpiritIrqs* pxIrqMask);
group-Avnet 0:478cfd88041f 333 void SpiritIrqGetStatus(SpiritIrqs* pxIrqStatus);
group-Avnet 0:478cfd88041f 334 void SpiritIrqClearStatus(void);
group-Avnet 0:478cfd88041f 335 SpiritBool SpiritIrqCheckFlag(IrqList xFlag);
group-Avnet 0:478cfd88041f 336
group-Avnet 0:478cfd88041f 337 /**
group-Avnet 0:478cfd88041f 338 * @}
group-Avnet 0:478cfd88041f 339 */
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 /**
group-Avnet 0:478cfd88041f 347 * @}
group-Avnet 0:478cfd88041f 348 */
group-Avnet 0:478cfd88041f 349
group-Avnet 0:478cfd88041f 350
group-Avnet 0:478cfd88041f 351 #ifdef __cplusplus
group-Avnet 0:478cfd88041f 352 }
group-Avnet 0:478cfd88041f 353 #endif
group-Avnet 0:478cfd88041f 354
group-Avnet 0:478cfd88041f 355 #endif
group-Avnet 0:478cfd88041f 356
group-Avnet 0:478cfd88041f 357 /******************* (C) COPYRIGHT 2015 STMicroelectronics *****END OF FILE****/