21 #include "periph_cpu.h"
32 static const clock_config_t clock_config = {
40 .clkdiv1 = SIM_CLKDIV1_OUTDIV1(0) | SIM_CLKDIV1_OUTDIV4(0),
42 .rtc_clc = RTC_CR_SC8P_MASK | RTC_CR_SC4P_MASK,
44 .osc32ksel = SIM_SOPT1_OSC32KSEL(0),
46 KINETIS_CLOCK_RTCOSC_EN |
47 KINETIS_CLOCK_USE_FAST_IRC |
48 KINETIS_CLOCK_MCGIRCLK_EN |
49 KINETIS_CLOCK_MCGIRCLK_STOP_EN |
52 .default_mode = KINETIS_MCG_MODE_LIRC8M,
54 .erc_range = KINETIS_MCG_ERC_RANGE_LOW,
56 .fcrdiv = MCG_SC_FCRDIV(0),
57 .lirc_div2 = MCG_MC_LIRC_DIV2(0),
59 #define CLOCK_CORECLOCK ( 8000000ul)
60 #define CLOCK_MCGIRCLK ( 8000000ul)
61 #define CLOCK_BUSCLOCK (CLOCK_CORECLOCK / 1)
68 #define PIT_NUMOF (1U)
69 #define PIT_CONFIG { \
75 #define LPTMR_NUMOF (1U)
76 #define LPTMR_CONFIG { \
79 .irqn = LPTMR0_IRQn, \
81 .base_freq = 32768u, \
84 #define TIMER_NUMOF ((PIT_NUMOF) + (LPTMR_NUMOF))
86 #define PIT_BASECLOCK (CLOCK_BUSCLOCK)
87 #define PIT_ISR_0 isr_pit1
88 #define LPTMR_ISR_0 isr_lptmr0
98 .freq = CLOCK_MCGIRCLK,
101 .pcr_rx = PORT_PCR_MUX(2),
102 .pcr_tx = PORT_PCR_MUX(2),
103 .irqn = LPUART0_IRQn,
104 .scgc_addr = &SIM->SCGC5,
105 .scgc_bit = SIM_SCGC5_LPUART0_SHIFT,
110 #define UART_NUMOF ARRAY_SIZE(uart_config)
111 #define LPUART_0_ISR isr_lpuart0
113 #define LPUART_0_SRC 3
130 #define ADC_NUMOF ARRAY_SIZE(adc_config)
137 #define ADC_REF_SETTING 0
152 .scl_pcr = (PORT_PCR_MUX(5)),
153 .sda_pcr = (PORT_PCR_MUX(5)),
162 .scl_pcr = (PORT_PCR_MUX(6)),
163 .sda_pcr = (PORT_PCR_MUX(6)),
166 #define I2C_NUMOF ARRAY_SIZE(i2c_config)
167 #define I2C_0_ISR isr_i2c0
168 #define I2C_1_ISR isr_i2c1
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
static const uart_conf_t uart_config[]
UART configuration.
static const i2c_conf_t i2c_config[]
I2C configuration.
static const adc_conf_t adc_config[]
ADC configuration.
#define CLOCK_CORECLOCK
System core clock in Hz.
@ I2C_SPEED_FAST
fast mode: ~400 kbit/s
@ KINETIS_LPUART
Kinetis Low-power UART (LPUART) module type.
@ UART_MODE_8N1
8 data bits, no parity, 1 stop bit
#define ADC_AVG_MAX
Maximum hardware averaging (32 samples)
ADC device configuration.
ADC_TypeDef * dev
ADC device used.
I2C configuration structure.
I2C_Type * i2c
Pointer to hardware module registers.
UART device configuration.
USART_t * dev
pointer to the used UART device