19 #include "periph_cpu.h" 
   28 #define CLOCK_CORECLOCK     (16000000U) 
   34 #define USE_VREG_BUCK       (1) 
   44         .mclk           = &MCLK->APBCMASK.reg,
 
   45         .mclk_mask      = MCLK_APBCMASK_TC0_Msk | MCLK_APBCMASK_TC1_Msk,
 
   46         .gclk_id        = TC0_GCLK_ID,
 
   48         .flags          = TC_CTRLA_MODE_COUNT32,
 
   53         .mclk           = &MCLK->APBCMASK.reg,
 
   54         .mclk_mask      = MCLK_APBCMASK_TC2_Msk,
 
   55         .gclk_id        = TC2_GCLK_ID,
 
   57         .flags          = TC_CTRLA_MODE_COUNT16,
 
   62 #define TIMER_0_CHANNELS    2 
   63 #define TIMER_0_ISR         isr_tc0 
   66 #define TIMER_1_CHANNELS    2 
   67 #define TIMER_1_ISR         isr_tc2 
   68 #define TIMER_1_MAX_VALUE   0xffff 
   70 #define TIMER_NUMOF         ARRAY_SIZE(timer_config) 
   79         .
dev      = &SERCOM2->USART,
 
   82 #ifdef MODULE_PERIPH_UART_HW_FC 
   95         .dev      = &SERCOM1->USART,
 
   98 #ifdef MODULE_PERIPH_UART_HW_FC 
  111 #define UART_0_ISR          isr_sercom2_2 
  112 #define UART_0_ISR_TX       isr_sercom2_0 
  113 #define UART_1_ISR          isr_sercom1_2 
  114 #define UART_1_ISR_TX       isr_sercom1_0 
  116 #define UART_NUMOF          ARRAY_SIZE(uart_config) 
  146       .chan = pwm_chan0_config,
 
  154       .chan = pwm_chan1_config,
 
  162 #define PWM_NUMOF           ARRAY_SIZE(pwm_config) 
  171         .
dev      = &(SERCOM0->SPI),
 
  181 #ifdef MODULE_PERIPH_DMA 
  182         .tx_trigger = SERCOM0_DMAC_ID_TX,
 
  183         .rx_trigger = SERCOM0_DMAC_ID_RX,
 
  188 #define SPI_NUMOF           ARRAY_SIZE(spi_config) 
  197         .
dev      = &(SERCOM1->I2CM),
 
  207 #define I2C_NUMOF           ARRAY_SIZE(i2c_config) 
  214 #define EXTERNAL_OSC32_SOURCE                    1 
  215 #define ULTRA_LOW_POWER_INTERNAL_OSC_SOURCE      0 
  222 #ifndef RTT_FREQUENCY 
  223 #define RTT_FREQUENCY       (32768U) 
  233 #define ADC_PRESCALER                       ADC_CTRLB_PRESCALER_DIV256 
  235 #define ADC_NEG_INPUT                       ADC_INPUTCTRL_MUXNEG(0x18u) 
  236 #define ADC_REF_DEFAULT                     ADC_REFCTRL_REFSEL_INTVCC2 
  243 #define ADC_NUMOF                           ARRAY_SIZE(adc_channels) 
  250 #define DAC_CLOCK           SAM0_GCLK_32KHZ 
  252 #define DAC_VREF            DAC_CTRLB_REFSEL_AVCC 
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
 
#define GPIO_UNDEF
Definition of a fitting UNDEF value.
 
static const uart_conf_t uart_config[]
UART configuration.
 
static const spi_conf_t spi_config[]
SPI configuration.
 
static const i2c_conf_t i2c_config[]
I2C configuration.
 
static const timer_conf_t timer_config[]
All timers on board.
 
static const pwm_conf_t pwm_config[]
Actual PWM configuration.
 
#define ARRAY_SIZE(a)
Calculate the number of elements in a static array.
 
static const gpio_t adc_channels[]
Static array with declared ADC channels.
 
@ I2C_SPEED_NORMAL
normal mode: ~100 kbit/s
 
@ UART_PAD_RX_1
select pad 1
 
@ UART_PAD_RX_3
select pad 3
 
@ I2C_FLAG_NONE
No flags set.
 
#define TC_CONFIG(tim)
Static initializer for TC timer configuration.
 
@ SPI_PAD_MISO_0
use pad 0 for MISO line
 
@ UART_FLAG_NONE
No flags set.
 
@ UART_PAD_TX_0
select pad 0
 
@ UART_PAD_TX_2
select pad 2
 
@ GPIO_MUX_E
select peripheral function E
 
@ GPIO_MUX_D
select peripheral function D
 
@ GPIO_MUX_C
select peripheral function C
 
@ SPI_PAD_MOSI_2_SCK_3
use pad 2 for MOSI, pad 3 for SCK
 
#define ADC_INPUTCTRL_MUXPOS_PA10
Alias for PIN18.
 
#define SAM0_GCLK_MAIN
120 MHz main clock
 
ADC Channel Configuration.
 
I2C configuration structure.
 
TWI_t * dev
Pointer to hardware module registers.
 
PWM channel configuration data structure.
 
PWM device configuration.
 
tc_tcc_cfg_t tim
timer configuration
 
SPI device configuration.
 
SPI_t * dev
pointer to the used SPI device
 
Timer device configuration.
 
TC0_t * dev
Pointer to the used as Timer device.
 
UART device configuration.
 
USART_t * dev
pointer to the used UART device