28 #include "periph_cpu.h"
66 #define CLOCK_USE_PLL (1)
67 #define CLOCK_USE_XOSC32_DFLL (0)
75 #define GEN2_ULP32K (0)
79 #define CLOCK_PLL_MUL (47U)
80 #define CLOCK_PLL_DIV (1U)
82 #define CLOCK_CORECLOCK (((CLOCK_PLL_MUL + 1) * 1000000U) / CLOCK_PLL_DIV)
83 #elif CLOCK_USE_XOSC32_DFLL
85 #define CLOCK_CORECLOCK (48000000U)
86 #define CLOCK_XOSC32K (32768UL)
87 #define CLOCK_8MHZ (1)
90 #define CLOCK_DIV (1U)
92 #define CLOCK_CORECLOCK (8000000 / CLOCK_DIV)
104 .pm_mask = PM_APBCMASK_TC3,
105 .gclk_ctrl = GCLK_CLKCTRL_ID_TCC2_TC3,
106 #if CLOCK_USE_PLL || CLOCK_USE_XOSC32_DFLL
111 .flags = TC_CTRLA_MODE_COUNT16,
116 .pm_mask = PM_APBCMASK_TC4 | PM_APBCMASK_TC5,
117 .gclk_ctrl = GCLK_CLKCTRL_ID_TC4_TC5,
118 #if CLOCK_USE_PLL || CLOCK_USE_XOSC32_DFLL
123 .flags = TC_CTRLA_MODE_COUNT32,
127 #define TIMER_0_MAX_VALUE 0xffff
130 #define TIMER_0_ISR isr_tc3
131 #define TIMER_1_ISR isr_tc4
133 #define TIMER_NUMOF ARRAY_SIZE(timer_config)
142 .
dev = &SERCOM3->USART,
145 #ifdef MODULE_PERIPH_UART_HW_FC
156 .dev = &SERCOM4->USART,
159 #ifdef MODULE_PERIPH_UART_HW_FC
170 .dev = &SERCOM4->USART,
173 #ifdef MODULE_PERIPH_UART_HW_FC
186 #define UART_0_ISR isr_sercom3
187 #define UART_1_ISR isr_sercom4
188 #define UART_2_ISR isr_sercom5
190 #define UART_NUMOF ARRAY_SIZE(uart_config)
240 #define PWM_NUMOF ARRAY_SIZE(pwm_config)
249 .
dev = &SERCOM0->SPI,
259 #ifdef MODULE_PERIPH_DMA
260 .tx_trigger = SERCOM0_DMAC_ID_TX,
261 .rx_trigger = SERCOM0_DMAC_ID_RX,
265 .dev = &SERCOM1->SPI,
275 #ifdef MODULE_PERIPH_DMA
276 .tx_trigger = SERCOM1_DMAC_ID_TX,
277 .rx_trigger = SERCOM1_DMAC_ID_RX,
281 .dev = &SERCOM5->SPI,
291 #ifdef MODULE_PERIPH_DMA
292 .tx_trigger = SERCOM5_DMAC_ID_TX,
293 .rx_trigger = SERCOM5_DMAC_ID_RX,
298 #define SPI_NUMOF ARRAY_SIZE(spi_config)
307 .
dev = &(SERCOM2->I2CM),
316 #define I2C_NUMOF ARRAY_SIZE(i2c_config)
323 #ifndef RTT_FREQUENCY
324 #define RTT_FREQUENCY (32768U)
334 #define ADC_PRESCALER ADC_CTRLB_PRESCALER_DIV512
336 #define ADC_NEG_INPUT ADC_INPUTCTRL_MUXNEG_GND
337 #define ADC_GAIN_FACTOR_DEFAULT ADC_INPUTCTRL_GAIN_1X
338 #define ADC_REF_DEFAULT ADC_REFCTRL_REFSEL_INT1V
344 {
GPIO_PIN(
PA, 10), ADC_INPUTCTRL_MUXPOS_PIN18},
345 {
GPIO_PIN(
PA, 11), ADC_INPUTCTRL_MUXPOS_PIN19},
352 #define ADC_NUMOF ARRAY_SIZE(adc_channels)
359 #define DAC_CLOCK SAM0_GCLK_1MHZ
361 #define DAC_VREF DAC_CTRLB_REFSEL_AVCC