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.

Data Structures

struct  pwm_conf_t
 PWM device configuration. More...
 

Clock system configuration

#define CLOCK_RADIOXTAL   (32000000ul)
 
#define CLOCK_CORECLOCK   (48000000ul)
 
#define CLOCK_BUSCLOCK   (CLOCK_CORECLOCK / 2)
 
#define CLOCK_MCGFLLCLK   (CLOCK_CORECLOCK)
 
#define CLOCK_OSCERCLK   (CLOCK_RADIOXTAL)
 
#define CLOCK_MCGIRCLK   (4000000ul)
 
static const clock_config_t clock_config
 

Timer configuration

#define PIT_NUMOF   (1U)
 
#define PIT_CONFIG
 
#define LPTMR_NUMOF   (1U)
 
#define LPTMR_CONFIG
 
#define TIMER_NUMOF   ((PIT_NUMOF) + (LPTMR_NUMOF))
 
#define PIT_BASECLOCK   (CLOCK_BUSCLOCK)
 
#define LPTMR_ISR_0   isr_lptmr0
 

UART configuration

#define LPUART_0_SRC   1
 
#define UART_NUMOF   ARRAY_SIZE(uart_config)
 
#define LPUART_0_ISR   isr_lpuart0
 
static const uart_conf_t uart_config []
 

ADC configuration

#define ADC_NUMOF   ARRAY_SIZE(adc_config)
 
#define ADC_REF_SETTING   1
 
#define ADC_REF_VOLTAGE   (1.2f)
 
#define ADC_TEMPERATURE_CHANNEL   (4)
 
static const adc_conf_t adc_config []
 

DAC configuration

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

PWM mode configuration

#define HAVE_PWM_MODE_T
 
#define PWM_CHAN_MAX   (4U)
 PWM configuration structure.
 
enum  pwm_mode_t { PWM_LEFT = (TPM_CnSC_MSB_MASK | TPM_CnSC_ELSB_MASK) , PWM_RIGHT = (TPM_CnSC_MSB_MASK | TPM_CnSC_ELSA_MASK) , PWM_CENTER = (TPM_CnSC_MSB_MASK) }
 

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 16Mhz 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_i2c1)
 
static const i2c_conf_t i2c_config []
 

Random Number Generator configuration

#define KINETIS_TRNG   TRNG
 

Macro Definition Documentation

◆ ADC_NUMOF

#define ADC_NUMOF   ARRAY_SIZE(adc_config)

Definition at line 182 of file periph_conf.h.

◆ ADC_REF_SETTING

#define ADC_REF_SETTING   1

Definition at line 189 of file periph_conf.h.

◆ ADC_REF_VOLTAGE

#define ADC_REF_VOLTAGE   (1.2f)

Definition at line 193 of file periph_conf.h.

◆ ADC_TEMPERATURE_CHANNEL

#define ADC_TEMPERATURE_CHANNEL   (4)

Definition at line 196 of file periph_conf.h.

◆ CLOCK_BUSCLOCK

#define CLOCK_BUSCLOCK   (CLOCK_CORECLOCK / 2)

Definition at line 79 of file periph_conf.h.

◆ CLOCK_CORECLOCK

#define CLOCK_CORECLOCK   (48000000ul)

Definition at line 78 of file periph_conf.h.

◆ CLOCK_MCGFLLCLK

#define CLOCK_MCGFLLCLK   (CLOCK_CORECLOCK)

Definition at line 80 of file periph_conf.h.

◆ CLOCK_MCGIRCLK

#define CLOCK_MCGIRCLK   (4000000ul)

Definition at line 82 of file periph_conf.h.

◆ CLOCK_OSCERCLK

#define CLOCK_OSCERCLK   (CLOCK_RADIOXTAL)

Definition at line 81 of file periph_conf.h.

◆ CLOCK_RADIOXTAL

#define CLOCK_RADIOXTAL   (32000000ul)

Definition at line 76 of file periph_conf.h.

◆ DAC_NUMOF

#define DAC_NUMOF   ARRAY_SIZE(dac_config)

Definition at line 212 of file periph_conf.h.

◆ HAVE_PWM_MODE_T

#define HAVE_PWM_MODE_T

Definition at line 219 of file periph_conf.h.

◆ I2C_0_ISR

#define I2C_0_ISR   (isr_i2c1)

Definition at line 349 of file periph_conf.h.

◆ I2C_NUMOF

#define I2C_NUMOF   ARRAY_SIZE(i2c_config)

Definition at line 348 of file periph_conf.h.

◆ KINETIS_TRNG

#define KINETIS_TRNG   TRNG

Definition at line 356 of file periph_conf.h.

◆ LPTMR_CONFIG

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

Definition at line 97 of file periph_conf.h.

◆ LPTMR_ISR_0

#define LPTMR_ISR_0   isr_lptmr0

Definition at line 107 of file periph_conf.h.

◆ LPTMR_NUMOF

#define LPTMR_NUMOF   (1U)

Definition at line 96 of file periph_conf.h.

◆ LPUART_0_ISR

#define LPUART_0_ISR   isr_lpuart0

Definition at line 151 of file periph_conf.h.

◆ LPUART_0_SRC

#define LPUART_0_SRC   1

Definition at line 115 of file periph_conf.h.

◆ PIT_BASECLOCK

#define PIT_BASECLOCK   (CLOCK_BUSCLOCK)

Definition at line 106 of file periph_conf.h.

◆ PIT_CONFIG

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

Definition at line 90 of file periph_conf.h.

◆ PIT_NUMOF

#define PIT_NUMOF   (1U)

Definition at line 89 of file periph_conf.h.

◆ PWM_CHAN_MAX

#define PWM_CHAN_MAX   (4U)

PWM configuration structure.

Definition at line 229 of file periph_conf.h.

◆ PWM_NUMOF

#define PWM_NUMOF   ARRAY_SIZE(pwm_config)

Definition at line 265 of file periph_conf.h.

◆ SPI_NUMOF

#define SPI_NUMOF   ARRAY_SIZE(spi_config)

Definition at line 329 of file periph_conf.h.

◆ TIMER_NUMOF

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

Definition at line 105 of file periph_conf.h.

◆ UART_NUMOF

#define UART_NUMOF   ARRAY_SIZE(uart_config)

Definition at line 150 of file periph_conf.h.

Enumeration Type Documentation

◆ pwm_mode_t

enum pwm_mode_t
Enumerator
PWM_LEFT 

left aligned

PWM_RIGHT 

right aligned

PWM_CENTER 

center aligned

Definition at line 220 of file periph_conf.h.

Variable Documentation

◆ adc_config

const adc_conf_t adc_config[]
static
Initial value:
= {
[0] = { .dev = ADC0, .pin = GPIO_PIN(PORT_B, 1), .chan = 1, .avg = ADC_AVG_MAX },
[1] = { .dev = ADC0, .pin = GPIO_PIN(PORT_B, 2), .chan = 3, .avg = ADC_AVG_MAX },
[2] = { .dev = ADC0, .pin = GPIO_PIN(PORT_B, 3), .chan = 2, .avg = ADC_AVG_MAX },
[3] = { .dev = ADC0, .pin = GPIO_PIN(PORT_B, 18), .chan = 4, .avg = ADC_AVG_MAX },
[4] = { .dev = ADC0, .pin = GPIO_UNDEF, .chan = 26, .avg = ADC_AVG_NONE },
[5] = { .dev = ADC0, .pin = GPIO_UNDEF, .chan = 27, .avg = ADC_AVG_MAX },
[6] = { .dev = ADC0, .pin = GPIO_UNDEF, .chan = 23, .avg = ADC_AVG_MAX },
}
@ 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
#define GPIO_UNDEF
Definition of a fitting UNDEF value.
#define ADC_AVG_NONE
Disable hardware averaging.
Definition periph_cpu.h:370
#define ADC_AVG_MAX
Maximum hardware averaging (32 samples)
Definition periph_cpu.h:374

Definition at line 158 of file periph_conf.h.

◆ clock_config

const clock_config_t clock_config
static

Definition at line 34 of file periph_conf.h.

◆ dac_config

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

Definition at line 203 of file periph_conf.h.

◆ i2c_config

const i2c_conf_t i2c_config[]
static
Initial value:
= {
{
.i2c = I2C1,
.scl_pin = GPIO_PIN(PORT_C, 2),
.sda_pin = GPIO_PIN(PORT_C, 3),
.freq = CLOCK_CORECLOCK,
.speed = I2C_SPEED_FAST,
.irqn = I2C1_IRQn,
.scl_pcr = (PORT_PCR_MUX(3)),
.sda_pcr = (PORT_PCR_MUX(3)),
},
}
#define CLOCK_CORECLOCK
Clock configuration.
Definition periph_cpu.h:31
@ PORT_C
port C
Definition periph_cpu.h:49
@ I2C_SPEED_FAST
fast mode: ~400 kbit/s
Definition periph_cpu.h:279

Definition at line 336 of file periph_conf.h.

◆ pwm_config

const pwm_conf_t pwm_config[]
static
Initial value:
= {
{
.tpm = TPM0,
.chan = {
{ .pin = GPIO_PIN(PORT_B, 0), .af = 5, .ftm_chan = 1 }
},
.chan_numof = 1,
.tpm_num = 0
},
{
.tpm = TPM1,
.chan = {
{ .pin = GPIO_PIN(PORT_C, 4), .af = 5, .ftm_chan = 0 }
},
.chan_numof = 1,
.tpm_num = 1
}
}

Definition at line 246 of file periph_conf.h.

◆ spi_clk_config

const uint32_t spi_clk_config[]
static

Definition at line 278 of file periph_conf.h.

◆ spi_config

const spi_conf_t spi_config[]
static
Initial value:
= {
{
.dev = SPI0,
.pin_miso = GPIO_PIN(PORT_C, 18),
.pin_mosi = GPIO_PIN(PORT_C, 17),
.pin_clk = GPIO_PIN(PORT_C, 16),
.pin_cs = {
},
.pcr = (gpio_pcr_t)(GPIO_AF_2 | GPIO_IN_PU),
.simmask = SIM_SCGC6_SPI0_MASK
},
}
#define SPI_CS_UNDEF
Define value for unused CS line.
Definition periph_cpu.h:363

Definition at line 311 of file periph_conf.h.

◆ uart_config

const uart_conf_t uart_config[]
static
Initial value:
= {
{
.dev = LPUART0,
.freq = LPUART_0_CLOCK,
.pin_rx = GPIO_PIN(PORT_C, 6),
.pin_tx = GPIO_PIN(PORT_C, 7),
.pcr_rx = PORT_PCR_MUX(4) | GPIO_IN_PU,
.pcr_tx = PORT_PCR_MUX(4),
.irqn = LPUART0_IRQn,
.scgc_addr = &SIM->SCGC5,
.scgc_bit = SIM_SCGC5_LPUART0_SHIFT,
.mode = UART_MODE_8N1,
.type = KINETIS_LPUART,
},
}
@ KINETIS_LPUART
Kinetis Low-power UART (LPUART) module type.
Definition periph_cpu.h:539
@ UART_MODE_8N1
8 data bits, no parity, 1 stop bit
Definition periph_cpu.h:294

Definition at line 132 of file periph_conf.h.