22#include "periph_cpu.h"
32static const clock_config_t clock_config = {
45 .clkdiv1 = SIM_CLKDIV1_OUTDIV1(0) | SIM_CLKDIV1_OUTDIV2(0) |
46 SIM_CLKDIV1_OUTDIV3(1) | SIM_CLKDIV1_OUTDIV4(1),
49 .osc32ksel = SIM_SOPT1_OSC32KSEL(2),
51 KINETIS_CLOCK_RTCOSC_EN |
52 KINETIS_CLOCK_USE_FAST_IRC |
54 .default_mode = KINETIS_MCG_MODE_FEE,
55 .erc_range = KINETIS_MCG_ERC_RANGE_LOW,
58 .osc_clc = OSC_CR_SC16P_MASK,
59 .oscsel = MCG_C7_OSCSEL(1),
60 .fcrdiv = MCG_SC_FCRDIV(0),
61 .fll_frdiv = MCG_C1_FRDIV(0b000),
62 .fll_factor_fei = KINETIS_MCG_FLL_FACTOR_1464,
63 .fll_factor_fee = KINETIS_MCG_FLL_FACTOR_1464,
67 .pll_prdiv = MCG_C5_PRDIV0(0b00111),
68 .pll_vdiv = MCG_C6_VDIV0(0b01100),
70#define CLOCK_CORECLOCK (48000000ul)
71#define CLOCK_BUSCLOCK (CLOCK_CORECLOCK / 1)
89#define LPTMR_NUMOF (0U)
90#define LPTMR_CONFIG { \
92#define TIMER_NUMOF ((PIT_NUMOF) + (LPTMR_NUMOF))
94#define PIT_BASECLOCK (CLOCK_BUSCLOCK)
95#define PIT_ISR_0 isr_pit1
96#define PIT_ISR_1 isr_pit3
109 .pcr_rx = PORT_PCR_MUX(3),
110 .pcr_tx = PORT_PCR_MUX(3),
111 .irqn = UART0_RX_TX_IRQn,
112 .scgc_addr = &SIM->SCGC4,
113 .scgc_bit = SIM_SCGC4_UART0_SHIFT,
122 .pcr_rx = PORT_PCR_MUX(3),
123 .pcr_tx = PORT_PCR_MUX(3),
124 .irqn = UART1_RX_TX_IRQn,
125 .scgc_addr = &SIM->SCGC4,
126 .scgc_bit = SIM_SCGC4_UART1_SHIFT,
132#define UART_0_ISR (isr_uart0_rx_tx)
133#define UART_1_ISR (isr_uart1_rx_tx)
135#define UART_NUMOF ARRAY_SIZE(uart_config)
148 { .pin =
GPIO_UNDEF, .af = 0, .ftm_chan = 0 },
159 { .pin =
GPIO_UNDEF, .af = 0, .ftm_chan = 0 },
167#define PWM_NUMOF ARRAY_SIZE(pwm_config)
#define CLOCK_CORECLOCK
Clock configuration.
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
#define GPIO_UNDEF
Definition of a fitting UNDEF value.
#define UART0
UART0 register bank.
#define UART1
UART1 register bank.
@ KINETIS_UART
Kinetis UART module type.
@ UART_MODE_8N1
8 data bits, no parity, 1 stop bit
gpio_t pin
GPIO pin mapped to this channel.
PWM device configuration.
pwm_chan_t chan[TIMER_CHANNEL_NUMOF]
channel mapping set to {GPIO_UNDEF, 0} if not used
UART device configuration.
USART_t * dev
pointer to the used UART device