21 #include "periph_cpu.h"
32 static const clock_config_t clock_config = {
40 .clkdiv1 = SIM_CLKDIV1_OUTDIV1(0) | SIM_CLKDIV1_OUTDIV4(1),
46 .osc32ksel = SIM_SOPT1_OSC32KSEL(0),
48 KINETIS_CLOCK_OSC0_EN |
49 KINETIS_CLOCK_RTCOSC_EN |
50 KINETIS_CLOCK_USE_FAST_IRC |
51 KINETIS_CLOCK_MCGIRCLK_EN |
52 KINETIS_CLOCK_MCGIRCLK_STOP_EN |
56 .default_mode = KINETIS_MCG_MODE_FEI,
58 .erc_range = KINETIS_MCG_ERC_RANGE_VERY_HIGH,
60 .oscsel = MCG_C7_OSCSEL(0),
61 .fcrdiv = MCG_SC_FCRDIV(0),
62 .fll_frdiv = MCG_C1_FRDIV(0b101),
63 .fll_factor_fei = KINETIS_MCG_FLL_FACTOR_1464,
64 .fll_factor_fee = KINETIS_MCG_FLL_FACTOR_1280,
67 #define CLOCK_RADIOXTAL (32000000ul)
69 #define CLOCK_CORECLOCK (48000000ul)
70 #define CLOCK_BUSCLOCK (CLOCK_CORECLOCK / 2)
71 #define CLOCK_MCGIRCLK (4000000ul)
78 #define PIT_NUMOF (1U)
79 #define PIT_CONFIG { \
85 #define LPTMR_NUMOF (1U)
86 #define LPTMR_CONFIG { \
89 .irqn = LPTMR0_IRQn, \
91 .base_freq = 32768u, \
94 #define TIMER_NUMOF ((PIT_NUMOF) + (LPTMR_NUMOF))
95 #define PIT_BASECLOCK (CLOCK_BUSCLOCK)
96 #define LPTMR_ISR_0 isr_lptmr0
106 .freq = CLOCK_MCGIRCLK,
109 .pcr_rx = PORT_PCR_MUX(4),
110 .pcr_tx = PORT_PCR_MUX(4),
111 .irqn = LPUART0_IRQn,
112 .scgc_addr = &SIM->SCGC5,
113 .scgc_bit = SIM_SCGC5_LPUART0_SHIFT,
118 #define UART_NUMOF ARRAY_SIZE(uart_config)
119 #define LPUART_0_ISR isr_lpuart0
121 #define LPUART_0_SRC 3
136 SPI_CTAR_PBR(2) | SPI_CTAR_BR(5) |
137 SPI_CTAR_PCSSCK(2) | SPI_CTAR_CSSCK(4) |
138 SPI_CTAR_PASC(2) | SPI_CTAR_ASC(4) |
139 SPI_CTAR_PDT(2) | SPI_CTAR_DT(4)
142 SPI_CTAR_PBR(2) | SPI_CTAR_BR(3) |
143 SPI_CTAR_PCSSCK(2) | SPI_CTAR_CSSCK(2) |
144 SPI_CTAR_PASC(2) | SPI_CTAR_ASC(2) |
145 SPI_CTAR_PDT(2) | SPI_CTAR_DT(2)
148 SPI_CTAR_PBR(0) | SPI_CTAR_BR(3) |
149 SPI_CTAR_PCSSCK(0) | SPI_CTAR_CSSCK(3) |
150 SPI_CTAR_PASC(0) | SPI_CTAR_ASC(3) |
151 SPI_CTAR_PDT(0) | SPI_CTAR_DT(3)
154 SPI_CTAR_PBR(0) | SPI_CTAR_BR(0) |
155 SPI_CTAR_PCSSCK(0) | SPI_CTAR_CSSCK(1) |
156 SPI_CTAR_PASC(0) | SPI_CTAR_ASC(1) |
157 SPI_CTAR_PDT(0) | SPI_CTAR_DT(1)
160 SPI_CTAR_PBR(0) | SPI_CTAR_BR(0) |
161 SPI_CTAR_PCSSCK(0) | SPI_CTAR_CSSCK(0) |
162 SPI_CTAR_PASC(0) | SPI_CTAR_ASC(0) |
163 SPI_CTAR_PDT(0) | SPI_CTAR_DT(0)
172 #define KINETIS_TRNG TRNG
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
static const spi_clk_conf_t spi_clk_config[]
Pre-calculated clock divider values based on a CLOCK_CORECLOCK (32MHz)
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