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

Peripheral MCU configuration for the bastwan board. More...

Detailed Description

Peripheral MCU configuration for the bastwan board.

Author
Lokotius Filzer h-fil.nosp@m.zer@.nosp@m.pixel.nosp@m.sala.nosp@m.t.de

Definition in file periph_conf.h.

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

Go to the source code of this file.

#define CLOCK_CORECLOCK   MHZ(48)
 GCLK reference speed.
 
#define USE_VREG_BUCK   (1)
 Enable the internal DC/DC converter The board is equipped with the necessary inductor.
 

Timer peripheral configuration

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

usart configuration

#define UART_0_ISR   isr_sercom3
 
#define UART_NUMOF   ARRAY_SIZE(uart_config)
 
static const uart_conf_t uart_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 []
 

RTC configuration

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

RTT configuration

#define RTT_FREQUENCY   (32768U)
 

ADC Configuration

#define ADC_PRESCALER   ADC_CTRLB_PRESCALER_DIV256
 
#define ADC_NEG_INPUT   ADC_INPUTCTRL_MUXNEG(0x18u)
 
#define ADC_REF_DEFAULT   ADC_REFCTRL_REFSEL_INTVCC2
 
#define ADC_NUMOF   ARRAY_SIZE(adc_channels)
 
static const adc_conf_chan_t adc_channels []
 

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 174 of file periph_conf.h.

◆ ADC_NUMOF

#define ADC_NUMOF   ARRAY_SIZE(adc_channels)

Definition at line 186 of file periph_conf.h.

◆ ADC_PRESCALER

#define ADC_PRESCALER   ADC_CTRLB_PRESCALER_DIV256

Definition at line 172 of file periph_conf.h.

◆ ADC_REF_DEFAULT

#define ADC_REF_DEFAULT   ADC_REFCTRL_REFSEL_INTVCC2

Definition at line 175 of file periph_conf.h.

◆ CLOCK_CORECLOCK

#define CLOCK_CORECLOCK   MHZ(48)

GCLK reference speed.

Definition at line 32 of file periph_conf.h.

◆ EXTERNAL_OSC32_SOURCE

#define EXTERNAL_OSC32_SOURCE   1

Definition at line 152 of file periph_conf.h.

◆ I2C_NUMOF

#define I2C_NUMOF   ARRAY_SIZE(i2c_config)

Definition at line 146 of file periph_conf.h.

◆ INTERNAL_OSC32_SOURCE

#define INTERNAL_OSC32_SOURCE   0

Definition at line 153 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 128 of file periph_conf.h.

◆ TIMER_0_CHANNELS

#define TIMER_0_CHANNELS   2

Definition at line 57 of file periph_conf.h.

◆ TIMER_0_ISR

#define TIMER_0_ISR   isr_tc0

Definition at line 58 of file periph_conf.h.

◆ TIMER_NUMOF

#define TIMER_NUMOF   ARRAY_SIZE(timer_config)

Definition at line 59 of file periph_conf.h.

◆ UART_0_ISR

#define UART_0_ISR   isr_sercom3

Definition at line 84 of file periph_conf.h.

◆ UART_NUMOF

#define UART_NUMOF   ARRAY_SIZE(uart_config)

Definition at line 85 of file periph_conf.h.

◆ ULTRA_LOW_POWER_INTERNAL_OSC_SOURCE

#define ULTRA_LOW_POWER_INTERNAL_OSC_SOURCE   0

Definition at line 154 of file periph_conf.h.

◆ USE_VREG_BUCK

#define USE_VREG_BUCK   (1)

Enable the internal DC/DC converter The board is equipped with the necessary inductor.

Definition at line 38 of file periph_conf.h.

Variable Documentation

◆ adc_channels

const adc_conf_chan_t adc_channels[]
static
Initial value:
= {
{ .inputctrl = ADC_INPUTCTRL_MUXPOS_PA09 },
{ .inputctrl = ADC_INPUTCTRL_MUXPOS_PA08 },
{ .inputctrl = ADC_INPUTCTRL_MUXPOS_PA07 },
{ .inputctrl = ADC_INPUTCTRL_MUXPOS_PA06 },
{ .inputctrl = ADC_INPUTCTRL_MUXPOS_PA04 }
}
#define ADC_INPUTCTRL_MUXPOS_PA08
Alias for PIN16.
Definition periph_cpu.h:135
#define ADC_INPUTCTRL_MUXPOS_PA09
Alias for PIN17.
Definition periph_cpu.h:136
#define ADC_INPUTCTRL_MUXPOS_PA07
Alias for PIN7.
Definition periph_cpu.h:126
#define ADC_INPUTCTRL_MUXPOS_PA04
Alias for PIN4.
Definition periph_cpu.h:123
#define ADC_INPUTCTRL_MUXPOS_PA06
Alias for PIN6.
Definition periph_cpu.h:125

Definition at line 177 of file periph_conf.h.

◆ i2c_config

const i2c_conf_t i2c_config[]
static
Initial value:
= {
{
.dev = &(SERCOM1->I2CM),
.speed = I2C_SPEED_NORMAL,
.scl_pin = GPIO_PIN(PA, 17),
.sda_pin = GPIO_PIN(PA, 16),
.mux = GPIO_MUX_C,
.gclk_src = SAM0_GCLK_MAIN,
.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
@ PA
port A
@ I2C_FLAG_NONE
No flags set.
@ GPIO_MUX_C
select peripheral function C
#define SAM0_GCLK_MAIN
120 MHz main clock
Definition periph_cpu.h:74

Definition at line 135 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_G,
.device = &USB->DEVICE,
.gclk_src = SAM0_GCLK_48MHZ,
}
}
@ GPIO_MUX_G
select peripheral function G

Definition at line 193 of file periph_conf.h.

◆ spi_config

const spi_conf_t spi_config[]
static

Definition at line 93 of file periph_conf.h.

◆ timer_config

const tc32_conf_t timer_config[]
static
Initial value:
= {
{
.dev = TC0,
.irq = TC0_IRQn,
.mclk = &MCLK->APBCMASK.reg,
.mclk_mask = MCLK_APBCMASK_TC0_Msk | MCLK_APBCMASK_TC1_Msk,
.gclk_id = TC0_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 44 of file periph_conf.h.

◆ uart_config

const uart_conf_t uart_config[]
static
Initial value:
= {
{
.dev = &SERCOM3->USART,
.rx_pin = GPIO_PIN(PA, 18),
.tx_pin = GPIO_PIN(PA, 19),
.mux = GPIO_MUX_D,
.rx_pad = UART_PAD_RX_3,
.tx_pad = UART_PAD_TX_2,
.flags = UART_FLAG_NONE,
.gclk_src = SAM0_GCLK_MAIN,
}
}
@ UART_PAD_RX_3
select pad 3
@ UART_FLAG_NONE
No flags set.
@ UART_PAD_TX_2
select pad 2
@ GPIO_MUX_D
select peripheral function D

Definition at line 66 of file periph_conf.h.