25 #include "periph_cpu.h"
62 #define CLOCK_USE_PLL (1)
66 #define CLOCK_PLL_MUL (47U)
67 #define CLOCK_PLL_DIV (1U)
68 #define CLOCK_CORECLOCK (((CLOCK_PLL_MUL + 1) * 1000000U) / CLOCK_PLL_DIV)
71 #define CLOCK_DIV (1U)
73 #define CLOCK_CORECLOCK (8000000 / CLOCK_DIV)
85 .pm_mask = PM_APBCMASK_TC3,
86 .gclk_ctrl = GCLK_CLKCTRL_ID_TCC2_TC3,
87 #if CLOCK_USE_PLL || CLOCK_USE_XOSC32_DFLL
92 .flags = TC_CTRLA_MODE_COUNT16,
97 .pm_mask = PM_APBCMASK_TC4 | PM_APBCMASK_TC5,
98 .gclk_ctrl = GCLK_CLKCTRL_ID_TC4_TC5,
99 #if CLOCK_USE_PLL || CLOCK_USE_XOSC32_DFLL
104 .flags = TC_CTRLA_MODE_COUNT32,
108 #define TIMER_0_MAX_VALUE 0xffff
111 #define TIMER_0_ISR isr_tc3
112 #define TIMER_1_ISR isr_tc4
114 #define TIMER_NUMOF ARRAY_SIZE(timer_config)
123 .
dev = &SERCOM2->USART,
133 .dev = &SERCOM0->USART,
145 #define UART_0_ISR isr_sercom2
146 #define UART_1_ISR isr_sercom0
148 #define UART_NUMOF ARRAY_SIZE(uart_config)
189 #define PWM_NUMOF ARRAY_SIZE(pwm_config)
198 .
dev = &SERCOM1->SPI,
208 #ifdef MODULE_PERIPH_DMA
209 .tx_trigger = SERCOM1_DMAC_ID_TX,
210 .rx_trigger = SERCOM1_DMAC_ID_RX,
214 .dev = &SERCOM0->SPI,
224 #ifdef MODULE_PERIPH_DMA
225 .tx_trigger = SERCOM0_DMAC_ID_TX,
226 .rx_trigger = SERCOM0_DMAC_ID_RX,
231 #define SPI_NUMOF ARRAY_SIZE(spi_config)
240 .
dev = &(SERCOM2->I2CM),
249 #define I2C_NUMOF ARRAY_SIZE(i2c_config)
256 #ifndef RTT_FREQUENCY
257 #define RTT_FREQUENCY (32768U)
265 #define ADC_PRESCALER ADC_CTRLB_PRESCALER_DIV512
267 #define ADC_NEG_INPUT ADC_INPUTCTRL_MUXNEG_GND
268 #define ADC_GAIN_FACTOR_DEFAULT ADC_INPUTCTRL_GAIN_1X
269 #define ADC_REF_DEFAULT ADC_REFCTRL_REFSEL_INT1V
277 {
GPIO_PIN(
PA, 8), ADC_INPUTCTRL_MUXPOS_PIN16},
278 {
GPIO_PIN(
PA, 9), ADC_INPUTCTRL_MUXPOS_PIN17},
281 #define ADC_NUMOF ARRAY_SIZE(adc_channels)
294 .device = &USB->DEVICE,