Fork of my original MQTTGateway

Dependencies:   mbed-http

Committer:
vpcola
Date:
Sat Apr 08 14:43:14 2017 +0000
Revision:
0:a1734fe1ec4b
Initial commit

Who changed what in which revision?

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