The friendly Operating System for the Internet of Things
spark-core/include/board.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Freie Universit├Ąt Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser General
5  * Public License v2.1. See the file LICENSE in the top level directory for more
6  * details.
7  */
8 
21 #ifndef BOARD_H
22 #define BOARD_H
23 
24 #include <stdint.h>
25 
26 #include "cpu.h"
27 #include "periph_conf.h"
28 
29 #ifdef __cplusplus
30  extern "C" {
31 #endif
32 
36 #define XTIMER_WIDTH (16)
37 
42 #define LED0_PIN GPIO_PIN(PORT_A, 9)
43 #define LED1_PIN GPIO_PIN(PORT_A, 10)
44 #define LED2_PIN GPIO_PIN(PORT_A, 8)
45 #define LED3_PIN GPIO_PIN(PORT_A, 13)
46 
47 #define LED_PORT (GPIOA)
48 #define LED0_MASK (1 << 9)
49 #define LED1_MASK (1 << 10)
50 #define LED2_MASK (1 << 8)
51 #define LED3_MASK (1 << 13)
52 
53 #define LED0_ON (LED_PORT->BRR = LED0_MASK)
54 #define LED0_OFF (LED_PORT->BSRR = LED0_MASK)
55 #define LED0_TOGGLE (LED_PORT->ODR ^= LED0_MASK)
56 
57 #define LED1_ON (LED_PORT->BRR = LED1_MASK)
58 #define LED1_OFF (LED_PORT->BSRR = LED1_MASK)
59 #define LED1_TOGGLE (LED_PORT->ODR ^= LED1_MASK)
60 
61 #define LED2_ON (LED_PORT->BRR = LED2_MASK)
62 #define LED2_OFF (LED_PORT->BSRR = LED2_MASK)
63 #define LED2_TOGGLE (LED_PORT->ODR ^= LED2_MASK)
64 
65 #define LED3_ON (LED_PORT->BRR = LED3_MASK)
66 #define LED3_OFF (LED_PORT->BSRR = LED3_MASK)
67 #define LED3_TOGGLE (LED_PORT->ODR ^= LED3_MASK)
68 
73 #define BUTTON1 GPIO_PIN(PORT_B,2)
74 
79 #define CC3000_SPI SPI_DEV(0)
80 #define CC3000_CS GPIO_PIN(PORT_B,12)
81 #define CC3000_EN GPIO_PIN(PORT_B,8)
82 #define CC3000_INT GPIO_PIN(PORT_B,11)
83 
89 #define EXTFLASH_SPI SPI_DEV(0)
90 #define EXTFLASH GPIO_PIN(PORT_B,9)
91 
96 void board_init(void);
97 
98 #ifdef __cplusplus
99 } /* end extern "C" */
100 #endif
101 
102 #endif /* BOARD_H */
103 
void board_init(void)
Initialize board specific hardware, including clock, LEDs and std-IO.
Peripheral MCU configuration for the spark-core board.