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 LPUART_0_CLOCK   CLOCK_MCGFLLCLK
 
#define UART_CLOCK_PM_BLOCKER   KINETIS_PM_STOP
 
#define UART_MAX_UNCLOCKED_BAUDRATE   57600ul
 
#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   (3.3f)
 
#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 = PWM_MODE(0, 1), PWM_RIGHT = PWM_MODE(0, 0), PWM_CENTER = PWM_MODE(1, 1), PWM_CENTER_INV = PWM_MODE(1, 0),
  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_LEFT,
  PWM_RIGHT, PWM_CENTER
}
 

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

◆ 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.

◆ PIT_CONFIG

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

Definition at line 90 of file periph_conf.h.

Enumeration Type Documentation

◆ pwm_mode_t

enum pwm_mode_t
Enumerator
PWM_LEFT 

left aligned PWM

PWM_RIGHT 

right aligned PWM

PWM_CENTER 

not supported

PWM_CENTER_INV 

not supported

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 },
}

Definition at line 158 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)),
},
}

Definition at line 335 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 245 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
},
}

Definition at line 310 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,
},
}

Definition at line 132 of file periph_conf.h.

PORT_C
@ PORT_C
port C
Definition: periph_cpu.h:38
CLOCK_CORECLOCK
#define CLOCK_CORECLOCK
GCLK reference speed.
Definition: periph_conf.h:32
UART_MODE_8N1
@ UART_MODE_8N1
8 data bits, no parity, 1 stop bit
Definition: periph_cpu.h:286
GPIO_IN_PU
@ GPIO_IN_PU
configure as input with pull-up resistor
Definition: gpio.h:121
KINETIS_LPUART
@ KINETIS_LPUART
Kinetis Low-power UART (LPUART) module type.
Definition: periph_cpu.h:508
GPIO_UNDEF
#define GPIO_UNDEF
Definition of a fitting UNDEF value.
Definition: periph_cpu_common.h:52
ADC_AVG_NONE
#define ADC_AVG_NONE
Disable hardware averaging.
Definition: periph_cpu.h:362
GPIO_PIN
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition: periph_cpu.h:35
I2C_SPEED_FAST
@ I2C_SPEED_FAST
fast mode: ~400 kbit/s
Definition: i2c.h:178
PORT_B
@ PORT_B
port B
Definition: periph_cpu.h:37
ADC_AVG_MAX
#define ADC_AVG_MAX
Maximum hardware averaging (32 samples)
Definition: periph_cpu.h:366