JunMo Hong / EV-COG-AD3029LZ

Fork of stm-spirit1-rf-driver by ST

Committer:
Wolfgang Betz
Date:
Mon Nov 07 10:01:36 2016 +0100
Revision:
18:d6f789f6f4c9
Parent:
5:c9c5bc673c64
Child:
30:9c6dcfc47619
Add 'RX_FIFO_THR_WA' RX FIFO threshold trigger workaround (for K64F boards)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Wolfgang Betz 0:4fb29d9ee571 1 /*
Wolfgang Betz 0:4fb29d9ee571 2 * Copyright (c) 2012, STMicroelectronics.
Wolfgang Betz 0:4fb29d9ee571 3 * All rights reserved.
Wolfgang Betz 0:4fb29d9ee571 4 *
Wolfgang Betz 0:4fb29d9ee571 5 * Redistribution and use in source and binary forms, with or without
Wolfgang Betz 0:4fb29d9ee571 6 * modification, are permitted provided that the following conditions
Wolfgang Betz 0:4fb29d9ee571 7 * are met:
Wolfgang Betz 0:4fb29d9ee571 8 * 1. Redistributions of source code must retain the above copyright
Wolfgang Betz 0:4fb29d9ee571 9 * notice, this list of conditions and the following disclaimer.
Wolfgang Betz 0:4fb29d9ee571 10 * 2. Redistributions in binary form must reproduce the above copyright
Wolfgang Betz 0:4fb29d9ee571 11 * notice, this list of conditions and the following disclaimer in the
Wolfgang Betz 0:4fb29d9ee571 12 * documentation and/or other materials provided with the distribution.
Wolfgang Betz 0:4fb29d9ee571 13 * 3. Neither the name of the Institute nor the names of its contributors
Wolfgang Betz 0:4fb29d9ee571 14 * may be used to endorse or promote products derived from this software
Wolfgang Betz 0:4fb29d9ee571 15 * without specific prior written permission.
Wolfgang Betz 0:4fb29d9ee571 16 *
Wolfgang Betz 0:4fb29d9ee571 17 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
Wolfgang Betz 0:4fb29d9ee571 18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Wolfgang Betz 0:4fb29d9ee571 19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Wolfgang Betz 0:4fb29d9ee571 20 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
Wolfgang Betz 0:4fb29d9ee571 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Wolfgang Betz 0:4fb29d9ee571 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
Wolfgang Betz 0:4fb29d9ee571 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
Wolfgang Betz 0:4fb29d9ee571 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
Wolfgang Betz 0:4fb29d9ee571 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
Wolfgang Betz 0:4fb29d9ee571 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
Wolfgang Betz 0:4fb29d9ee571 27 * SUCH DAMAGE.
Wolfgang Betz 0:4fb29d9ee571 28 *
Wolfgang Betz 0:4fb29d9ee571 29 * This file is part of the Contiki operating system.
Wolfgang Betz 0:4fb29d9ee571 30 *
Wolfgang Betz 0:4fb29d9ee571 31 */
Wolfgang Betz 0:4fb29d9ee571 32 /*---------------------------------------------------------------------------*/
Wolfgang Betz 0:4fb29d9ee571 33 #ifndef __SPIRIT1_CONFIG_H__
Wolfgang Betz 0:4fb29d9ee571 34 #define __SPIRIT1_CONFIG_H__
Wolfgang Betz 0:4fb29d9ee571 35 /*---------------------------------------------------------------------------*/
Wolfgang Betz 0:4fb29d9ee571 36 #include "radio.h"
Wolfgang Betz 0:4fb29d9ee571 37 #include "SPIRIT_Config.h"
Wolfgang Betz 0:4fb29d9ee571 38 #include "spirit1-const.h"
Wolfgang Betz 0:4fb29d9ee571 39 /*---------------------------------------------------------------------------*/
Wolfgang Betz 0:4fb29d9ee571 40 #define CCA_THRESHOLD -98.0 /* dBm */
Wolfgang Betz 0:4fb29d9ee571 41 #define XTAL_FREQUENCY 50000000 /* Hz */
Wolfgang Betz 5:c9c5bc673c64 42 #define SPIRIT_MAX_FIFO_LEN (96) // betzw - WAS: 600
Wolfgang Betz 0:4fb29d9ee571 43 /*---------------------------------------------------------------------------*/
Wolfgang Betz 0:4fb29d9ee571 44
Wolfgang Betz 18:d6f789f6f4c9 45 /* Define beyond macro when your network includes a platform - like the K64F from
Wolfgang Betz 18:d6f789f6f4c9 46 * Freescale - which suffers from a not yet analyzed (HW) bug in delivering/receiving
Wolfgang Betz 18:d6f789f6f4c9 47 * further interrupts by/from Spirit after having reached the RX FIFO threshold and
Wolfgang Betz 18:d6f789f6f4c9 48 * elaborated the corresponding 'IRQ_RX_FIFO_ALMOST_FULL' interrupt.
Wolfgang Betz 18:d6f789f6f4c9 49 * NOTE: this enables just a workaround!!!
Wolfgang Betz 18:d6f789f6f4c9 50 */
Wolfgang Betz 18:d6f789f6f4c9 51 #define RX_FIFO_THR_WA
Wolfgang Betz 18:d6f789f6f4c9 52
Wolfgang Betz 0:4fb29d9ee571 53 /**
Wolfgang Betz 0:4fb29d9ee571 54 * The MAX_PACKET_LEN is an arbitrary value used to define the two array
Wolfgang Betz 0:4fb29d9ee571 55 * spirit_txbuf and spirit_rxbuf.
Wolfgang Betz 0:4fb29d9ee571 56 * The SPIRIT1 supports with its packet handler a length of 65,535 bytes,
Wolfgang Betz 0:4fb29d9ee571 57 * and in direct mode (without packet handler) there is no limit of data.
Wolfgang Betz 18:d6f789f6f4c9 58 */
Wolfgang Betz 18:d6f789f6f4c9 59 #ifdef RX_FIFO_THR_WA
Wolfgang Betz 18:d6f789f6f4c9 60 #define MAX_PACKET_LEN (SPIRIT_MAX_FIFO_LEN-1)
Wolfgang Betz 18:d6f789f6f4c9 61 #else
Wolfgang Betz 5:c9c5bc673c64 62 #define MAX_PACKET_LEN (255) // betzw - WAS: SPIRIT_MAX_FIFO_LEN, but LEN_WIDTH is set to 7 so the variable payload length is from 0 to 255 bytes
Wolfgang Betz 18:d6f789f6f4c9 63 #endif
Wolfgang Betz 18:d6f789f6f4c9 64
Wolfgang Betz 0:4fb29d9ee571 65 /*---------------------------------------------------------------------------*/
Wolfgang Betz 0:4fb29d9ee571 66 /**
Wolfgang Betz 0:4fb29d9ee571 67 * Spirit1 IC version
Wolfgang Betz 0:4fb29d9ee571 68 */
Wolfgang Betz 0:4fb29d9ee571 69 #define SPIRIT1_VERSION SPIRIT_VERSION_3_0
Wolfgang Betz 0:4fb29d9ee571 70 /*---------------------------------------------------------------------------*/
Wolfgang Betz 0:4fb29d9ee571 71 #endif /* __SPIRIT1_CONFIG_H__ */
Wolfgang Betz 0:4fb29d9ee571 72 /*---------------------------------------------------------------------------*/