Fork of my MQTTGateway

Dependencies:   mbed-http

Committer:
vpcola
Date:
Sat Apr 08 14:45:51 2017 +0000
Revision:
0:f1d3878b8dd9
Initial commit

Who changed what in which revision?

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