board.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2018 Eistec AB
3  * SPDX-FileCopyrightText: 2018 HAW Hamburg
4  * SPDX-License-Identifier: LGPL-2.1-only
5  */
6 
7 #pragma once
8 
20 #include "cpu.h"
21 #include "periph_conf.h"
22 
23 #ifdef __cplusplus
24 extern "C"
25 {
26 #endif
27 
28 /* Set the FOPT bit to disable NMI so that we can use it as a GPIO pin for
29  * the LED (PTB18) */
30 #define KINETIS_FOPT (0xff & ~(NV_FOPT_NMI_DIS_MASK))
31 
36 #define LED0_PIN GPIO_PIN(PORT_B, 3)
37 #define LED0_MASK (1 << 3)
38 #define LED0_ON (GPIOB->PCOR = LED0_MASK)
39 #define LED0_OFF (GPIOB->PSOR = LED0_MASK)
40 #define LED0_TOGGLE (GPIOB->PTOR = LED0_MASK)
41 
42 #define LED1_PIN GPIO_PIN(PORT_B, 1)
43 #define LED1_MASK (1 << 1)
44 #define LED1_ON (GPIOB->PCOR = LED1_MASK)
45 #define LED1_OFF (GPIOB->PSOR = LED1_MASK)
46 #define LED1_TOGGLE (GPIOB->PTOR = LED1_MASK)
47 
48 #define LED2_PIN GPIO_PIN(PORT_B, 0)
49 #define LED2_MASK (1 << 0)
50 #define LED2_ON (GPIOB->PCOR = LED2_MASK)
51 #define LED2_OFF (GPIOB->PSOR = LED2_MASK)
52 #define LED2_TOGGLE (GPIOB->PTOR = LED2_MASK)
53 
54 #define LED3_PIN GPIO_PIN(PORT_B, 18)
55 #define LED3_MASK (1 << 18)
56 #define LED3_ON (GPIOB->PCOR = LED3_MASK)
57 #define LED3_OFF (GPIOB->PSOR = LED3_MASK)
58 #define LED3_TOGGLE (GPIOB->PTOR = LED3_MASK)
65 /* Pressing SW1 will short this pin to ground but there are no external pull
66  * resistors, use internal pull-up on the pin */
67 /* BTN0 is mapped to SW1 */
68 #define BTN0_PIN GPIO_PIN(PORT_C, 5)
69 #define BTN0_MODE GPIO_IN_PU
76 #define V_PERIPH_PIN GPIO_PIN(PORT_C, 19)
77 #define V_PERIPH_MASK (1 << 19)
78 #define V_PERIPH_ON (GPIOC->PSOR = V_PERIPH_MASK)
79 #define V_PERIPH_OFF (GPIOC->PCOR = V_PERIPH_MASK)
86 #if IS_ACTIVE(KINETIS_XTIMER_SOURCE_PIT)
87 /* PIT xtimer configuration */
88 #define XTIMER_DEV (TIMER_PIT_DEV(0))
89 #define XTIMER_CHAN (0)
90 /* Default xtimer settings should work on the PIT */
91 #else
92 /* LPTMR xtimer configuration */
93 #define XTIMER_DEV (TIMER_LPTMR_DEV(0))
94 #define XTIMER_CHAN (0)
95 /* LPTMR is 16 bits wide and runs at 32768 Hz (clocked by the RTC) */
96 #define XTIMER_WIDTH (16)
97 #define XTIMER_BACKOFF (5)
98 #define XTIMER_ISR_BACKOFF (5)
99 #define XTIMER_HZ (32768ul)
100 #endif
107 #define CONFIG_ZTIMER_USEC_TYPE ZTIMER_TYPE_PERIPH_TIMER
108 #define CONFIG_ZTIMER_USEC_DEV (TIMER_PIT_DEV(0))
115 #define CCS811_PARAM_I2C_DEV (I2C_DEV(0))
116 #define CCS811_PARAM_I2C_ADDR (0x5A)
117 #define CCS811_PARAM_RESET_PIN (GPIO_UNDEF)
118 #define CCS811_PARAM_WAKE_PIN (GPIO_PIN(1, 2))
119 #define CCS811_PARAM_INT_PIN (GPIO_PIN(1, 3))
120 #define CCS811_PARAM_INT_MODE (CCS811_INT_NONE)
127 #define TCS37727_PARAM_I2C (I2C_DEV(0))
128 #define TCS37727_PARAM_ADDR (0x29)
135 #define MMA8X5X_PARAM_I2C (I2C_DEV(0))
136 #define MMA8X5X_PARAM_ADDR (0x1D)
139 #ifdef __cplusplus
140 }
141 #endif
142 
Peripheral MCU configuration for the Zigduino board.