Loading...
Searching...
No Matches
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
19#ifndef BOARD_H
20#define BOARD_H
21
22#include "cpu.h"
23#include "macros/units.h"
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
32#define CLOCK_CORECLOCK MHZ(32)
33
47#ifndef STDIO_UART_BAUDRATE
48#define STDIO_UART_BAUDRATE (115200U)
49#endif
56#define LED_PORT PORTQ
57
58#define LED0_PIN GPIO_PIN(PORT_Q, 3)
59#define LED0_MODE GPIO_OUT
60#define LED0_MASK (PIN3_bm)
61#define LED0_ON (LED_PORT.OUTCLR = LED0_MASK)
62#define LED0_OFF (LED_PORT.OUTSET = LED0_MASK)
63#define LED0_TOGGLE (LED_PORT.OUTTGL = LED0_MASK)
64
65#define LED_PORT_MASK (LED0_MASK)
72#define BTN0_PIN GPIO_PIN(PORT_Q, 2)
73#define BTN0_MODE (GPIO_IN | GPIO_OPC_PU | GPIO_SLEW_RATE)
74#define BTN0_INT_FLANK (GPIO_ISC_FALLING | GPIO_LVL_LOW)
91#define XTIMER_DEV TIMER_DEV(0)
92#define XTIMER_CHAN (0)
93#define XTIMER_WIDTH (16)
94#define XTIMER_HZ KHZ(500)
95#define XTIMER_BACKOFF (150)
98#ifdef __cplusplus
99}
100#endif
101
102#endif /* BOARD_H */
Unit helper macros.