periph_conf.h File Reference

Configuration of CPU peripherals for the Adafruit ItsyBitsy M4. More...

Detailed Description

Configuration of CPU peripherals for the Adafruit ItsyBitsy M4.

Author
Benjamin Valentin benja.nosp@m.min..nosp@m.valen.nosp@m.tin@.nosp@m.ml-pa.nosp@m..com

Definition in file periph_conf.h.

#include "periph_cpu.h"
+ Include dependency graph for periph_conf.h:

Go to the source code of this file.

Macros

#define USE_VREG_BUCK   (1)
 Enable the internal DC/DC converter The board is equipped with the necessary inductor.
 

desired core clock frequency

#define CLOCK_CORECLOCK   MHZ(120)
 

32kHz Oscillator configuration

#define EXTERNAL_OSC32_SOURCE   0
 
#define ULTRA_LOW_POWER_INTERNAL_OSC_SOURCE   1
 

Timer peripheral configuration

#define TIMER_0_CHANNELS   2
 
#define TIMER_0_ISR   isr_tc0
 
#define TIMER_1_CHANNELS   2
 
#define TIMER_1_ISR   isr_tc2
 
#define TIMER_NUMOF   ARRAY_SIZE(timer_config)
 
static const tc32_conf_t timer_config []
 

UART configuration

#define UART_0_ISR   isr_sercom3_2
 
#define UART_0_ISR_TX   isr_sercom3_0
 
#define UART_NUMOF   ARRAY_SIZE(uart_config)
 
static const uart_conf_t uart_config []
 

PWM configuration

#define PWM_0_EN   1
 
#define PWM_NUMOF   ARRAY_SIZE(pwm_config)
 
static const pwm_conf_chan_t pwm_chan0_config []
 
static const pwm_conf_t pwm_config []
 

SPI configuration

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

I2C configuration

#define I2C_NUMOF   ARRAY_SIZE(i2c_config)
 
static const i2c_conf_t i2c_config []
 

RTT configuration

#define RTT_FREQUENCY   (32768U)
 

USB peripheral configuration

static const sam0_common_usb_config_t sam_usbdev_config []
 

ADC Configuration

#define ADC_PRESCALER   ADC_CTRLA_PRESCALER_DIV128
 
#define ADC_NEG_INPUT   ADC_INPUTCTRL_MUXNEG(0x18u)
 
#define ADC_REF_DEFAULT   ADC_REFCTRL_REFSEL_INTVCC1
 
#define ADC_DEV   ADC0
 
#define ADC_NUMOF   ARRAY_SIZE(adc_channels)
 
static const adc_conf_chan_t adc_channels []
 

DAC configuration

#define DAC_CLOCK   SAM0_GCLK_TIMER
 
#define DAC_VREF   DAC_CTRLB_REFSEL_VREFPU
 

Variable Documentation

◆ adc_channels

const adc_conf_chan_t adc_channels[]
static
Initial value:
= {
{GPIO_PIN(PA, 2), ADC_INPUTCTRL_MUXPOS(ADC_INPUTCTRL_MUXPOS_AIN0)},
{GPIO_PIN(PA, 5), ADC_INPUTCTRL_MUXPOS(ADC_INPUTCTRL_MUXPOS_AIN5)},
{GPIO_PIN(PB, 8), ADC_INPUTCTRL_MUXPOS(ADC_INPUTCTRL_MUXPOS_AIN2)},
{GPIO_PIN(PB, 9), ADC_INPUTCTRL_MUXPOS(ADC_INPUTCTRL_MUXPOS_AIN3)},
{GPIO_PIN(PA, 4), ADC_INPUTCTRL_MUXPOS(ADC_INPUTCTRL_MUXPOS_AIN4)},
{GPIO_PIN(PA, 6), ADC_INPUTCTRL_MUXPOS(ADC_INPUTCTRL_MUXPOS_AIN6)},
}
port A
port B
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition: periph_cpu.h:35

Definition at line 243 of file periph_conf.h.

◆ i2c_config

const i2c_conf_t i2c_config[]
static
Initial value:
= {
{
.dev = &(SERCOM2->I2CM),
.speed = I2C_SPEED_NORMAL,
.scl_pin = GPIO_PIN(PA, 12),
.sda_pin = GPIO_PIN(PA, 13),
.mux = GPIO_MUX_C,
.gclk_src = SAM0_GCLK_PERIPH,
.flags = I2C_FLAG_NONE
},
}
No flags set.
port A
select peripheral function C
12-48 MHz (DFLL) clock
Definition: periph_cpu.h:67
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition: periph_cpu.h:35
normal mode: ~100 kbit/s
Definition: periph_cpu.h:274

Definition at line 192 of file periph_conf.h.

◆ pwm_chan0_config

const pwm_conf_chan_t pwm_chan0_config[]
static
Initial value:
= {
{ GPIO_PIN(PA, 22), GPIO_MUX_G, 2 },
}
port A
select peripheral function G
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition: periph_cpu.h:35

Definition at line 123 of file periph_conf.h.

◆ pwm_config

const pwm_conf_t pwm_config[]
static
Initial value:
= {
{ .tim = TCC_CONFIG(TCC0),
.chan = pwm_chan0_config,
.chan_numof = ARRAY_SIZE(pwm_chan0_config),
.gclk_src = SAM0_GCLK_PERIPH,
},
}
#define ARRAY_SIZE(a)
Calculate the number of elements in a static array.
12-48 MHz (DFLL) clock
Definition: periph_cpu.h:67
#define TCC_CONFIG(tim)
Static initializer for TCC timer configuration.

Definition at line 130 of file periph_conf.h.

◆ sam_usbdev_config

const sam0_common_usb_config_t sam_usbdev_config[]
static
Initial value:
= {
{
.dm = GPIO_PIN(PA, 24),
.dp = GPIO_PIN(PA, 25),
.d_mux = GPIO_MUX_H,
.device = &USB->DEVICE,
.gclk_src = SAM0_GCLK_PERIPH,
}
}
port A
select peripheral function H
12-48 MHz (DFLL) clock
Definition: periph_cpu.h:67
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition: periph_cpu.h:35

Definition at line 220 of file periph_conf.h.

◆ timer_config

const tc32_conf_t timer_config[]
static
Initial value:
= {
{
.dev = TC0,
.irq = TC0_IRQn,
.mclk = &MCLK->APBAMASK.reg,
.mclk_mask = MCLK_APBAMASK_TC0 | MCLK_APBAMASK_TC1,
.gclk_id = TC0_GCLK_ID,
.gclk_src = SAM0_GCLK_TIMER,
.flags = TC_CTRLA_MODE_COUNT32,
},
{
.dev = TC2,
.irq = TC2_IRQn,
.mclk = &MCLK->APBBMASK.reg,
.mclk_mask = MCLK_APBBMASK_TC2 | MCLK_APBBMASK_TC3,
.gclk_id = TC2_GCLK_ID,
.gclk_src = SAM0_GCLK_TIMER,
.flags = TC_CTRLA_MODE_COUNT32,
}
}
4-8 MHz clock for xTimer
Definition: periph_cpu.h:66

Definition at line 55 of file periph_conf.h.

◆ uart_config

const uart_conf_t uart_config[]
static
Initial value:
= {
{
.dev = &SERCOM3->USART,
.rx_pin = GPIO_PIN(PA, 16),
.tx_pin = GPIO_PIN(PA, 17),
.mux = GPIO_MUX_D,
.rx_pad = UART_PAD_RX_1,
.tx_pad = UART_PAD_TX_0,
.flags = UART_FLAG_NONE,
.gclk_src = SAM0_GCLK_PERIPH,
},
}
select peripheral function D
select pad 1
select pad 0
port A
No flags set.
12-48 MHz (DFLL) clock
Definition: periph_cpu.h:67
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition: periph_cpu.h:35

Definition at line 91 of file periph_conf.h.