board_common.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Freie Universität Berlin, Hinnerk van Bruinehsen
3  * 2016 Laurent Navet <laurent.navet@gmail.com>
4  * 2017 Thomas Perrot <thomas.perrot@tupi.fr>
5  *
6  * This file is subject to the terms and conditions of the GNU Lesser
7  * General Public License v2.1. See the file LICENSE in the top level
8  * directory for more details.
9  */
10 
25 #ifndef BOARD_COMMON_H
26 #define BOARD_COMMON_H
27 
28 #include "cpu.h"
29 #include "arduino_pinmap.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
42 #define STDIO_UART_BAUDRATE (9600U)
49 #ifdef CPU_ATMEGA328P
50 #define LED0_PIN GPIO_PIN(1, 5)
51 #define LED0_MASK (1 << DDB5)
52 #define LED0_ON (PORTB |= LED0_MASK)
53 #define LED0_OFF (PORTB &= ~LED0_MASK)
54 #define LED0_TOGGLE (PORTB ^= LED0_MASK)
55 #endif
56 
57 #ifdef CPU_ATMEGA32U4
58 #define LED0_PIN GPIO_PIN(2, 7)
59 #define LED0_MASK (1 << DDC7)
60 #define LED1_PIN GPIO_PIN(1, 0)
61 #define LED1_MASK (1 << DDB0)
62 #define LED2_PIN GPIO_PIN(3, 5)
63 #define LED2_MASK (1 << DDD5)
64 #endif
65 
66 #ifdef CPU_ATMEGA2560
67 #define LED0_PIN GPIO_PIN(1, 7)
68 #define LED0_MASK (1 << DDB7)
69 #define LED0_ON (PORTB |= LED0_MASK)
70 #define LED0_OFF (PORTB &= ~LED0_MASK)
71 #define LED0_TOGGLE (PORTB ^= LED0_MASK)
72 #endif
73 
74 #ifdef CPU_ATMEGA32U4
75 #define LED0_ON (PORTC |= LED0_MASK)
76 #define LED0_OFF (PORTC &= ~LED0_MASK)
77 #define LED0_TOGGLE (PORTC ^= LED0_MASK)
78 #define LED1_OFF (PORTB |= LED1_MASK)
79 #define LED1_ON (PORTB &= ~LED1_MASK)
80 #define LED1_TOGGLE (PORTB ^= LED1_MASK)
81 #define LED2_OFF (PORTD |= LED2_MASK)
82 #define LED2_ON (PORTD &= ~LED2_MASK)
83 #define LED2_TOGGLE (PORTD ^= LED2_MASK)
84 #endif
91 #define LED_PANIC LED0_ON
98 #define CPU_ATMEGA_CLK_SCALE_INIT CPU_ATMEGA_CLK_SCALE_DIV1
105 #define XTIMER_WIDTH (16)
106 #define XTIMER_HZ (250000UL)
107 #define XTIMER_BACKOFF (40)
114 #define CONFIG_ZTIMER_USEC_TYPE ZTIMER_TYPE_PERIPH_TIMER
115 #define CONFIG_ZTIMER_USEC_DEV (TIMER_DEV(0))
116 #define CONFIG_ZTIMER_USEC_FREQ (250000LU)
117 #define CONFIG_ZTIMER_USEC_WIDTH (16)
118 #ifndef CONFIG_ZTIMER_USEC_ADJUST_SET
119 #define CONFIG_ZTIMER_USEC_ADJUST_SET (128)
120 #endif
121 #ifndef CONFIG_ZTIMER_USEC_ADJUST_SLEEP
122 #define CONFIG_ZTIMER_USEC_ADJUST_SLEEP (116)
123 #endif
126 #ifdef __cplusplus
127 }
128 #endif
129 
130 #endif /* BOARD_COMMON_H */
Compatibility wrapper for arduino_iomap.h.