The friendly Operating System for the Internet of Things
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 
49 #define XTIMER_WIDTH (16)
50 
56 #define AT86RF2XX_PARAMS_BOARD {.spi = SPI_DEV(0), \
57  .spi_clk = SPI_CLK_5MHZ, \
58  .cs_pin = GPIO_PIN(PORT_A, 4), \
59  .int_pin = GPIO_PIN(PORT_C, 4), \
60  .sleep_pin = GPIO_PIN(PORT_A, 2), \
61  .reset_pin = GPIO_PIN(PORT_C, 1)}
62 
67 #define LED0_PIN GPIO_PIN(PORT_D, 2)
68 #define LED1_PIN GPIO_PIN(PORT_B, 5)
69 #define LED2_PIN GPIO_PIN(PORT_C, 10)
70 
71 #define LED0_MASK (1 << 2)
72 #define LED1_MASK (1 << 5)
73 #define LED2_MASK (1 << 10)
74 
75 #define LED0_ON (GPIOD->ODR &= ~LED0_MASK)
76 #define LED0_OFF (GPIOD->ODR |= LED0_MASK)
77 #define LED0_TOGGLE (GPIOD->ODR ^= LED0_MASK)
78 
79 #define LED1_ON (GPIOB->ODR &= ~LED1_MASK)
80 #define LED1_OFF (GPIOB->ODR |= LED1_MASK)
81 #define LED1_TOGGLE (GPIOB->ODR ^= LED1_MASK)
82 
83 #define LED2_ON (GPIOC->ODR &= ~LED2_MASK)
84 #define LED2_OFF (GPIOC->ODR |= LED2_MASK)
85 #define LED2_TOGGLE (GPIOC->ODR ^= LED2_MASK)
86 
92 #define XTIMER_OVERHEAD 6
93 #define XTIMER_SHOOT_EARLY 3
94 
99 void board_init(void);
100 
101 #ifdef __cplusplus
102 }
103 #endif
104 
105 #endif /* BOARD_COMMON_H */
106 
Peripheral MCU configuration for the iotlab-m3 board.
void board_init(void)
Initialize board specific hardware, including clock, LEDs and std-IO.