Contiki 3.x
platform-conf.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012, STMicroelectronics.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * 3. Neither the name of the Institute nor the names of its contributors
14  * may be used to endorse or promote products derived from this software
15  * without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
21  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27  * SUCH DAMAGE.
28  *
29  *
30  */
31 /*---------------------------------------------------------------------------*/
32 /**
33  * \addtogroup stm32nucleo-spirit1
34  * @{
35  *
36  * \defgroup stm32nucleo-spirit1-peripherals User Button on STM32 Nucleo
37  *
38  * Defines some of the platforms capabilities
39  * @{
40  *
41  * \file
42  * Header file for the stm32nucleo-spirit1 platform configuration
43  */
44 /*---------------------------------------------------------------------------*/
45 #ifndef __PLATFORM_CONF_H__
46 #define __PLATFORM_CONF_H__
47 /*---------------------------------------------------------------------------*/
48 #include <inttypes.h>
49 #include <string.h>
50 /*---------------------------------------------------------------------------*/
51 #define PLATFORM_HAS_LEDS 1
52 #define PLATFORM_HAS_BUTTON 1
53 #define PLATFORM_HAS_RADIO 1
54 
55 #define LEDS_GREEN 1 /*Nucleo LED*/
56 #define LEDS_RED 2 /*SPIRIT1 LED*/
57 
58 #ifdef X_NUCLEO_IKS01A1
59 #define LEDS_CONF_ALL 1 /*Can't use SPIRIT1 LED in this case*/
60 #else
61 #define LEDS_CONF_ALL 3 /*No sensors -> we can use SPIRIT1 LED in this case*/
62 #endif /*X_NUCLEO_IKS01A1*/
63 /*---------------------------------------------------------------------------*/
64 #define F_CPU 32000000ul
65 #define RTIMER_ARCH_SECOND 32768
66 #define PRESCALER ((F_CPU / (RTIMER_ARCH_SECOND * 2)))
67 
68 #define UART1_CONF_TX_WITH_INTERRUPT 0
69 #define WITH_SERIAL_LINE_INPUT 1
70 #define TELNETD_CONF_NUMLINES 6
71 #define NETSTACK_CONF_RADIO spirit_radio_driver
72 #define NETSTACK_RADIO_MAX_PAYLOAD_LEN 96 /* spirit1-config.h */
73 
74 /*---------------------------------------------------------------------------*/
75 /* define ticks/second for slow and fast clocks. Notice that these should be a
76  power of two, eg 64,128,256,512 etc, for efficiency as POT's can be optimized
77  well. */
78 #define CLOCK_CONF_SECOND 128
79 /* One tick: 62.5 ms */
80 
81 #define RTIMER_CLOCK_DIFF(a, b) ((signed short)((a) - (b)))
82 /*---------------------------------------------------------------------------*/
83 typedef unsigned long clock_time_t;
84 typedef unsigned long long rtimer_clock_t;
85 /*---------------------------------------------------------------------------*/
86 #define CC_CONF_REGISTER_ARGS 0
87 #define CC_CONF_FUNCTION_POINTER_ARGS 1
88 #define CC_CONF_FASTCALL
89 #define CC_CONF_VA_ARGS 1
90 #define CC_CONF_INLINE inline
91 
92 #define CCIF
93 #define CLIF
94 /*---------------------------------------------------------------------------*/
95 typedef uint8_t u8_t;
96 typedef uint16_t u16_t;
97 typedef uint32_t u32_t;
98 typedef int32_t s32_t;
99 typedef unsigned short uip_stats_t;
100 /*---------------------------------------------------------------------------*/
101 #define MULTICHAN_CONF_SET_CHANNEL(x)
102 #define MULTICHAN_CONF_READ_RSSI(x) 0
103 /*---------------------------------------------------------------------------*/
104 #endif /* __PLATFORM_CONF_H__ */
105 /*---------------------------------------------------------------------------*/
106 /**
107  * @}
108  * @}
109  */