The friendly Operating System for the Internet of Things
fox/include/board.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014-2015 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 
24 #ifndef BOARD_H
25 #define BOARD_H
26 
27 #include <stdint.h>
28 
29 #include "cpu.h"
30 #include "periph_conf.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
39 #define XTIMER_WIDTH (16)
40 
46 #define AT86RF2XX_PARAMS_BOARD {.spi = SPI_DEV(0), \
47  .spi_clk = SPI_CLK_5MHZ, \
48  .cs_pin = GPIO_PIN(PORT_A, 1), \
49  .int_pin = GPIO_PIN(PORT_C, 2), \
50  .sleep_pin = GPIO_PIN(PORT_A, 0), \
51  .reset_pin = GPIO_PIN(PORT_C, 1)}
52 
57 #define LPS331AP_I2C I2C_0
58 #define LPS331AP_ADDR 0x5c
59 
65 #define L3G4200D_I2C I2C_0
66 #define L3G4200D_ADDR 0x68
67 #define L3G4200D_DRDY GPIO_PIN(PORT_B,8)
68 #define L3G4200D_INT GPIO_PIN(PORT_B,11)
69 
75 #define LSM303DLHC_I2C I2C_0
76 #define LSM303DLHC_ACC_ADDR (25)
77 #define LSM303DLHC_MAG_ADDR (30)
78 #define LSM303DLHC_INT1 GPIO_PIN(PORT_B,9)
79 #define LSM303DLHC_INT2 GPIO_PIN(PORT_B,5)
80 #define LSM303DLHC_DRDY GPIO_PIN(PORT_A,9)
81 
87 #define LED0_PIN GPIO_PIN(PORT_B, 10)
88 #define LED1_PIN GPIO_PIN(PORT_B, 12)
89 
90 #define LED0_MASK (1 << 10)
91 #define LED1_MASK (1 << 12)
92 
93 #define LED0_ON (GPIOB->ODR &= ~LED0_MASK)
94 #define LED0_OFF (GPIOB->ODR |= LED0_MASK)
95 #define LED0_TOGGLE (GPIOB->ODR ^= LED0_MASK)
96 
97 #define LED1_ON (GPIOB->ODR &= ~LED1_MASK)
98 #define LED1_OFF (GPIOB->ODR |= LED1_MASK)
99 #define LED1_TOGGLE (GPIOB->ODR ^= LED1_MASK)
100 
105 void board_init(void);
106 
107 #ifdef __cplusplus
108 }
109 #endif
110 
111 #endif /* BOARD_H */
112 
void board_init(void)
Initialize board specific hardware, including clock, LEDs and std-IO.
Peripheral MCU configuration for the fox board.