Loading...
Searching...
No Matches
board.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2018 Eistec AB
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
9#pragma once
10
22
23#include "cpu.h"
24#include "periph_conf.h"
25
26#ifdef __cplusplus
27extern "C"
28{
29#endif
30
34/* Disable ROM bootloader, launch user application from flash */
35#define KINETIS_FOPT (0xff & ~(NV_FOPT_BOOTSRC_SEL_MASK | NV_FOPT_BOOTPIN_OPT_MASK))
36
41/* LEDs are named LED1, LED2 in the original board schematics, we remap the LEDs
42 * to 0-indexed: NXP LED1 -> RIOT LED0, NXP LED2 -> RIOT LED1 */
43#define LED0_PIN GPIO_PIN(PORT_D, 5)
44#define LED1_PIN GPIO_PIN(PORT_E, 31)
45
46#define LED0_MASK (1 << 5)
47#define LED1_MASK (1 << 31)
48
49#define LED0_ON (GPIOD->PCOR = LED0_MASK)
50#define LED0_OFF (GPIOD->PSOR = LED0_MASK)
51#define LED0_TOGGLE (GPIOD->PTOR = LED0_MASK)
52
53#define LED1_ON (GPIOE->PCOR = LED1_MASK)
54#define LED1_OFF (GPIOE->PSOR = LED1_MASK)
55#define LED1_TOGGLE (GPIOE->PTOR = LED1_MASK)
57
62#if IS_ACTIVE(KINETIS_XTIMER_SOURCE_PIT)
63/* PIT xtimer configuration */
64#define XTIMER_DEV (TIMER_PIT_DEV(0))
65#define XTIMER_CHAN (0)
66/* Default xtimer settings should work on the PIT */
67#else
68/* LPTMR xtimer configuration */
69#define XTIMER_DEV (TIMER_LPTMR_DEV(0))
70#define XTIMER_CHAN (0)
71/* LPTMR is 16 bits wide and runs at 32768 Hz (clocked by the RTC) */
72#define XTIMER_WIDTH (16)
73#define XTIMER_BACKOFF (5)
74#define XTIMER_ISR_BACKOFF (5)
75#define XTIMER_OVERHEAD (4)
76#define XTIMER_HZ (32768ul)
77#endif
79
84#define MAG3110_PARAM_I2C I2C_DEV(0)
85#define MAG3110_PARAM_ADDR 0x0E
87
92#define MMA8X5X_PARAM_I2C I2C_DEV(0)
93#define MMA8X5X_PARAM_ADDR 0x1D
94#define MMA8X5X_PARAM_TYPE (MMA8X5X_TYPE_MMA8451)
96
97#ifdef __cplusplus
98}
99#endif
100