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 
19 #ifndef BOARD_H
20 #define BOARD_H
21 
22 #include <stdint.h>
23 
24 #include "cpu.h"
25 #include "periph_conf.h"
26 
27 #ifdef __cplusplus
28  extern "C" {
29 #endif
30 
34 #define XTIMER_WIDTH (16)
35 
40 #define LED0_PIN GPIO_PIN(PORT_A, 9)
41 #define LED1_PIN GPIO_PIN(PORT_A, 10)
42 #define LED2_PIN GPIO_PIN(PORT_A, 8)
43 #define LED3_PIN GPIO_PIN(PORT_A, 13)
44 
45 #define LED_PORT (GPIOA)
46 #define LED0_MASK (1 << 9)
47 #define LED1_MASK (1 << 10)
48 #define LED2_MASK (1 << 8)
49 #define LED3_MASK (1 << 13)
50 
51 #define LED0_ON (LED_PORT->BRR = LED0_MASK)
52 #define LED0_OFF (LED_PORT->BSRR = LED0_MASK)
53 #define LED0_TOGGLE (LED_PORT->ODR ^= LED0_MASK)
54 
55 #define LED1_ON (LED_PORT->BRR = LED1_MASK)
56 #define LED1_OFF (LED_PORT->BSRR = LED1_MASK)
57 #define LED1_TOGGLE (LED_PORT->ODR ^= LED1_MASK)
58 
59 #define LED2_ON (LED_PORT->BRR = LED2_MASK)
60 #define LED2_OFF (LED_PORT->BSRR = LED2_MASK)
61 #define LED2_TOGGLE (LED_PORT->ODR ^= LED2_MASK)
62 
63 #define LED3_ON (LED_PORT->BRR = LED3_MASK)
64 #define LED3_OFF (LED_PORT->BSRR = LED3_MASK)
65 #define LED3_TOGGLE (LED_PORT->ODR ^= LED3_MASK)
66 
72 #define BUTTON1 GPIO_PIN(PORT_B,2)
73 
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 
periph_conf.h
Peripheral MCU configuration for the spark-core board.
board_init
void board_init(void)
Board level initialization.