19#ifndef PERIPH_CONF_COMMON_H
20#define PERIPH_CONF_COMMON_H
22#include "periph_cpu.h"
33static const clock_config_t clock_config = {
41 .clkdiv1 = SIM_CLKDIV1_OUTDIV1(0) | SIM_CLKDIV1_OUTDIV4(1),
47 .osc32ksel = SIM_SOPT1_OSC32KSEL(0),
49 KINETIS_CLOCK_OSC0_EN |
50 KINETIS_CLOCK_RTCOSC_EN |
51 KINETIS_CLOCK_USE_FAST_IRC |
52 KINETIS_CLOCK_MCGIRCLK_EN |
53 KINETIS_CLOCK_MCGIRCLK_STOP_EN |
57 .default_mode = KINETIS_MCG_MODE_FEI,
59 .erc_range = KINETIS_MCG_ERC_RANGE_VERY_HIGH,
61 .oscsel = MCG_C7_OSCSEL(0),
62 .fcrdiv = MCG_SC_FCRDIV(0),
63 .fll_frdiv = MCG_C1_FRDIV(0b101),
64 .fll_factor_fei = KINETIS_MCG_FLL_FACTOR_1464,
65 .fll_factor_fee = KINETIS_MCG_FLL_FACTOR_1280,
68#define CLOCK_RADIOXTAL (32000000ul)
70#define CLOCK_CORECLOCK (48000000ul)
71#define CLOCK_BUSCLOCK (CLOCK_CORECLOCK / 2)
72#define CLOCK_MCGIRCLK (4000000ul)
86#define LPTMR_NUMOF (1U)
87#define LPTMR_CONFIG { \
90 .irqn = LPTMR0_IRQn, \
92 .base_freq = 32768u, \
95#define TIMER_NUMOF ((PIT_NUMOF) + (LPTMR_NUMOF))
96#define PIT_BASECLOCK (CLOCK_BUSCLOCK)
97#define LPTMR_ISR_0 isr_lptmr0
107 .freq = CLOCK_MCGIRCLK,
110 .pcr_rx = PORT_PCR_MUX(4),
111 .pcr_tx = PORT_PCR_MUX(4),
112 .irqn = LPUART0_IRQn,
113 .scgc_addr = &SIM->SCGC5,
114 .scgc_bit = SIM_SCGC5_LPUART0_SHIFT,
119#define UART_NUMOF ARRAY_SIZE(uart_config)
120#define LPUART_0_ISR isr_lpuart0
122#define LPUART_0_SRC 3
135static const uint32_t spi_clk_config[] = {
137 SPI_CTAR_PBR(2) | SPI_CTAR_BR(5) |
138 SPI_CTAR_PCSSCK(2) | SPI_CTAR_CSSCK(4) |
139 SPI_CTAR_PASC(2) | SPI_CTAR_ASC(4) |
140 SPI_CTAR_PDT(2) | SPI_CTAR_DT(4)
143 SPI_CTAR_PBR(2) | SPI_CTAR_BR(3) |
144 SPI_CTAR_PCSSCK(2) | SPI_CTAR_CSSCK(2) |
145 SPI_CTAR_PASC(2) | SPI_CTAR_ASC(2) |
146 SPI_CTAR_PDT(2) | SPI_CTAR_DT(2)
149 SPI_CTAR_PBR(0) | SPI_CTAR_BR(3) |
150 SPI_CTAR_PCSSCK(0) | SPI_CTAR_CSSCK(3) |
151 SPI_CTAR_PASC(0) | SPI_CTAR_ASC(3) |
152 SPI_CTAR_PDT(0) | SPI_CTAR_DT(3)
155 SPI_CTAR_PBR(0) | SPI_CTAR_BR(0) |
156 SPI_CTAR_PCSSCK(0) | SPI_CTAR_CSSCK(1) |
157 SPI_CTAR_PASC(0) | SPI_CTAR_ASC(1) |
158 SPI_CTAR_PDT(0) | SPI_CTAR_DT(1)
161 SPI_CTAR_PBR(0) | SPI_CTAR_BR(0) |
162 SPI_CTAR_PCSSCK(0) | SPI_CTAR_CSSCK(0) |
163 SPI_CTAR_PASC(0) | SPI_CTAR_ASC(0) |
164 SPI_CTAR_PDT(0) | SPI_CTAR_DT(0)
173#define KINETIS_TRNG TRNG
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
static const uart_conf_t uart_config[]
Static array with configuration for declared UART devices.
@ KINETIS_LPUART
Kinetis Low-power UART (LPUART) module type.
@ UART_MODE_8N1
8 data bits, no parity, 1 stop bit
UART device configuration.
USART_t * dev
pointer to the used UART device