Loading...
Searching...
No Matches
periph_conf.h File Reference

Configuration of CPU peripherals for the Adafruit Grand Central M4 Express. More...

Detailed Description

Configuration of CPU peripherals for the Adafruit Grand Central M4 Express.

Author
Benjamin Valentin benja.nosp@m.min..nosp@m.valen.nosp@m.tin@.nosp@m.ml-pa.nosp@m..com
Gunar Schorcht gunar.nosp@m.@sch.nosp@m.orcht.nosp@m..net

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 L_EXT (L1) of 10uH at VSW pin.
 

Core clock frequency

#define CLOCK_CORECLOCK   MHZ(120)
 

32kHz Oscillator configuration

#define EXTERNAL_OSC32_SOURCE   1
 
#define INTERNAL_OSC32_SOURCE   0
 
#define ULTRA_LOW_POWER_INTERNAL_OSC_SOURCE   0
 

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_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
 

I2C configuration

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

PWM configuration

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

RTT configuration

#define RTT_FREQUENCY   (32768U)
 

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 []
 

SPI configuration

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

UART configuration

#define UART_0_ISR   isr_sercom0_2
 
#define UART_0_ISR_TX   isr_sercom0_0
 
#define UART_1_ISR   isr_sercom4_2
 
#define UART_1_ISR_TX   isr_sercom4_0
 
#define UART_2_ISR   isr_sercom1_2
 
#define UART_2_ISR_TX   isr_sercom1_0
 
#define UART_NUMOF   ARRAY_SIZE(uart_config)
 
static const uart_conf_t uart_config []
 

USB peripheral configuration

static const sam0_common_usb_config_t sam_usbdev_config []
 

Macro Definition Documentation

◆ ADC_NEG_INPUT

#define ADC_NEG_INPUT   ADC_INPUTCTRL_MUXNEG(0x18u)

Definition at line 62 of file periph_conf.h.

◆ ADC_NUMOF

#define ADC_NUMOF   ARRAY_SIZE(adc_channels)

Definition at line 85 of file periph_conf.h.

◆ ADC_PRESCALER

#define ADC_PRESCALER   ADC_CTRLA_PRESCALER_DIV128

Definition at line 60 of file periph_conf.h.

◆ ADC_REF_DEFAULT

#define ADC_REF_DEFAULT   ADC_REFCTRL_REFSEL_INTVCC1

Definition at line 63 of file periph_conf.h.

◆ CLOCK_CORECLOCK

#define CLOCK_CORECLOCK   MHZ(120)

Definition at line 35 of file periph_conf.h.

◆ DAC_CLOCK

#define DAC_CLOCK   SAM0_GCLK_TIMER

Definition at line 93 of file periph_conf.h.

◆ DAC_VREF

#define DAC_VREF   DAC_CTRLB_REFSEL_VREFPU

Definition at line 97 of file periph_conf.h.

◆ EXTERNAL_OSC32_SOURCE

#define EXTERNAL_OSC32_SOURCE   1

Definition at line 43 of file periph_conf.h.

◆ I2C_NUMOF

#define I2C_NUMOF   ARRAY_SIZE(i2c_config)

Definition at line 125 of file periph_conf.h.

◆ INTERNAL_OSC32_SOURCE

#define INTERNAL_OSC32_SOURCE   0

Definition at line 44 of file periph_conf.h.

◆ PWM_0_EN

#define PWM_0_EN   1

Definition at line 132 of file periph_conf.h.

◆ PWM_NUMOF

#define PWM_NUMOF   ARRAY_SIZE(pwm_config)

Definition at line 154 of file periph_conf.h.

◆ RTT_FREQUENCY

#define RTT_FREQUENCY   (32768U)

Definition at line 162 of file periph_conf.h.

◆ SPI_NUMOF

#define SPI_NUMOF   ARRAY_SIZE(spi_config)

Definition at line 259 of file periph_conf.h.

◆ TIMER_0_CHANNELS

#define TIMER_0_CHANNELS   2

Definition at line 192 of file periph_conf.h.

◆ TIMER_0_ISR

#define TIMER_0_ISR   isr_tc0

Definition at line 193 of file periph_conf.h.

◆ TIMER_1_CHANNELS

#define TIMER_1_CHANNELS   2

Definition at line 196 of file periph_conf.h.

◆ TIMER_1_ISR

#define TIMER_1_ISR   isr_tc2

Definition at line 197 of file periph_conf.h.

◆ TIMER_NUMOF

#define TIMER_NUMOF   ARRAY_SIZE(timer_config)

Definition at line 199 of file periph_conf.h.

◆ UART_0_ISR

#define UART_0_ISR   isr_sercom0_2

Definition at line 327 of file periph_conf.h.

◆ UART_0_ISR_TX

#define UART_0_ISR_TX   isr_sercom0_0

Definition at line 328 of file periph_conf.h.

◆ UART_1_ISR

#define UART_1_ISR   isr_sercom4_2

Definition at line 329 of file periph_conf.h.

◆ UART_1_ISR_TX

#define UART_1_ISR_TX   isr_sercom4_0

Definition at line 330 of file periph_conf.h.

◆ UART_2_ISR

#define UART_2_ISR   isr_sercom1_2

Definition at line 331 of file periph_conf.h.

◆ UART_2_ISR_TX

#define UART_2_ISR_TX   isr_sercom1_0

Definition at line 332 of file periph_conf.h.

◆ UART_NUMOF

#define UART_NUMOF   ARRAY_SIZE(uart_config)

Definition at line 334 of file periph_conf.h.

◆ ULTRA_LOW_POWER_INTERNAL_OSC_SOURCE

#define ULTRA_LOW_POWER_INTERNAL_OSC_SOURCE   0

Definition at line 45 of file periph_conf.h.

◆ USE_VREG_BUCK

#define USE_VREG_BUCK   (1)

Enable the internal DC/DC converter The board is equipped with L_EXT (L1) of 10uH at VSW pin.

Definition at line 52 of file periph_conf.h.

Variable Documentation

◆ adc_channels

const adc_conf_chan_t adc_channels[]
static
Initial value:
= {
{ .inputctrl = ADC0_INPUTCTRL_MUXPOS_PA02, .dev = ADC0 },
{ .inputctrl = ADC0_INPUTCTRL_MUXPOS_PA05, .dev = ADC0 },
{ .inputctrl = ADC0_INPUTCTRL_MUXPOS_PB03, .dev = ADC0 },
{ .inputctrl = ADC1_INPUTCTRL_MUXPOS_PC00, .dev = ADC1 },
{ .inputctrl = ADC1_INPUTCTRL_MUXPOS_PC01, .dev = ADC1 },
{ .inputctrl = ADC1_INPUTCTRL_MUXPOS_PC02, .dev = ADC1 },
{ .inputctrl = ADC1_INPUTCTRL_MUXPOS_PC03, .dev = ADC1 },
{ .inputctrl = ADC1_INPUTCTRL_MUXPOS_PB04, .dev = ADC1 },
{ .inputctrl = ADC1_INPUTCTRL_MUXPOS_PB05, .dev = ADC1 },
{ .inputctrl = ADC1_INPUTCTRL_MUXPOS_PB06, .dev = ADC1 },
{ .inputctrl = ADC1_INPUTCTRL_MUXPOS_PB07, .dev = ADC1 },
{ .inputctrl = ADC0_INPUTCTRL_MUXPOS_PB08, .dev = ADC0 },
{ .inputctrl = ADC0_INPUTCTRL_MUXPOS_PB09, .dev = ADC0 },
{ .inputctrl = ADC0_INPUTCTRL_MUXPOS_PA04, .dev = ADC0 },
{ .inputctrl = ADC0_INPUTCTRL_MUXPOS_PA06, .dev = ADC0 },
{ .inputctrl = ADC0_INPUTCTRL_MUXPOS_PA07, .dev = ADC0 },
}
#define ADC1_INPUTCTRL_MUXPOS_PC03
Alias for AIN5.
Definition periph_cpu.h:148
#define ADC0_INPUTCTRL_MUXPOS_PA04
Alias for AIN4.
Definition periph_cpu.h:130
#define ADC0_INPUTCTRL_MUXPOS_PA07
Alias for AIN7.
Definition periph_cpu.h:133
#define ADC1_INPUTCTRL_MUXPOS_PC02
Alias for AIN4.
Definition periph_cpu.h:147
#define ADC1_INPUTCTRL_MUXPOS_PB05
Alias for AIN7.
Definition periph_cpu.h:150
#define ADC1_INPUTCTRL_MUXPOS_PB04
Alias for AIN6.
Definition periph_cpu.h:149
#define ADC1_INPUTCTRL_MUXPOS_PC00
Alias for AIN10.
Definition periph_cpu.h:153
#define ADC0_INPUTCTRL_MUXPOS_PA05
Alias for AIN5.
Definition periph_cpu.h:131
#define ADC1_INPUTCTRL_MUXPOS_PC01
Alias for AIN11.
Definition periph_cpu.h:154
#define ADC0_INPUTCTRL_MUXPOS_PB03
Alias for AIN15.
Definition periph_cpu.h:141
#define ADC0_INPUTCTRL_MUXPOS_PB08
Alias for AIN2.
Definition periph_cpu.h:128
#define ADC1_INPUTCTRL_MUXPOS_PB07
Alias for AIN9.
Definition periph_cpu.h:152
#define ADC0_INPUTCTRL_MUXPOS_PB09
Alias for AIN3.
Definition periph_cpu.h:129
#define ADC0_INPUTCTRL_MUXPOS_PA06
Alias for AIN6.
Definition periph_cpu.h:132
#define ADC0_INPUTCTRL_MUXPOS_PA02
ADC pin aliases.
Definition periph_cpu.h:126
#define ADC1_INPUTCTRL_MUXPOS_PB06
Alias for AIN8.
Definition periph_cpu.h:151

Definition at line 65 of file periph_conf.h.

◆ i2c_config

const i2c_conf_t i2c_config[]
static
Initial value:
= {
{
.dev = &(SERCOM3->I2CM),
.speed = I2C_SPEED_NORMAL,
.scl_pin = GPIO_PIN(PB, 21),
.sda_pin = GPIO_PIN(PB, 20),
.mux = GPIO_MUX_C,
.gclk_src = SAM0_GCLK_PERIPH,
.flags = I2C_FLAG_NONE
},
{
.dev = &(SERCOM6->I2CM),
.speed = I2C_SPEED_NORMAL,
.scl_pin = GPIO_PIN(PC, 17),
.sda_pin = GPIO_PIN(PC, 16),
.mux = GPIO_MUX_C,
.gclk_src = SAM0_GCLK_PERIPH,
.flags = I2C_FLAG_NONE
},
}
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition periph_cpu.h:46
@ I2C_SPEED_NORMAL
normal mode: ~100 kbit/s
Definition periph_cpu.h:278
@ PB
port B
@ PC
port C
@ I2C_FLAG_NONE
No flags set.
@ GPIO_MUX_C
select peripheral function C
#define SAM0_GCLK_PERIPH
12-48 MHz (DFLL) clock
Definition periph_cpu.h:82

Definition at line 104 of file periph_conf.h.

◆ pwm_config

const pwm_conf_t pwm_config[]
static
Initial value:
= {
}

Definition at line 143 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,
}
}
@ PA
port A
@ GPIO_MUX_H
select peripheral function H

Definition at line 266 of file periph_conf.h.

◆ spi_config

const spi_conf_t spi_config[]
static

Definition at line 206 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,
}
}
#define SAM0_GCLK_TIMER
4-8 MHz clock for xTimer
Definition periph_cpu.h:79

Definition at line 170 of file periph_conf.h.

◆ uart_config

const uart_conf_t uart_config[]
static

Definition at line 281 of file periph_conf.h.