30 #include "periph_cpu.h"
68 #define CLOCK_USE_PLL (1)
72 #define CLOCK_PLL_MUL (47U)
73 #define CLOCK_PLL_DIV (1U)
75 #define CLOCK_CORECLOCK (((CLOCK_PLL_MUL + 1) * 1000000U) / CLOCK_PLL_DIV)
76 #elif CLOCK_USE_XOSC32_DFLL
78 #define CLOCK_CORECLOCK (48000000U)
79 #define CLOCK_XOSC32K (32768UL)
80 #define CLOCK_8MHZ (1)
81 #define GEN2_ULP32K (1)
84 #define CLOCK_DIV (1U)
86 #define CLOCK_CORECLOCK (8000000 / CLOCK_DIV)
95 #define RTT_FREQUENCY (32768U)
107 .pm_mask = PM_APBCMASK_TC3,
108 .gclk_ctrl = GCLK_CLKCTRL_ID_TCC2_TC3,
109 #if CLOCK_USE_PLL || CLOCK_USE_XOSC32_DFLL
114 .flags = TC_CTRLA_MODE_COUNT16,
119 .pm_mask = PM_APBCMASK_TC4 | PM_APBCMASK_TC5,
120 .gclk_ctrl = GCLK_CLKCTRL_ID_TC4_TC5,
121 #if CLOCK_USE_PLL || CLOCK_USE_XOSC32_DFLL
126 .flags = TC_CTRLA_MODE_COUNT32,
130 #define TIMER_0_MAX_VALUE 0xffff
133 #define TIMER_0_ISR isr_tc3
134 #define TIMER_1_ISR isr_tc4
136 #define TIMER_NUMOF ARRAY_SIZE(timer_config)
145 #define ADC_PRESCALER ADC_CTRLB_PRESCALER_DIV512
147 #define ADC_NEG_INPUT ADC_INPUTCTRL_MUXNEG_GND
148 #define ADC_GAIN_FACTOR_DEFAULT ADC_INPUTCTRL_GAIN_1X
149 #define ADC_REF_DEFAULT ADC_REFCTRL_REFSEL_INT1V
158 #define ADC_NUMOF ARRAY_SIZE(adc_channels)
196 #define PWM_NUMOF ARRAY_SIZE(pwm_config)
205 .
dev = &SERCOM4->SPI,
215 #ifdef MODULE_PERIPH_DMA
216 .tx_trigger = SERCOM4_DMAC_ID_TX,
217 .rx_trigger = SERCOM4_DMAC_ID_RX,
222 #define SPI_NUMOF ARRAY_SIZE(spi_config)
231 .
dev = &(SERCOM3->I2CM),
240 #define I2C_NUMOF ARRAY_SIZE(i2c_config)
247 #define RANDOM_NUMOF (0U)
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
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_FAST
fast mode: ~400 kbit/s
@ I2C_FLAG_NONE
No flags set.
@ SPI_PAD_MISO_0
use pad 0 for MISO line
#define TCC_CONFIG(tim)
Static initializer for TCC timer configuration.
@ GPIO_MUX_E
select peripheral function E
@ GPIO_MUX_D
select peripheral function D
@ GPIO_MUX_F
select peripheral function F
@ SPI_PAD_MOSI_2_SCK_3
use pad 2 for MOSI, pad 3 for SCK
@ SAM0_GCLK_1MHZ
1 MHz clock for xTimer
#define ADC_INPUTCTRL_MUXPOS_PA08
Alias for PIN16.
#define ADC_INPUTCTRL_MUXPOS_PA07
Alias for PIN7.
#define ADC_INPUTCTRL_MUXPOS_PA06
Alias for PIN6.
#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.
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.