22 #include "periph_cpu.h"
32 static 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)
78 #define PIT_NUMOF (2U)
79 #define PIT_CONFIG { \
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)