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 STDIO_UART_BAUDRATE
42 # define STDIO_UART_BAUDRATE (500000U)
43 #endif
44 
52 #define XTIMER_WIDTH (16U)
53 
59 #define CONFIG_ZTIMER_USEC_TYPE ZTIMER_TYPE_PERIPH_TIMER
60 #define CONFIG_ZTIMER_USEC_DEV TIMER_DEV(0)
61 #define CONFIG_ZTIMER_USEC_MIN (2)
62 
70 #define AT86RF2XX_PARAM_CS GPIO_PIN(PORT_A, 4)
71 #define AT86RF2XX_PARAM_INT GPIO_PIN(PORT_C, 4)
72 #define AT86RF2XX_PARAM_SLEEP GPIO_PIN(PORT_A, 2)
73 #define AT86RF2XX_PARAM_RESET GPIO_PIN(PORT_C, 1)
74 
80 #define LED0_PIN GPIO_PIN(PORT_D, 2)
81 #define LED1_PIN GPIO_PIN(PORT_B, 5)
82 #define LED2_PIN GPIO_PIN(PORT_C, 10)
83 
84 #define LED0_MASK (1 << 2)
85 #define LED1_MASK (1 << 5)
86 #define LED2_MASK (1 << 10)
87 
88 #define LED0_ON (GPIOD->ODR &= ~LED0_MASK)
89 #define LED0_OFF (GPIOD->ODR |= LED0_MASK)
90 #define LED0_TOGGLE (GPIOD->ODR ^= LED0_MASK)
91 
92 #define LED1_ON (GPIOB->ODR &= ~LED1_MASK)
93 #define LED1_OFF (GPIOB->ODR |= LED1_MASK)
94 #define LED1_TOGGLE (GPIOB->ODR ^= LED1_MASK)
95 
96 #define LED2_ON (GPIOC->ODR &= ~LED2_MASK)
97 #define LED2_OFF (GPIOC->ODR |= LED2_MASK)
98 #define LED2_TOGGLE (GPIOC->ODR ^= LED2_MASK)
99 
104 void board_init(void);
105 
106 #ifdef __cplusplus
107 }
108 #endif
109 
110 #endif /* BOARD_COMMON_H */
111 
periph_conf_common.h
Peripheral MCU configuration for the iotlab-m3 board.
board_init
void board_init(void)
Initialize board specific hardware, including clock, LEDs and std-IO.