25 #ifndef PERIPH_CONF_COMMON_H
26 #define PERIPH_CONF_COMMON_H
28 #include "periph_cpu.h"
66 #define CLOCK_USE_PLL (1)
70 #define CLOCK_PLL_MUL (47U)
71 #define CLOCK_PLL_DIV (1U)
73 #define CLOCK_CORECLOCK (((CLOCK_PLL_MUL + 1) * 1000000U) / CLOCK_PLL_DIV)
76 #define CLOCK_DIV (1U)
78 #define CLOCK_CORECLOCK (8000000 / CLOCK_DIV)
90 .pm_mask = PM_APBCMASK_TC3,
91 .gclk_ctrl = GCLK_CLKCTRL_ID_TCC2_TC3,
92 #if CLOCK_USE_PLL || CLOCK_USE_XOSC32_DFLL
97 .flags = TC_CTRLA_MODE_COUNT16,
102 .pm_mask = PM_APBCMASK_TC4 | PM_APBCMASK_TC5,
103 .gclk_ctrl = GCLK_CLKCTRL_ID_TC4_TC5,
104 #if CLOCK_USE_PLL || CLOCK_USE_XOSC32_DFLL
109 .flags = TC_CTRLA_MODE_COUNT32,
113 #define TIMER_0_MAX_VALUE 0xffff
116 #define TIMER_0_ISR isr_tc3
117 #define TIMER_1_ISR isr_tc4
119 #define TIMER_NUMOF ARRAY_SIZE(timer_config)
145 #define PWM_NUMOF ARRAY_SIZE(pwm_config)
154 #define ADC_PRESCALER ADC_CTRLB_PRESCALER_DIV512
156 #define ADC_NEG_INPUT ADC_INPUTCTRL_MUXNEG_GND
157 #define ADC_GAIN_FACTOR_DEFAULT ADC_INPUTCTRL_GAIN_1X
158 #define ADC_REF_DEFAULT ADC_REFCTRL_REFSEL_INT1V
163 {
GPIO_PIN(
PB, 2), ADC_INPUTCTRL_MUXPOS_PIN10},
164 {
GPIO_PIN(
PB, 3), ADC_INPUTCTRL_MUXPOS_PIN11},
171 #define ADC_NUMOF ARRAY_SIZE(adc_channels)
180 .
dev = &(SERCOM0->I2CM),
189 #define I2C_NUMOF ARRAY_SIZE(i2c_config)
196 #ifndef RTT_FREQUENCY
197 #define RTT_FREQUENCY (32768U)
210 .device = &USB->DEVICE,