Loading...
Searching...
No Matches
periph_conf.h File Reference
#include "periph_cpu.h"
+ Include dependency graph for periph_conf.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Clock system configuration

#define RTC_LOAD_CAP_BITS   (RTC_CR_SC8P_MASK | RTC_CR_SC4P_MASK | RTC_CR_SC2P_MASK)
 
#define CLOCK_CORECLOCK   (48000000ul)
 
#define CLOCK_BUSCLOCK   (CLOCK_CORECLOCK / 1)
 
static const clock_config_t clock_config
 

Timer configuration

#define PIT_NUMOF   (2U)
 
#define PIT_CONFIG
 
#define LPTMR_NUMOF   (1U)
 
#define LPTMR_CONFIG
 
#define TIMER_NUMOF   ((PIT_NUMOF) + (LPTMR_NUMOF))
 
#define PIT_BASECLOCK   (CLOCK_BUSCLOCK)
 
#define PIT_ISR_0   isr_pit1
 
#define PIT_ISR_1   isr_pit3
 
#define LPTMR_ISR_0   isr_lptmr0
 

UART configuration

#define UART_0_ISR   (isr_uart0_rx_tx)
 
#define UART_1_ISR   (isr_uart1_rx_tx)
 
#define UART_NUMOF   ARRAY_SIZE(uart_config)
 
static const uart_conf_t uart_config []
 

ADC configuration

#define ADC_NUMOF   ARRAY_SIZE(adc_config)
 
#define ADC_REF_SETTING   0
 
static const adc_conf_t adc_config []
 

DAC configuration

#define DAC_NUMOF   ARRAY_SIZE(dac_config)
 
static const dac_conf_t dac_config []
 

PWM configuration

#define PWM_NUMOF   ARRAY_SIZE(pwm_config)
 
static const pwm_conf_t pwm_config []
 

SPI configuration

Clock configuration values based on the configured 47988736Hz module clock.

Auto-generated by: cpu/kinetis/dist/calc_spi_scalers/calc_spi_scalers.c

#define SPI_NUMOF   ARRAY_SIZE(spi_config)
 
static const uint32_t spi_clk_config []
 
static const spi_conf_t spi_config []
 

I2C configuration

#define I2C_NUMOF   ARRAY_SIZE(i2c_config)
 
#define I2C_0_ISR   (isr_i2c0)
 
#define I2C_1_ISR   (isr_i2c1)
 
static const i2c_conf_t i2c_config []
 

Macro Definition Documentation

◆ ADC_NUMOF

#define ADC_NUMOF   ARRAY_SIZE(adc_config)

Definition at line 204 of file periph_conf.h.

◆ ADC_REF_SETTING

#define ADC_REF_SETTING   0

Definition at line 211 of file periph_conf.h.

◆ CLOCK_BUSCLOCK

#define CLOCK_BUSCLOCK   (CLOCK_CORECLOCK / 1)

Definition at line 86 of file periph_conf.h.

◆ CLOCK_CORECLOCK

#define CLOCK_CORECLOCK   (48000000ul)

Definition at line 85 of file periph_conf.h.

◆ DAC_NUMOF

#define DAC_NUMOF   ARRAY_SIZE(dac_config)

Definition at line 226 of file periph_conf.h.

◆ I2C_0_ISR

#define I2C_0_ISR   (isr_i2c0)

Definition at line 357 of file periph_conf.h.

◆ I2C_1_ISR

#define I2C_1_ISR   (isr_i2c1)

Definition at line 358 of file periph_conf.h.

◆ I2C_NUMOF

#define I2C_NUMOF   ARRAY_SIZE(i2c_config)

Definition at line 356 of file periph_conf.h.

◆ LPTMR_CONFIG

#define LPTMR_CONFIG
Value:
{ \
{ \
.dev = LPTMR0, \
.irqn = LPTMR0_IRQn, \
.src = 2, \
.base_freq = 32768u, \
} \
}

Definition at line 105 of file periph_conf.h.

◆ LPTMR_ISR_0

#define LPTMR_ISR_0   isr_lptmr0

Definition at line 118 of file periph_conf.h.

◆ LPTMR_NUMOF

#define LPTMR_NUMOF   (1U)

Definition at line 104 of file periph_conf.h.

◆ PIT_BASECLOCK

#define PIT_BASECLOCK   (CLOCK_BUSCLOCK)

Definition at line 115 of file periph_conf.h.

◆ PIT_CONFIG

#define PIT_CONFIG
Value:
{ \
{ \
.prescaler_ch = 0, \
.count_ch = 1, \
}, \
{ \
.prescaler_ch = 2, \
.count_ch = 3, \
}, \
}

Definition at line 94 of file periph_conf.h.

◆ PIT_ISR_0

#define PIT_ISR_0   isr_pit1

Definition at line 116 of file periph_conf.h.

◆ PIT_ISR_1

#define PIT_ISR_1   isr_pit3

Definition at line 117 of file periph_conf.h.

◆ PIT_NUMOF

#define PIT_NUMOF   (2U)

Definition at line 93 of file periph_conf.h.

◆ PWM_NUMOF

#define PWM_NUMOF   ARRAY_SIZE(pwm_config)

Definition at line 258 of file periph_conf.h.

◆ RTC_LOAD_CAP_BITS

#define RTC_LOAD_CAP_BITS   (RTC_CR_SC8P_MASK | RTC_CR_SC4P_MASK | RTC_CR_SC2P_MASK)

Definition at line 45 of file periph_conf.h.

◆ SPI_NUMOF

#define SPI_NUMOF   ARRAY_SIZE(spi_config)

Definition at line 337 of file periph_conf.h.

◆ TIMER_NUMOF

#define TIMER_NUMOF   ((PIT_NUMOF) + (LPTMR_NUMOF))

Definition at line 113 of file periph_conf.h.

◆ UART_0_ISR

#define UART_0_ISR   (isr_uart0_rx_tx)

Definition at line 155 of file periph_conf.h.

◆ UART_1_ISR

#define UART_1_ISR   (isr_uart1_rx_tx)

Definition at line 156 of file periph_conf.h.

◆ UART_NUMOF

#define UART_NUMOF   ARRAY_SIZE(uart_config)

Definition at line 158 of file periph_conf.h.

Variable Documentation

◆ adc_config

const adc_conf_t adc_config[]
static

Definition at line 165 of file periph_conf.h.

◆ clock_config

const clock_config_t clock_config
static
Initial value:
= {
.clkdiv1 = SIM_CLKDIV1_OUTDIV1(0) | SIM_CLKDIV1_OUTDIV2(0) |
SIM_CLKDIV1_OUTDIV3(1) | SIM_CLKDIV1_OUTDIV4(1),
.rtc_clc = RTC_LOAD_CAP_BITS,
.osc32ksel = SIM_SOPT1_OSC32KSEL(2),
.clock_flags =
KINETIS_CLOCK_RTCOSC_EN |
KINETIS_CLOCK_USE_FAST_IRC |
0,
.default_mode = KINETIS_MCG_MODE_FEE,
.erc_range = KINETIS_MCG_ERC_RANGE_LOW,
.osc_clc = OSC_CR_SC16P_MASK,
.oscsel = MCG_C7_OSCSEL(1),
.fcrdiv = MCG_SC_FCRDIV(0),
.fll_frdiv = MCG_C1_FRDIV(0b000),
.fll_factor_fei = KINETIS_MCG_FLL_FACTOR_1464,
.fll_factor_fee = KINETIS_MCG_FLL_FACTOR_1464,
.pll_prdiv = MCG_C5_PRDIV0(0b00111),
.pll_vdiv = MCG_C6_VDIV0(0b01100),
}

Definition at line 47 of file periph_conf.h.

◆ dac_config

const dac_conf_t dac_config[]
static
Initial value:
= {
{
.dev = DAC0,
.scgc_addr = &SIM->SCGC2,
.scgc_bit = SIM_SCGC2_DAC0_SHIFT
}
}

Definition at line 218 of file periph_conf.h.

◆ i2c_config

const i2c_conf_t i2c_config[]
static
Initial value:
= {
{
.i2c = I2C0,
.scl_pin = GPIO_PIN(PORT_B, 2),
.sda_pin = GPIO_PIN(PORT_B, 1),
.freq = CLOCK_BUSCLOCK,
.speed = I2C_SPEED_FAST,
.irqn = I2C0_IRQn,
.scl_pcr = (PORT_PCR_MUX(2) | PORT_PCR_ODE_MASK),
.sda_pcr = (PORT_PCR_MUX(2) | PORT_PCR_ODE_MASK),
},
}
@ PORT_B
port B
Definition periph_cpu.h:48
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition periph_cpu.h:46
@ I2C_SPEED_FAST
fast mode: ~400 kbit/s
Definition periph_cpu.h:279
#define CLOCK_BUSCLOCK
Bus clock frequency, used by several hardware modules in Kinetis CPUs.
Definition mcg.h:147

Definition at line 344 of file periph_conf.h.

◆ pwm_config

const pwm_conf_t pwm_config[]
static
Initial value:
= {
{
.ftm = FTM0,
.chan = {
{ .pin = GPIO_PIN(PORT_C, 1), .af = 4, .ftm_chan = 0 },
{ .pin = GPIO_PIN(PORT_C, 2), .af = 4, .ftm_chan = 1 },
{ .pin = GPIO_UNDEF, .af = 0, .ftm_chan = 0 },
{ .pin = GPIO_UNDEF, .af = 0, .ftm_chan = 0 }
},
.chan_numof = 2,
.ftm_num = 0
},
{
.ftm = FTM1,
.chan = {
{ .pin = GPIO_PIN(PORT_A, 12), .af = 3, .ftm_chan = 0 },
{ .pin = GPIO_PIN(PORT_A, 13), .af = 3, .ftm_chan = 1 },
{ .pin = GPIO_UNDEF, .af = 0, .ftm_chan = 0 },
{ .pin = GPIO_UNDEF, .af = 0, .ftm_chan = 0 }
},
.chan_numof = 2,
.ftm_num = 1
}
}
@ PORT_C
port C
Definition periph_cpu.h:49
@ PORT_A
port A
Definition periph_cpu.h:47
#define GPIO_UNDEF
Definition of a fitting UNDEF value.

Definition at line 233 of file periph_conf.h.

◆ spi_clk_config

const uint32_t spi_clk_config[]
static

Definition at line 271 of file periph_conf.h.

◆ spi_config

const spi_conf_t spi_config[]
static

Definition at line 304 of file periph_conf.h.

◆ uart_config

const uart_conf_t uart_config[]
static
Initial value:
= {
{
.dev = UART0,
.freq = CLOCK_CORECLOCK,
.pin_rx = GPIO_PIN(PORT_A, 15),
.pin_tx = GPIO_PIN(PORT_A, 14),
.pcr_rx = PORT_PCR_MUX(3),
.pcr_tx = PORT_PCR_MUX(3),
.irqn = UART0_RX_TX_IRQn,
.scgc_addr = &SIM->SCGC4,
.scgc_bit = SIM_SCGC4_UART0_SHIFT,
.mode = UART_MODE_8N1,
.type = KINETIS_UART,
},
{
.dev = UART1,
.freq = CLOCK_CORECLOCK,
.pin_rx = GPIO_PIN(PORT_C, 3),
.pin_tx = GPIO_PIN(PORT_C, 4),
.pcr_rx = PORT_PCR_MUX(3),
.pcr_tx = PORT_PCR_MUX(3),
.irqn = UART1_RX_TX_IRQn,
.scgc_addr = &SIM->SCGC4,
.scgc_bit = SIM_SCGC4_UART1_SHIFT,
.mode = UART_MODE_8N1,
.type = KINETIS_UART,
},
}
#define CLOCK_CORECLOCK
CPU Frequency Define.
Definition periph_cpu.h:76
#define UART0
UART0 register bank.
#define UART1
UART1 register bank.
@ KINETIS_UART
Kinetis UART module type.
Definition periph_cpu.h:538
@ UART_MODE_8N1
8 data bits, no parity, 1 stop bit
Definition periph_cpu.h:294

Definition at line 126 of file periph_conf.h.