18 #include "periph_cpu.h"
29 static const clock_config_t clock_config = {
37 .clkdiv1 = SIM_CLKDIV1_OUTDIV1(0) | SIM_CLKDIV1_OUTDIV4(1),
43 .osc32ksel = SIM_SOPT1_OSC32KSEL(0),
45 KINETIS_CLOCK_OSC0_EN |
46 KINETIS_CLOCK_RTCOSC_EN |
47 KINETIS_CLOCK_USE_FAST_IRC |
48 KINETIS_CLOCK_MCGIRCLK_EN |
49 KINETIS_CLOCK_MCGIRCLK_STOP_EN |
53 .default_mode = KINETIS_MCG_MODE_FEI,
55 .erc_range = KINETIS_MCG_ERC_RANGE_VERY_HIGH,
57 .oscsel = MCG_C7_OSCSEL(0),
58 .fcrdiv = MCG_SC_FCRDIV(0),
59 .fll_frdiv = MCG_C1_FRDIV(0b101),
60 .fll_factor_fei = KINETIS_MCG_FLL_FACTOR_1464,
61 .fll_factor_fee = KINETIS_MCG_FLL_FACTOR_1280,
64 #define CLOCK_RADIOXTAL (32000000ul)
66 #define CLOCK_CORECLOCK (48000000ul)
67 #define CLOCK_BUSCLOCK (CLOCK_CORECLOCK / 2)
68 #define CLOCK_MCGIRCLK (4000000ul)
75 #define PIT_NUMOF (1U)
76 #define PIT_CONFIG { \
82 #define LPTMR_NUMOF (1U)
83 #define LPTMR_CONFIG { \
86 .irqn = LPTMR0_IRQn, \
88 .base_freq = 32768u, \
91 #define TIMER_NUMOF ((PIT_NUMOF) + (LPTMR_NUMOF))
92 #define PIT_BASECLOCK (CLOCK_BUSCLOCK)
93 #define LPTMR_ISR_0 isr_lptmr0
103 .freq = CLOCK_MCGIRCLK,
106 .pcr_rx = PORT_PCR_MUX(4),
107 .pcr_tx = PORT_PCR_MUX(4),
108 .irqn = LPUART0_IRQn,
109 .scgc_addr = &SIM->SCGC5,
110 .scgc_bit = SIM_SCGC5_LPUART0_SHIFT,
115 #define UART_NUMOF ARRAY_SIZE(uart_config)
116 #define LPUART_0_ISR isr_lpuart0
118 #define LPUART_0_SRC 3
133 SPI_CTAR_PBR(2) | SPI_CTAR_BR(5) |
134 SPI_CTAR_PCSSCK(2) | SPI_CTAR_CSSCK(4) |
135 SPI_CTAR_PASC(2) | SPI_CTAR_ASC(4) |
136 SPI_CTAR_PDT(2) | SPI_CTAR_DT(4)
139 SPI_CTAR_PBR(2) | SPI_CTAR_BR(3) |
140 SPI_CTAR_PCSSCK(2) | SPI_CTAR_CSSCK(2) |
141 SPI_CTAR_PASC(2) | SPI_CTAR_ASC(2) |
142 SPI_CTAR_PDT(2) | SPI_CTAR_DT(2)
145 SPI_CTAR_PBR(0) | SPI_CTAR_BR(3) |
146 SPI_CTAR_PCSSCK(0) | SPI_CTAR_CSSCK(3) |
147 SPI_CTAR_PASC(0) | SPI_CTAR_ASC(3) |
148 SPI_CTAR_PDT(0) | SPI_CTAR_DT(3)
151 SPI_CTAR_PBR(0) | SPI_CTAR_BR(0) |
152 SPI_CTAR_PCSSCK(0) | SPI_CTAR_CSSCK(1) |
153 SPI_CTAR_PASC(0) | SPI_CTAR_ASC(1) |
154 SPI_CTAR_PDT(0) | SPI_CTAR_DT(1)
157 SPI_CTAR_PBR(0) | SPI_CTAR_BR(0) |
158 SPI_CTAR_PCSSCK(0) | SPI_CTAR_CSSCK(0) |
159 SPI_CTAR_PASC(0) | SPI_CTAR_ASC(0) |
160 SPI_CTAR_PDT(0) | SPI_CTAR_DT(0)
169 #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