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 
21 #ifndef BOARD_H
22 #define BOARD_H
23 
24 #include "cpu.h"
25 #include "periph_conf.h"
26 
27 #ifdef __cplusplus
28 extern "C"
29 {
30 #endif
31 
35 /* Disable ROM bootloader, launch user application from flash */
36 #define KINETIS_FOPT (0xff & ~(NV_FOPT_BOOTSRC_SEL_MASK | NV_FOPT_BOOTPIN_OPT_MASK))
37 
42 /* LEDs are named LED1, LED2 in the original board schematics, we remap the LEDs
43  * to 0-indexed: NXP LED1 -> RIOT LED0, NXP LED2 -> RIOT LED1 */
44 #define LED0_PIN GPIO_PIN(PORT_D, 5)
45 #define LED1_PIN GPIO_PIN(PORT_E, 31)
46 
47 #define LED0_MASK (1 << 5)
48 #define LED1_MASK (1 << 31)
49 
50 #define LED0_ON (GPIOD->PCOR = LED0_MASK)
51 #define LED0_OFF (GPIOD->PSOR = LED0_MASK)
52 #define LED0_TOGGLE (GPIOD->PTOR = LED0_MASK)
53 
54 #define LED1_ON (GPIOE->PCOR = LED1_MASK)
55 #define LED1_OFF (GPIOE->PSOR = LED1_MASK)
56 #define LED1_TOGGLE (GPIOE->PTOR = LED1_MASK)
57 
63 #if KINETIS_XTIMER_SOURCE_PIT
64 /* PIT xtimer configuration */
65 #define XTIMER_DEV (TIMER_PIT_DEV(0))
66 #define XTIMER_CHAN (0)
67 /* Default xtimer settings should work on the PIT */
68 #else
69 /* LPTMR xtimer configuration */
70 #define XTIMER_DEV (TIMER_LPTMR_DEV(0))
71 #define XTIMER_CHAN (0)
72 /* LPTMR is 16 bits wide and runs at 32768 Hz (clocked by the RTC) */
73 #define XTIMER_WIDTH (16)
74 #define XTIMER_BACKOFF (5)
75 #define XTIMER_ISR_BACKOFF (5)
76 #define XTIMER_OVERHEAD (4)
77 #define XTIMER_HZ (32768ul)
78 #endif
79 
85 #define MAG3110_PARAM_I2C I2C_DEV(0)
86 #define MAG3110_PARAM_ADDR 0x0E
87 
93 #define MMA8X5X_PARAM_I2C I2C_DEV(0)
94 #define MMA8X5X_PARAM_ADDR 0x1D
95 #define MMA8X5X_PARAM_TYPE (MMA8X5X_TYPE_MMA8451)
96 
101 void board_init(void);
102 
103 #ifdef __cplusplus
104 }
105 #endif
106 
107 #endif /* BOARD_H */
108 
periph_conf.h
board_init
void board_init(void)
Board level initialization.