The friendly Operating System for the Internet of Things
msbiot/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 "cpu.h"
25 #include "periph_conf.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
35 #define CC110X_SPI SPI_DEV(0)
36 #define CC110X_CS GPIO_PIN(PORT_B, 12)
37 #define CC110X_GDO0 GPIO_PIN(PORT_C, 4)
38 #define CC110X_GDO1 GPIO_PIN(PORT_A, 6)
39 #define CC110X_GDO2 GPIO_PIN(PORT_C, 5)
40 
46 #define MPU9150_I2C I2C_0
47 #define MPU9150_HW_ADDR (0x68)
48 #define MPU9150_COMP_ADDR (0x0E)
49 
55 #define LED0_PIN GPIO_PIN(PORT_B, 8)
56 #define LED1_PIN GPIO_PIN(PORT_B, 14)
57 #define LED2_PIN GPIO_PIN(PORT_B, 15)
58 
59 #define LED_PORT GPIOB
60 #define LED0_MASK (1 << 8)
61 #define LED1_MASK (1 << 14)
62 #define LED2_MASK (1 << 15)
63 
64 #define LED0_ON (LED_PORT->BSRR = LED0_MASK)
65 #define LED0_OFF (LED_PORT->BSRR = (LED0_MASK << 16))
66 #define LED0_TOGGLE (LED_PORT->ODR ^= LED0_MASK)
67 
68 #define LED1_ON (LED_PORT->BSRR = LED1_MASK)
69 #define LED1_OFF (LED_PORT->BSRR = (LED1_MASK << 16))
70 #define LED1_TOGGLE (LED_PORT->ODR ^= LED1_MASK)
71 
72 #define LED2_ON (LED_PORT->BSRR = LED2_MASK)
73 #define LED2_OFF (LED_PORT->BSRR = (LED2_MASK << 16))
74 #define LED2_TOGGLE (LED_PORT->ODR ^= LED2_MASK)
75 
80 void board_init(void);
81 
82 #ifdef __cplusplus
83 }
84 #endif
85 
86 #endif /* BOARD_H */
87 
void board_init(void)
Initialize board specific hardware, including clock, LEDs and std-IO.