센서보드 RF IRQ 테스트 중

Fork of stm-spirit1-rf-driver by ST

Committer:
Wolfgang Betz
Date:
Tue Nov 22 11:40:10 2016 +0100
Revision:
34:edda6a7238ec
Child:
67:93bec0baf1de
Perform re-naming

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Wolfgang Betz 34:edda6a7238ec 1 /**
Wolfgang Betz 34:edda6a7238ec 2 ******************************************************************************
Wolfgang Betz 34:edda6a7238ec 3 * @file platform/stm32nucleo-spirit1/platform-conf.h
Wolfgang Betz 34:edda6a7238ec 4 * @author System LAB
Wolfgang Betz 34:edda6a7238ec 5 * @version V1.0.0
Wolfgang Betz 34:edda6a7238ec 6 * @date 17-May-2015
Wolfgang Betz 34:edda6a7238ec 7 * @brief Configuration parameters
Wolfgang Betz 34:edda6a7238ec 8 ******************************************************************************
Wolfgang Betz 34:edda6a7238ec 9 * @attention
Wolfgang Betz 34:edda6a7238ec 10 *
Wolfgang Betz 34:edda6a7238ec 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
Wolfgang Betz 34:edda6a7238ec 12 *
Wolfgang Betz 34:edda6a7238ec 13 * Redistribution and use in source and binary forms, with or without modification,
Wolfgang Betz 34:edda6a7238ec 14 * are permitted provided that the following conditions are met:
Wolfgang Betz 34:edda6a7238ec 15 * 1. Redistributions of source code must retain the above copyright notice,
Wolfgang Betz 34:edda6a7238ec 16 * this list of conditions and the following disclaimer.
Wolfgang Betz 34:edda6a7238ec 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Wolfgang Betz 34:edda6a7238ec 18 * this list of conditions and the following disclaimer in the documentation
Wolfgang Betz 34:edda6a7238ec 19 * and/or other materials provided with the distribution.
Wolfgang Betz 34:edda6a7238ec 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Wolfgang Betz 34:edda6a7238ec 21 * may be used to endorse or promote products derived from this software
Wolfgang Betz 34:edda6a7238ec 22 * without specific prior written permission.
Wolfgang Betz 34:edda6a7238ec 23 *
Wolfgang Betz 34:edda6a7238ec 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Wolfgang Betz 34:edda6a7238ec 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Wolfgang Betz 34:edda6a7238ec 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Wolfgang Betz 34:edda6a7238ec 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Wolfgang Betz 34:edda6a7238ec 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Wolfgang Betz 34:edda6a7238ec 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Wolfgang Betz 34:edda6a7238ec 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Wolfgang Betz 34:edda6a7238ec 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Wolfgang Betz 34:edda6a7238ec 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Wolfgang Betz 34:edda6a7238ec 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Wolfgang Betz 34:edda6a7238ec 34 *
Wolfgang Betz 34:edda6a7238ec 35 ******************************************************************************
Wolfgang Betz 34:edda6a7238ec 36 */
Wolfgang Betz 34:edda6a7238ec 37 /*---------------------------------------------------------------------------*/
Wolfgang Betz 34:edda6a7238ec 38 /**
Wolfgang Betz 34:edda6a7238ec 39 * \addtogroup stm32nucleo-spirit1
Wolfgang Betz 34:edda6a7238ec 40 * @{
Wolfgang Betz 34:edda6a7238ec 41 *
Wolfgang Betz 34:edda6a7238ec 42 * \defgroup stm32nucleo-spirit1-peripherals User Button on STM32 Nucleo
Wolfgang Betz 34:edda6a7238ec 43 *
Wolfgang Betz 34:edda6a7238ec 44 * Defines some of the platforms capabilities
Wolfgang Betz 34:edda6a7238ec 45 * @{
Wolfgang Betz 34:edda6a7238ec 46 *
Wolfgang Betz 34:edda6a7238ec 47 * \file
Wolfgang Betz 34:edda6a7238ec 48 * Header file for the stm32nucleo-spirit1 platform configuration
Wolfgang Betz 34:edda6a7238ec 49 */
Wolfgang Betz 34:edda6a7238ec 50 /*---------------------------------------------------------------------------*/
Wolfgang Betz 34:edda6a7238ec 51 #ifndef __PLATFORM_CONF_H__
Wolfgang Betz 34:edda6a7238ec 52 #define __PLATFORM_CONF_H__
Wolfgang Betz 34:edda6a7238ec 53 /*---------------------------------------------------------------------------*/
Wolfgang Betz 34:edda6a7238ec 54 #ifdef USE_STM32L1XX_NUCLEO
Wolfgang Betz 34:edda6a7238ec 55 #include <inttypes.h>
Wolfgang Betz 34:edda6a7238ec 56 #include <string.h>
Wolfgang Betz 34:edda6a7238ec 57 /*---------------------------------------------------------------------------*/
Wolfgang Betz 34:edda6a7238ec 58 #define PLATFORM_HAS_LEDS 1
Wolfgang Betz 34:edda6a7238ec 59 #define PLATFORM_HAS_BUTTON 1
Wolfgang Betz 34:edda6a7238ec 60 #define PLATFORM_HAS_RADIO 1
Wolfgang Betz 34:edda6a7238ec 61
Wolfgang Betz 34:edda6a7238ec 62 #define LEDS_GREEN 1 /*Nucleo LED*/
Wolfgang Betz 34:edda6a7238ec 63 #define LEDS_RED 2 /*SPIRIT1 LED*/
Wolfgang Betz 34:edda6a7238ec 64
Wolfgang Betz 34:edda6a7238ec 65 #ifdef COMPILE_SENSORS
Wolfgang Betz 34:edda6a7238ec 66 #define LEDS_CONF_ALL 1 /*Can't use SPIRIT1 LED in this case*/
Wolfgang Betz 34:edda6a7238ec 67 #else
Wolfgang Betz 34:edda6a7238ec 68 #define LEDS_CONF_ALL 3 /*No sensors -> we can use SPIRIT1 LED in this case*/
Wolfgang Betz 34:edda6a7238ec 69 #endif /*COMPILE_SENSORS*/
Wolfgang Betz 34:edda6a7238ec 70 /*---------------------------------------------------------------------------*/
Wolfgang Betz 34:edda6a7238ec 71 #define F_CPU 32000000ul
Wolfgang Betz 34:edda6a7238ec 72 #define RTIMER_ARCH_SECOND 32768
Wolfgang Betz 34:edda6a7238ec 73 #define PRESCALER ((F_CPU / (RTIMER_ARCH_SECOND*2)))
Wolfgang Betz 34:edda6a7238ec 74
Wolfgang Betz 34:edda6a7238ec 75 #define UART1_CONF_TX_WITH_INTERRUPT 0
Wolfgang Betz 34:edda6a7238ec 76 #define WITH_SERIAL_LINE_INPUT 1
Wolfgang Betz 34:edda6a7238ec 77 #define TELNETD_CONF_NUMLINES 6
Wolfgang Betz 34:edda6a7238ec 78 #define NETSTACK_CONF_RADIO spirit_radio_driver
Wolfgang Betz 34:edda6a7238ec 79 #define NETSTACK_RADIO_MAX_PAYLOAD_LEN 96 /* spirit1-config.h */
Wolfgang Betz 34:edda6a7238ec 80
Wolfgang Betz 34:edda6a7238ec 81 #if WITH_IP64
Wolfgang Betz 34:edda6a7238ec 82 #include "ip64-conf.h"
Wolfgang Betz 34:edda6a7238ec 83 #define WITH_SLIP 1
Wolfgang Betz 34:edda6a7238ec 84 #ifndef UIP_FALLBACK_INTERFACE
Wolfgang Betz 34:edda6a7238ec 85 #define UIP_FALLBACK_INTERFACE ip64_uip_fallback_interface
Wolfgang Betz 34:edda6a7238ec 86 #endif
Wolfgang Betz 34:edda6a7238ec 87 #endif /* WITH_IP64 */
Wolfgang Betz 34:edda6a7238ec 88
Wolfgang Betz 34:edda6a7238ec 89 /*---------------------------------------------------------------------------*/
Wolfgang Betz 34:edda6a7238ec 90 /* define ticks/second for slow and fast clocks. Notice that these should be a
Wolfgang Betz 34:edda6a7238ec 91 power of two, eg 64,128,256,512 etc, for efficiency as POT's can be optimized
Wolfgang Betz 34:edda6a7238ec 92 well. */
Wolfgang Betz 34:edda6a7238ec 93 #define CLOCK_CONF_SECOND 128
Wolfgang Betz 34:edda6a7238ec 94 #define RELOAD_VALUE ((F_CPU/CLOCK_CONF_SECOND) - 1)
Wolfgang Betz 34:edda6a7238ec 95 /* One tick: 62.5 ms */
Wolfgang Betz 34:edda6a7238ec 96
Wolfgang Betz 34:edda6a7238ec 97 #define RTIMER_CLOCK_LT(a,b) ((signed short)((a)-(b)) < 0)
Wolfgang Betz 34:edda6a7238ec 98 /*---------------------------------------------------------------------------*/
Wolfgang Betz 34:edda6a7238ec 99 typedef unsigned long clock_time_t;
Wolfgang Betz 34:edda6a7238ec 100 typedef unsigned long long rtimer_clock_t;
Wolfgang Betz 34:edda6a7238ec 101 /*---------------------------------------------------------------------------*/
Wolfgang Betz 34:edda6a7238ec 102 #define CC_CONF_REGISTER_ARGS 0
Wolfgang Betz 34:edda6a7238ec 103 #define CC_CONF_FUNCTION_POINTER_ARGS 1
Wolfgang Betz 34:edda6a7238ec 104 #define CC_CONF_FASTCALL
Wolfgang Betz 34:edda6a7238ec 105 #define CC_CONF_VA_ARGS 1
Wolfgang Betz 34:edda6a7238ec 106 #define CC_CONF_INLINE inline
Wolfgang Betz 34:edda6a7238ec 107
Wolfgang Betz 34:edda6a7238ec 108 #define CCIF
Wolfgang Betz 34:edda6a7238ec 109 #define CLIF
Wolfgang Betz 34:edda6a7238ec 110 /*---------------------------------------------------------------------------*/
Wolfgang Betz 34:edda6a7238ec 111 typedef uint8_t u8_t;
Wolfgang Betz 34:edda6a7238ec 112 typedef uint16_t u16_t;
Wolfgang Betz 34:edda6a7238ec 113 typedef uint32_t u32_t;
Wolfgang Betz 34:edda6a7238ec 114 typedef int32_t s32_t;
Wolfgang Betz 34:edda6a7238ec 115 typedef unsigned short uip_stats_t;
Wolfgang Betz 34:edda6a7238ec 116 /*---------------------------------------------------------------------------*/
Wolfgang Betz 34:edda6a7238ec 117 #define MULTICHAN_CONF_SET_CHANNEL(x)
Wolfgang Betz 34:edda6a7238ec 118 #define MULTICHAN_CONF_READ_RSSI(x) 0
Wolfgang Betz 34:edda6a7238ec 119 /*---------------------------------------------------------------------------*/
Wolfgang Betz 34:edda6a7238ec 120 #endif//USE_STM32L1XX_NUCLEO
Wolfgang Betz 34:edda6a7238ec 121
Wolfgang Betz 34:edda6a7238ec 122 #ifdef USE_STM32F4XX_NUCLEO
Wolfgang Betz 34:edda6a7238ec 123 #include <inttypes.h>
Wolfgang Betz 34:edda6a7238ec 124 #include <string.h>
Wolfgang Betz 34:edda6a7238ec 125 #include "main.h"
Wolfgang Betz 34:edda6a7238ec 126 /*---------------------------------------------------------------------------*/
Wolfgang Betz 34:edda6a7238ec 127 #define PLATFORM_HAS_LEDS 1
Wolfgang Betz 34:edda6a7238ec 128 #define PLATFORM_HAS_BUTTON 1
Wolfgang Betz 34:edda6a7238ec 129 #define PLATFORM_HAS_RADIO 1
Wolfgang Betz 34:edda6a7238ec 130
Wolfgang Betz 34:edda6a7238ec 131 #define LEDS_GREEN 1 /*Nucleo LED*/
Wolfgang Betz 34:edda6a7238ec 132 #define LEDS_RED 2 /*SPIRIT1 LED*/
Wolfgang Betz 34:edda6a7238ec 133
Wolfgang Betz 34:edda6a7238ec 134 #ifdef COMPILE_SENSORS
Wolfgang Betz 34:edda6a7238ec 135 #define LEDS_CONF_ALL 1 /*Can't use SPIRIT1 LED in this case*/
Wolfgang Betz 34:edda6a7238ec 136 #else
Wolfgang Betz 34:edda6a7238ec 137 #define LEDS_CONF_ALL 3 /*No sensors -> we can use SPIRIT1 LED in this case*/
Wolfgang Betz 34:edda6a7238ec 138 #endif /*COMPILE_SENSORS*/
Wolfgang Betz 34:edda6a7238ec 139 /*---------------------------------------------------------------------------*/
Wolfgang Betz 34:edda6a7238ec 140 #define F_CPU 84000000ul
Wolfgang Betz 34:edda6a7238ec 141 #define RTIMER_ARCH_SECOND 96000//32678
Wolfgang Betz 34:edda6a7238ec 142 //#define PRESCALER uwPrescalerValue
Wolfgang Betz 34:edda6a7238ec 143
Wolfgang Betz 34:edda6a7238ec 144 #define UART1_CONF_TX_WITH_INTERRUPT 0
Wolfgang Betz 34:edda6a7238ec 145 #define WITH_SERIAL_LINE_INPUT 1
Wolfgang Betz 34:edda6a7238ec 146 #define TELNETD_CONF_NUMLINES 6
Wolfgang Betz 34:edda6a7238ec 147 #define NETSTACK_CONF_RADIO spirit_radio_driver
Wolfgang Betz 34:edda6a7238ec 148 #define NETSTACK_RADIO_MAX_PAYLOAD_LEN 96 /* spirit1-config.h */
Wolfgang Betz 34:edda6a7238ec 149
Wolfgang Betz 34:edda6a7238ec 150 #if WITH_IP64
Wolfgang Betz 34:edda6a7238ec 151 #include "ip64-conf.h"
Wolfgang Betz 34:edda6a7238ec 152 #define WITH_SLIP 1
Wolfgang Betz 34:edda6a7238ec 153 #ifndef UIP_FALLBACK_INTERFACE
Wolfgang Betz 34:edda6a7238ec 154 #define UIP_FALLBACK_INTERFACE ip64_uip_fallback_interface
Wolfgang Betz 34:edda6a7238ec 155 #endif
Wolfgang Betz 34:edda6a7238ec 156 #endif /* WITH_IP64 */
Wolfgang Betz 34:edda6a7238ec 157
Wolfgang Betz 34:edda6a7238ec 158 /*---------------------------------------------------------------------------*/
Wolfgang Betz 34:edda6a7238ec 159 /* define ticks/second for slow and fast clocks. Notice that these should be a
Wolfgang Betz 34:edda6a7238ec 160 power of two, eg 64,128,256,512 etc, for efficiency as POT's can be optimized
Wolfgang Betz 34:edda6a7238ec 161 well. */
Wolfgang Betz 34:edda6a7238ec 162 #define CLOCK_CONF_SECOND 512
Wolfgang Betz 34:edda6a7238ec 163 #define RELOAD_VALUE ((F_CPU/CLOCK_CONF_SECOND) - 1)
Wolfgang Betz 34:edda6a7238ec 164
Wolfgang Betz 34:edda6a7238ec 165 /* One tick: 62.5 ms */
Wolfgang Betz 34:edda6a7238ec 166
Wolfgang Betz 34:edda6a7238ec 167 #define RTIMER_CLOCK_LT(a,b) ((signed short)((a)-(b)) < 0)
Wolfgang Betz 34:edda6a7238ec 168 /*---------------------------------------------------------------------------*/
Wolfgang Betz 34:edda6a7238ec 169 typedef unsigned long clock_time_t;
Wolfgang Betz 34:edda6a7238ec 170 typedef unsigned long long rtimer_clock_t;
Wolfgang Betz 34:edda6a7238ec 171 /*---------------------------------------------------------------------------*/
Wolfgang Betz 34:edda6a7238ec 172 #define CC_CONF_REGISTER_ARGS 0
Wolfgang Betz 34:edda6a7238ec 173 #define CC_CONF_FUNCTION_POINTER_ARGS 1
Wolfgang Betz 34:edda6a7238ec 174 #define CC_CONF_FASTCALL
Wolfgang Betz 34:edda6a7238ec 175 #define CC_CONF_VA_ARGS 1
Wolfgang Betz 34:edda6a7238ec 176 #define CC_CONF_INLINE inline
Wolfgang Betz 34:edda6a7238ec 177
Wolfgang Betz 34:edda6a7238ec 178 #define CCIF
Wolfgang Betz 34:edda6a7238ec 179 #define CLIF
Wolfgang Betz 34:edda6a7238ec 180 /*---------------------------------------------------------------------------*/
Wolfgang Betz 34:edda6a7238ec 181 typedef uint8_t u8_t;
Wolfgang Betz 34:edda6a7238ec 182 typedef uint16_t u16_t;
Wolfgang Betz 34:edda6a7238ec 183 typedef uint32_t u32_t;
Wolfgang Betz 34:edda6a7238ec 184 typedef int32_t s32_t;
Wolfgang Betz 34:edda6a7238ec 185 typedef unsigned short uip_stats_t;
Wolfgang Betz 34:edda6a7238ec 186 /*---------------------------------------------------------------------------*/
Wolfgang Betz 34:edda6a7238ec 187 #define MULTICHAN_CONF_SET_CHANNEL(x)
Wolfgang Betz 34:edda6a7238ec 188 #define MULTICHAN_CONF_READ_RSSI(x) 0
Wolfgang Betz 34:edda6a7238ec 189 /*---------------------------------------------------------------------------*/
Wolfgang Betz 34:edda6a7238ec 190 #endif//USE_STM32F4XX_NUCLEO
Wolfgang Betz 34:edda6a7238ec 191
Wolfgang Betz 34:edda6a7238ec 192 #endif /* __PLATFORM_CONF_H__ */
Wolfgang Betz 34:edda6a7238ec 193 /*---------------------------------------------------------------------------*/
Wolfgang Betz 34:edda6a7238ec 194 /**
Wolfgang Betz 34:edda6a7238ec 195 * @}
Wolfgang Betz 34:edda6a7238ec 196 * @}
Wolfgang Betz 34:edda6a7238ec 197 */