iotlab-common/include/board_common.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_COMMON_H
25 #define BOARD_COMMON_H
26 
27 #include <stdint.h>
28 
29 #include "cpu.h"
30 #include "periph_conf.h"
31 #include "periph_conf_common.h"
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
41 #ifndef UART_STDIO_BAUDRATE
42 # define UART_STDIO_BAUDRATE (500000U)
43 #endif
44 
52 #define XTIMER_WIDTH (16U)
53 #define XTIMER_OVERHEAD (6U)
54 #define XTIMER_SHOOT_EARLY (3U)
55 
62 #define AT86RF2XX_PARAMS_BOARD {.spi = SPI_DEV(0), \
63  .spi_clk = SPI_CLK_5MHZ, \
64  .cs_pin = GPIO_PIN(PORT_A, 4), \
65  .int_pin = GPIO_PIN(PORT_C, 4), \
66  .sleep_pin = GPIO_PIN(PORT_A, 2), \
67  .reset_pin = GPIO_PIN(PORT_C, 1)}
68 
73 #define LED0_PIN GPIO_PIN(PORT_D, 2)
74 #define LED1_PIN GPIO_PIN(PORT_B, 5)
75 #define LED2_PIN GPIO_PIN(PORT_C, 10)
76 
77 #define LED0_MASK (1 << 2)
78 #define LED1_MASK (1 << 5)
79 #define LED2_MASK (1 << 10)
80 
81 #define LED0_ON (GPIOD->ODR &= ~LED0_MASK)
82 #define LED0_OFF (GPIOD->ODR |= LED0_MASK)
83 #define LED0_TOGGLE (GPIOD->ODR ^= LED0_MASK)
84 
85 #define LED1_ON (GPIOB->ODR &= ~LED1_MASK)
86 #define LED1_OFF (GPIOB->ODR |= LED1_MASK)
87 #define LED1_TOGGLE (GPIOB->ODR ^= LED1_MASK)
88 
89 #define LED2_ON (GPIOC->ODR &= ~LED2_MASK)
90 #define LED2_OFF (GPIOC->ODR |= LED2_MASK)
91 #define LED2_TOGGLE (GPIOC->ODR ^= LED2_MASK)
92 
97 void board_init(void);
98 
99 #ifdef __cplusplus
100 }
101 #endif
102 
103 #endif /* BOARD_COMMON_H */
104 
Peripheral MCU configuration for the iotlab-m3 board.
void board_init(void)
Initialize board specific hardware, including clock, LEDs and std-IO.