wifi test

Dependencies:   X_NUCLEO_IKS01A2 mbed-http

Committer:
JMF
Date:
Wed Sep 05 14:28:24 2018 +0000
Revision:
0:24d3eb812fd4
Initial commit

Who changed what in which revision?

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