The friendly Operating System for the Internet of Things
samr21-xpro/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
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
22 #ifndef BOARD_H
23 #define BOARD_H
24 
25 #include "cpu.h"
26 #include "periph_conf.h"
27 #include "periph_cpu.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
37 #define XTIMER_DEV TIMER_1
38 #define XTIMER_CHAN (0)
39 
46 #define AT86RF2XX_PARAMS_BOARD {.spi = SPI_DEV(0), \
47  .spi_clk = SPI_CLK_5MHZ, \
48  .cs_pin = GPIO_PIN(PB, 31), \
49  .int_pin = GPIO_PIN(PB, 0), \
50  .sleep_pin = GPIO_PIN(PA, 20), \
51  .reset_pin = GPIO_PIN(PB, 15)}
52 
57 #define LED0_PIN GPIO_PIN(0, 19)
58 
59 #define LED_PORT PORT->Group[0]
60 #define LED0_MASK (1 << 19)
61 
62 #define LED0_ON (LED_PORT.OUTCLR.reg = LED0_MASK)
63 #define LED0_OFF (LED_PORT.OUTSET.reg = LED0_MASK)
64 #define LED0_TOGGLE (LED_PORT.OUTTGL.reg = LED0_MASK)
65 
71 #define BUTTON_PORT PORT->Group[0]
72 #define BUTTON_PIN (28)
73 #define BUTTON_GPIO GPIO_PIN(0, BUTTON_PIN)
74 
79 void board_init(void);
80 
81 #ifdef __cplusplus
82 }
83 #endif
84 
85 #endif /* BOARD_H */
86 
void board_init(void)
Initialize board specific hardware, including clock, LEDs and std-IO.
Configuration of CPU peripherals for the Atmel SAM R21 Xplained Pro board.