Easily add all supported connectivity methods to your mbed OS project

Dependencies:   type-yd-driver

Committer:
MACRUM
Date:
Wed Jul 12 10:52:58 2017 +0000
Revision:
0:615f90842ce8
Initial commit

Who changed what in which revision?

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