Jim Flynn / easy-connect

Dependencies:   WNC14A2AInterface

Dependents:   http-example-wnc http-example-wnc-modified

Committer:
JMF
Date:
Wed Apr 19 01:13:10 2017 +0000
Revision:
0:2563b0415d1f
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
JMF 0:2563b0415d1f 1 /*
JMF 0:2563b0415d1f 2 * Copyright (c) 2012, STMicroelectronics.
JMF 0:2563b0415d1f 3 * All rights reserved.
JMF 0:2563b0415d1f 4 *
JMF 0:2563b0415d1f 5 * Redistribution and use in source and binary forms, with or without
JMF 0:2563b0415d1f 6 * modification, are permitted provided that the following conditions
JMF 0:2563b0415d1f 7 * are met:
JMF 0:2563b0415d1f 8 * 1. Redistributions of source code must retain the above copyright
JMF 0:2563b0415d1f 9 * notice, this list of conditions and the following disclaimer.
JMF 0:2563b0415d1f 10 * 2. Redistributions in binary form must reproduce the above copyright
JMF 0:2563b0415d1f 11 * notice, this list of conditions and the following disclaimer in the
JMF 0:2563b0415d1f 12 * documentation and/or other materials provided with the distribution.
JMF 0:2563b0415d1f 13 * 3. Neither the name of the Institute nor the names of its contributors
JMF 0:2563b0415d1f 14 * may be used to endorse or promote products derived from this software
JMF 0:2563b0415d1f 15 * without specific prior written permission.
JMF 0:2563b0415d1f 16 *
JMF 0:2563b0415d1f 17 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
JMF 0:2563b0415d1f 18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
JMF 0:2563b0415d1f 19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
JMF 0:2563b0415d1f 20 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
JMF 0:2563b0415d1f 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
JMF 0:2563b0415d1f 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
JMF 0:2563b0415d1f 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
JMF 0:2563b0415d1f 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
JMF 0:2563b0415d1f 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
JMF 0:2563b0415d1f 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
JMF 0:2563b0415d1f 27 * SUCH DAMAGE.
JMF 0:2563b0415d1f 28 *
JMF 0:2563b0415d1f 29 * This file is part of the Contiki operating system.
JMF 0:2563b0415d1f 30 *
JMF 0:2563b0415d1f 31 */
JMF 0:2563b0415d1f 32 /*---------------------------------------------------------------------------*/
JMF 0:2563b0415d1f 33 #ifndef __SPIRIT1_CONFIG_H__
JMF 0:2563b0415d1f 34 #define __SPIRIT1_CONFIG_H__
JMF 0:2563b0415d1f 35 /*---------------------------------------------------------------------------*/
JMF 0:2563b0415d1f 36 #include "radio.h"
JMF 0:2563b0415d1f 37 #include "SPIRIT_Config.h"
JMF 0:2563b0415d1f 38 #include "spirit1-const.h"
JMF 0:2563b0415d1f 39 /*---------------------------------------------------------------------------*/
JMF 0:2563b0415d1f 40 #define CCA_THRESHOLD -98.0 /* dBm */
JMF 0:2563b0415d1f 41 #define XTAL_FREQUENCY 50000000 /* Hz */
JMF 0:2563b0415d1f 42 #define SPIRIT_MAX_FIFO_LEN (96) // betzw - WAS: 600
JMF 0:2563b0415d1f 43 /*---------------------------------------------------------------------------*/
JMF 0:2563b0415d1f 44
JMF 0:2563b0415d1f 45 /* Sometimes Spirit1 seems to NOT deliver (correctly) the 'IRQ_RX_DATA_READY'
JMF 0:2563b0415d1f 46 * event for packets which have a length which is close to a multiple of
JMF 0:2563b0415d1f 47 * RX FIFO size. Furthermore, in these cases also the content delivery seems
JMF 0:2563b0415d1f 48 * to be compromised as well as the generation of RX/TX FIFO errors.
JMF 0:2563b0415d1f 49 * This can be avoided by reducing the maximum packet length to a value which
JMF 0:2563b0415d1f 50 * is lower than the RX FIFO size.
JMF 0:2563b0415d1f 51 *
JMF 0:2563b0415d1f 52 * Enable beyond macro if you want to use the version of the driver which avoids
JMF 0:2563b0415d1f 53 * FIFO overflows by reducing packet length.
JMF 0:2563b0415d1f 54 *
JMF 0:2563b0415d1f 55 * NOTE: the non delivery of event 'IRQ_RX_DATA_READY' MUST still be
JMF 0:2563b0415d1f 56 * investigated further deeply (both on HW & SW level)!
JMF 0:2563b0415d1f 57 */
JMF 0:2563b0415d1f 58 #define RX_FIFO_THR_WA
JMF 0:2563b0415d1f 59
JMF 0:2563b0415d1f 60 /**
JMF 0:2563b0415d1f 61 * The MAX_PACKET_LEN is an arbitrary value used to define the two array
JMF 0:2563b0415d1f 62 * spirit_txbuf and spirit_rxbuf.
JMF 0:2563b0415d1f 63 * The SPIRIT1 supports with its packet handler a length of 65,535 bytes,
JMF 0:2563b0415d1f 64 * and in direct mode (without packet handler) there is no limit of data.
JMF 0:2563b0415d1f 65 */
JMF 0:2563b0415d1f 66 #ifdef RX_FIFO_THR_WA
JMF 0:2563b0415d1f 67 #define MAX_PACKET_LEN (SPIRIT_MAX_FIFO_LEN-1)
JMF 0:2563b0415d1f 68 #else
JMF 0:2563b0415d1f 69 #define MAX_PACKET_LEN (255) // betzw - WAS: SPIRIT_MAX_FIFO_LEN, but LEN_WIDTH is set to 7 so the variable payload length is theoretically from 0 to 255 bytes
JMF 0:2563b0415d1f 70 #endif
JMF 0:2563b0415d1f 71
JMF 0:2563b0415d1f 72 /*---------------------------------------------------------------------------*/
JMF 0:2563b0415d1f 73 /**
JMF 0:2563b0415d1f 74 * Spirit1 IC version
JMF 0:2563b0415d1f 75 */
JMF 0:2563b0415d1f 76 #define SPIRIT1_VERSION SPIRIT_VERSION_3_0
JMF 0:2563b0415d1f 77 /*---------------------------------------------------------------------------*/
JMF 0:2563b0415d1f 78 #endif /* __SPIRIT1_CONFIG_H__ */
JMF 0:2563b0415d1f 79 /*---------------------------------------------------------------------------*/