board.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021 Gerson Fernando Budke
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 
9 #pragma once
10 
21 #include "cpu.h"
22 #include "macros/units.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
31 #define CLOCK_CORECLOCK MHZ(32)
32 
46 #ifndef STDIO_UART_BAUDRATE
47 #define STDIO_UART_BAUDRATE (115200U)
48 #endif
55 #define LED_PORT PORTQ
56 
57 #define LED0_PIN GPIO_PIN(PORT_Q, 3)
58 #define LED0_MODE GPIO_OUT
59 #define LED0_MASK (PIN3_bm)
60 #define LED0_ON (LED_PORT.OUTCLR = LED0_MASK)
61 #define LED0_OFF (LED_PORT.OUTSET = LED0_MASK)
62 #define LED0_TOGGLE (LED_PORT.OUTTGL = LED0_MASK)
63 
64 #define LED_PORT_MASK (LED0_MASK)
71 #define BTN0_PIN GPIO_PIN(PORT_Q, 2)
72 #define BTN0_MODE (GPIO_IN | GPIO_OPC_PU | GPIO_SLEW_RATE)
73 #define BTN0_INT_FLANK (GPIO_ISC_FALLING | GPIO_LVL_LOW)
90 #define XTIMER_DEV TIMER_DEV(0)
91 #define XTIMER_CHAN (0)
92 #define XTIMER_WIDTH (16)
93 #define XTIMER_HZ KHZ(500)
94 #define XTIMER_BACKOFF (150)
97 #ifdef __cplusplus
98 }
99 #endif
100 
Unit helper macros.