/* * Copyright (c) 2014, Texas Instruments Incorporated - http://www.ti.com/ * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the copyright holder nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * \addtogroup cc26xx-srf-tag * @{ * * \file * Configuration for the srf06-cc26xx platform */ #ifndef CONTIKI_CONF_H #define CONTIKI_CONF_H #include /*---------------------------------------------------------------------------*/ /* Include Project Specific conf */ #ifdef PROJECT_CONF_H #include PROJECT_CONF_H #endif /* PROJECT_CONF_H */ /*---------------------------------------------------------------------------*/ /** * \name CC26xx flavour selection * @{ */ #ifndef CC26XX_MODEL_CONF_CPU_VARIANT #define CC26XX_MODEL_CONF_CPU_VARIANT 2650 /**< 2650 => CC2650, 2630 => CC2630 */ #endif /** @} */ /*---------------------------------------------------------------------------*/ /** * \name Network Stack Configuration * * @{ */ #ifndef NETSTACK_CONF_NETWORK #if NETSTACK_CONF_WITH_IPV6 #define NETSTACK_CONF_NETWORK sicslowpan_driver #else #define NETSTACK_CONF_NETWORK rime_driver #endif /* NETSTACK_CONF_WITH_IPV6 */ #endif /* NETSTACK_CONF_NETWORK */ #ifndef NETSTACK_CONF_MAC #define NETSTACK_CONF_MAC csma_driver #endif #ifndef NETSTACK_CONF_RDC #define NETSTACK_CONF_RDC contikimac_driver #endif /* Configure NullRDC for when it's selected */ #define NULLRDC_802154_AUTOACK 1 #define NULLRDC_802154_AUTOACK_HW 1 /* Configure ContikiMAC for when it's selected */ #define CONTIKIMAC_CONF_WITH_CONTIKIMAC_HEADER 0 #define CONTIKIMAC_CONF_WITH_PHASE_OPTIMIZATION 0 #define WITH_FAST_SLEEP 1 #ifndef NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE #define NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE 8 #endif #ifndef NETSTACK_CONF_FRAMER #define NETSTACK_CONF_FRAMER framer_802154 #endif #define NETSTACK_CONF_RADIO cc26xx_rf_driver #define NETSTACK_RADIO_MAX_PAYLOAD_LEN 125 /* 6LoWPAN */ #define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_HC06 #define SICSLOWPAN_CONF_COMPRESSION_THRESHOLD 63 #define SICSLOWPAN_CONF_FRAG 1 #define SICSLOWPAN_CONF_MAXAGE 8 /** @} */ /*---------------------------------------------------------------------------*/ /** * \name IEEE address configuration * * Used to generate our RIME & IPv6 address * @{ */ /** * \brief Location of the IEEE address * 0 => Read from InfoPage, * 1 => Use a hardcoded address, configured by IEEE_ADDR_CONF_ADDRESS */ #ifndef IEEE_ADDR_CONF_HARDCODED #define IEEE_ADDR_CONF_HARDCODED 0 #endif /** * \brief The hardcoded IEEE address to be used when IEEE_ADDR_CONF_HARDCODED * is defined as 1 */ #ifndef IEEE_ADDR_CONF_ADDRESS #define IEEE_ADDR_CONF_ADDRESS { 0x00, 0x12, 0x4B, 0x00, 0x89, 0xAB, 0xCD, 0xEF } #endif /** @} */ /*---------------------------------------------------------------------------*/ /** * \name RF configuration * * @{ */ /* RF Config */ #ifndef IEEE802154_CONF_PANID #define IEEE802154_CONF_PANID 0xABCD /**< Default PAN ID */ #endif #ifndef CC26XX_RF_CONF_CHANNEL #define CC26XX_RF_CONF_CHANNEL 25 /**< Default RF channel */ #endif #ifndef CC26XX_RF_CONF_AUTOACK #define CC26XX_RF_CONF_AUTOACK 1 /**< RF H/W generates ACKs */ #endif #ifndef CC26XX_RF_CONF_PROMISCOUS #define CC26XX_RF_CONF_PROMISCOUS 0 /**< 1 to enable promiscous mode */ #endif #ifndef CC26XX_RF_CONF_BLE_SUPPORT #define CC26XX_RF_CONF_BLE_SUPPORT 0 /**< 0 to disable BLE support */ #endif /* * Patch Management for the CPE itself and for BLE and IEEE modes * * Don't change these unless you know what you're doing */ #ifndef CC26XX_CONF_CPE_HAS_PATCHES #define CC26XX_CONF_CPE_HAS_PATCHES 0 /**< 1 to enable patching the CPE */ #endif #ifndef CC26XX_CONF_BLE_HAS_PATCHES #define CC26XX_CONF_BLE_HAS_PATCHES 0 /**< 1 to enable patching BLE mode */ #endif #ifndef CC26XX_CONF_IEEE_HAS_PATCHES #define CC26XX_CONF_IEEE_HAS_PATCHES 0 /**< 1 to enable patching IEEE mode */ #endif /** @} */ /*---------------------------------------------------------------------------*/ /** @} */ /** * \name IPv6, RIME and network buffer configuration * * @{ */ /* Don't let contiki-default-conf.h decide if we are an IPv6 build */ #ifndef NETSTACK_CONF_WITH_IPV6 #define NETSTACK_CONF_WITH_IPV6 0 #endif #if NETSTACK_CONF_WITH_IPV6 /*---------------------------------------------------------------------------*/ /* Addresses, Sizes and Interfaces */ #define LINKADDR_CONF_SIZE 8 #define UIP_CONF_LL_802154 1 #define UIP_CONF_LLH_LEN 0 /* The size of the uIP main buffer */ #ifndef UIP_CONF_BUFFER_SIZE #define UIP_CONF_BUFFER_SIZE 1000 #endif /* ND and Routing */ #ifndef UIP_CONF_ROUTER #define UIP_CONF_ROUTER 1 #endif #define UIP_CONF_ND6_SEND_RA 0 #define UIP_CONF_IP_FORWARD 0 #define RPL_CONF_STATS 0 #define RPL_CONF_MAX_DAG_ENTRIES 1 #ifndef RPL_CONF_OF #define RPL_CONF_OF rpl_mrhof #endif #define UIP_CONF_ND6_REACHABLE_TIME 600000 #define UIP_CONF_ND6_RETRANS_TIMER 10000 #ifndef NBR_TABLE_CONF_MAX_NEIGHBORS #define NBR_TABLE_CONF_MAX_NEIGHBORS 20 #endif #ifndef UIP_CONF_MAX_ROUTES #define UIP_CONF_MAX_ROUTES 20 #endif #ifndef UIP_CONF_TCP #define UIP_CONF_TCP 1 #endif #ifndef UIP_CONF_TCP_MSS #define UIP_CONF_TCP_MSS 64 #endif #define UIP_CONF_UDP 1 #define UIP_CONF_UDP_CHECKSUMS 1 #define UIP_CONF_ICMP6 1 /*---------------------------------------------------------------------------*/ #else /* NETSTACK_CONF_WITH_IPV6 */ /* Network setup for non-IPv6 (rime). */ #define UIP_CONF_IP_FORWARD 1 #define RIME_CONF_NO_POLITE_ANNOUCEMENTS 0 #endif /* NETSTACK_CONF_WITH_IPV6 */ /** @} */ /*---------------------------------------------------------------------------*/ /** * \name Generic Configuration directives * * @{ */ #ifndef ENERGEST_CONF_ON #define ENERGEST_CONF_ON 0 /**< Energest Module */ #endif /** @} */ /*---------------------------------------------------------------------------*/ /** * \name Character I/O Configuration * * @{ */ #ifndef CC26XX_UART_CONF_ENABLE #define CC26XX_UART_CONF_ENABLE 1 /**< Enable/Disable UART I/O */ #endif #ifndef CC26XX_UART_CONF_BAUD_RATE #define CC26XX_UART_CONF_BAUD_RATE 115200 /**< Default UART0 baud rate */ #endif /* Turn off example-provided putchars */ #define SLIP_BRIDGE_CONF_NO_PUTCHAR 1 #define SLIP_RADIO_CONF_NO_PUTCHAR 1 #ifndef SLIP_ARCH_CONF_ENABLED /* * Determine whether we need SLIP * This will keep working while UIP_FALLBACK_INTERFACE and CMD_CONF_OUTPUT * keep using SLIP */ #if defined(UIP_FALLBACK_INTERFACE) || defined(CMD_CONF_OUTPUT) #define SLIP_ARCH_CONF_ENABLED 1 #endif #endif /** @} */ /*---------------------------------------------------------------------------*/ /** * \name Button configurations * * Configure a button as power on/off: We use the right button for both boards. * @{ */ #ifndef BUTTON_SENSOR_CONF_ENABLE_SHUTDOWN #define BUTTON_SENSOR_CONF_ENABLE_SHUTDOWN 1 #endif /* Notify various examples that we have Buttons */ #define PLATFORM_HAS_BUTTON 1 /* * Override button symbols from dev/button-sensor.h, for the examples that * include it */ #define button_sensor button_left_sensor #define button_sensor2 button_right_sensor /** @} */ /*---------------------------------------------------------------------------*/ /* Platform-specific define to signify sensor reading failure */ #define CC26XX_SENSOR_READING_ERROR 0x80000000 /*---------------------------------------------------------------------------*/ /** * \name Compiler configuration and platform-specific type definitions * * Those values are not meant to be modified by the user * @{ */ #define CLOCK_CONF_SECOND 128 /* Compiler configurations */ #define CCIF #define CLIF /* Platform typedefs */ typedef uint32_t clock_time_t; typedef uint32_t uip_stats_t; /* Clock (time) comparison macro */ #define CLOCK_LT(a, b) ((signed long)((a) - (b)) < 0) /* * rtimer.h typedefs rtimer_clock_t as unsigned short. We need to define * RTIMER_CLOCK_LT to override this */ typedef uint32_t rtimer_clock_t; #define RTIMER_CLOCK_LT(a, b) ((int32_t)((a) - (b)) < 0) /** @} */ /*---------------------------------------------------------------------------*/ /* board.h assumes that basic configuration is done */ #include "board.h" /*---------------------------------------------------------------------------*/ #endif /* CONTIKI_CONF_H */ /** @} */