26#include "periph_cpu_common.h"
36#define SAM0_DFLL_FREQ_HZ MHZ(48)
41#define SAM0_XOSC_FREQ_HZ (XOSC0_FREQUENCY ? XOSC0_FREQUENCY : XOSC1_FREQUENCY)
46#define SAM0_DPLL_FREQ_MIN_HZ MHZ(96)
51#define SAM0_DPLL_FREQ_MAX_HZ MHZ(200)
57#define PM_NUM_MODES (4)
64 SAM0_PM_HIBERNATE = 1,
74#define SAM0_GCLK_MAIN 0
75#ifndef SAM0_GCLK_32KHZ
76#define SAM0_GCLK_32KHZ 1
78#ifndef SAM0_GCLK_TIMER
79#define SAM0_GCLK_TIMER 2
81#ifndef SAM0_GCLK_PERIPH
82#define SAM0_GCLK_PERIPH 3
84#ifndef SAM0_GCLK_100MHZ
85#define SAM0_GCLK_100MHZ 4
93#define SAM0_GCLK_8MHZ SAM0_GCLK_TIMER
94#define SAM0_GCLK_48MHZ SAM0_GCLK_PERIPH
102#define SPI_HWCS(x) (UINT_MAX - 1)
126#define ADC0_INPUTCTRL_MUXPOS_PA02 ADC_INPUTCTRL_MUXPOS_AIN0
127#define ADC0_INPUTCTRL_MUXPOS_PA03 ADC_INPUTCTRL_MUXPOS_AIN1
128#define ADC0_INPUTCTRL_MUXPOS_PB08 ADC_INPUTCTRL_MUXPOS_AIN2
129#define ADC0_INPUTCTRL_MUXPOS_PB09 ADC_INPUTCTRL_MUXPOS_AIN3
130#define ADC0_INPUTCTRL_MUXPOS_PA04 ADC_INPUTCTRL_MUXPOS_AIN4
131#define ADC0_INPUTCTRL_MUXPOS_PA05 ADC_INPUTCTRL_MUXPOS_AIN5
132#define ADC0_INPUTCTRL_MUXPOS_PA06 ADC_INPUTCTRL_MUXPOS_AIN6
133#define ADC0_INPUTCTRL_MUXPOS_PA07 ADC_INPUTCTRL_MUXPOS_AIN7
134#define ADC0_INPUTCTRL_MUXPOS_PA08 ADC_INPUTCTRL_MUXPOS_AIN8
135#define ADC0_INPUTCTRL_MUXPOS_PA09 ADC_INPUTCTRL_MUXPOS_AIN9
136#define ADC0_INPUTCTRL_MUXPOS_PA10 ADC_INPUTCTRL_MUXPOS_AIN10
137#define ADC0_INPUTCTRL_MUXPOS_PA11 ADC_INPUTCTRL_MUXPOS_AIN11
138#define ADC0_INPUTCTRL_MUXPOS_PB00 ADC_INPUTCTRL_MUXPOS_AIN12
139#define ADC0_INPUTCTRL_MUXPOS_PB01 ADC_INPUTCTRL_MUXPOS_AIN13
140#define ADC0_INPUTCTRL_MUXPOS_PB02 ADC_INPUTCTRL_MUXPOS_AIN14
141#define ADC0_INPUTCTRL_MUXPOS_PB03 ADC_INPUTCTRL_MUXPOS_AIN15
143#define ADC1_INPUTCTRL_MUXPOS_PB08 ADC_INPUTCTRL_MUXPOS_AIN0
144#define ADC1_INPUTCTRL_MUXPOS_PB09 ADC_INPUTCTRL_MUXPOS_AIN1
145#define ADC1_INPUTCTRL_MUXPOS_PA08 ADC_INPUTCTRL_MUXPOS_AIN2
146#define ADC1_INPUTCTRL_MUXPOS_PA09 ADC_INPUTCTRL_MUXPOS_AIN3
147#define ADC1_INPUTCTRL_MUXPOS_PC02 ADC_INPUTCTRL_MUXPOS_AIN4
148#define ADC1_INPUTCTRL_MUXPOS_PC03 ADC_INPUTCTRL_MUXPOS_AIN5
149#define ADC1_INPUTCTRL_MUXPOS_PB04 ADC_INPUTCTRL_MUXPOS_AIN6
150#define ADC1_INPUTCTRL_MUXPOS_PB05 ADC_INPUTCTRL_MUXPOS_AIN7
151#define ADC1_INPUTCTRL_MUXPOS_PB06 ADC_INPUTCTRL_MUXPOS_AIN8
152#define ADC1_INPUTCTRL_MUXPOS_PB07 ADC_INPUTCTRL_MUXPOS_AIN9
153#define ADC1_INPUTCTRL_MUXPOS_PC00 ADC_INPUTCTRL_MUXPOS_AIN10
154#define ADC1_INPUTCTRL_MUXPOS_PC01 ADC_INPUTCTRL_MUXPOS_AIN11
155#define ADC1_INPUTCTRL_MUXPOS_PC30 ADC_INPUTCTRL_MUXPOS_AIN12
156#define ADC1_INPUTCTRL_MUXPOS_PC31 ADC_INPUTCTRL_MUXPOS_AIN13
157#define ADC1_INPUTCTRL_MUXPOS_PD00 ADC_INPUTCTRL_MUXPOS_AIN14
158#define ADC1_INPUTCTRL_MUXPOS_PD01 ADC_INPUTCTRL_MUXPOS_AIN15
160#define ADC0_INPUTCTRL_MUXNEG_PA02 ADC_INPUTCTRL_MUXPOS_AIN0
161#define ADC0_INPUTCTRL_MUXNEG_PA03 ADC_INPUTCTRL_MUXPOS_AIN1
162#define ADC0_INPUTCTRL_MUXNEG_PB08 ADC_INPUTCTRL_MUXPOS_AIN2
163#define ADC0_INPUTCTRL_MUXNEG_PB09 ADC_INPUTCTRL_MUXPOS_AIN3
164#define ADC0_INPUTCTRL_MUXNEG_PA04 ADC_INPUTCTRL_MUXPOS_AIN4
165#define ADC0_INPUTCTRL_MUXNEG_PA05 ADC_INPUTCTRL_MUXPOS_AIN5
166#define ADC0_INPUTCTRL_MUXNEG_PA06 ADC_INPUTCTRL_MUXPOS_AIN6
167#define ADC0_INPUTCTRL_MUXNEG_PA07 ADC_INPUTCTRL_MUXPOS_AIN7
169#define ADC1_INPUTCTRL_MUXNEG_PB08 ADC_INPUTCTRL_MUXPOS_AIN0
170#define ADC1_INPUTCTRL_MUXNEG_PB09 ADC_INPUTCTRL_MUXPOS_AIN1
171#define ADC1_INPUTCTRL_MUXNEG_PA08 ADC_INPUTCTRL_MUXPOS_AIN2
172#define ADC1_INPUTCTRL_MUXNEG_PA09 ADC_INPUTCTRL_MUXPOS_AIN3
173#define ADC1_INPUTCTRL_MUXNEG_PC02 ADC_INPUTCTRL_MUXPOS_AIN4
174#define ADC1_INPUTCTRL_MUXNEG_PC03 ADC_INPUTCTRL_MUXPOS_AIN5
175#define ADC1_INPUTCTRL_MUXNEG_PB04 ADC_INPUTCTRL_MUXPOS_AIN6
176#define ADC1_INPUTCTRL_MUXNEG_PB05 ADC_INPUTCTRL_MUXPOS_AIN7
182#define DAC_RES_BITS (12)
193#define RTT_MAX_VALUE (0xffffffff)
194#define RTT_CLOCK_FREQUENCY (32768U)
195#define RTT_MIN_FREQUENCY (RTT_CLOCK_FREQUENCY / 1024U)
196#define RTT_MAX_FREQUENCY (RTT_CLOCK_FREQUENCY)
227 4, 5, 0, 1, 2, 3, 1, 0, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1
269#define SAM0_QSPI_PIN_CLK GPIO_PIN(PB, 10)
270#define SAM0_QSPI_PIN_CS GPIO_PIN(PB, 11)
271#define SAM0_QSPI_PIN_DATA_0 GPIO_PIN(PA, 8)
272#define SAM0_QSPI_PIN_DATA_1 GPIO_PIN(PA, 9)
273#define SAM0_QSPI_PIN_DATA_2 GPIO_PIN(PA, 10)
274#define SAM0_QSPI_PIN_DATA_3 GPIO_PIN(PA, 11)
275#define SAM0_QSPI_MUX GPIO_MUX_H
282#define SAM0_SDHC_MUX GPIO_MUX_I
284#define SAM0_SDHC0_PIN_SDCMD GPIO_PIN(PA, 8)
285#define SAM0_SDHC0_PIN_SDDAT0 GPIO_PIN(PA, 9)
286#define SAM0_SDHC0_PIN_SDDAT1 GPIO_PIN(PA, 10)
287#define SAM0_SDHC0_PIN_SDDAT2 GPIO_PIN(PA, 11)
288#define SAM0_SDHC0_PIN_SDDAT3 GPIO_PIN(PB, 10)
289#define SAM0_SDHC0_PIN_SDCK GPIO_PIN(PB, 11)
291#define SAM0_SDHC1_PIN_SDCMD GPIO_PIN(PA, 20)
292#define SAM0_SDHC1_PIN_SDDAT0 GPIO_PIN(PB, 18)
293#define SAM0_SDHC1_PIN_SDDAT1 GPIO_PIN(PB, 19)
294#define SAM0_SDHC1_PIN_SDDAT2 GPIO_PIN(PB, 20)
295#define SAM0_SDHC1_PIN_SDDAT3 GPIO_PIN(PB, 21)
296#define SAM0_SDHC1_PIN_SDCK GPIO_PIN(PA, 21)
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
CPU specific definitions for CAN controllers.
static const gpio_t sam0_adc_pins[1][20]
Pins that can be used for ADC input.
static const uint8_t gclk_io_ids[]
GCLK IDs of pins that have peripheral function GCLK - This maps directly to gclk_io_pins.
static const gpio_t rtc_tamper_pins[RTC_NUM_OF_TAMPERS]
RTC input pins that can be used for tamper detection and wake from Deep Sleep.
static const gpio_t gclk_io_pins[]
Pins that have peripheral function GCLK.
NVM User Row Mapping - Dedicated Entries Config values will be applied at power-on.
uint32_t reserved_3
Factory settings - do not change.
uint32_t wdt_enable
WDT Enable at power-on.
uint32_t nvm_locks
NVM Region Lock Bits.
uint32_t smart_eeprom_page_size
SmartEEPROM Page Size
uint32_t user_page
User page
uint32_t smart_eeprom_blocks
NVM Blocks per SmartEEPROM sector
uint32_t reserved_0
Factory settings - do not change.
uint32_t bod33_level
BOD33 threshold level at power-on.
uint32_t wdt_window_enable
WDT Window mode enabled on power-on
uint32_t wdt_period
WDT Period at power-on.
uint32_t bod33_disable
BOD33 Disable at power-on.
uint32_t wdt_ewoffset
WDT Early Warning Interrupt Offset
uint32_t ram_eccdis
RAM ECC Disable
uint32_t reserved_1
Factory settings - do not change.
uint32_t user_pages[3]
User pages
uint32_t bod33_hysteresis
BOD33 Hysteresis configuration
uint32_t reserved_2
Factory settings - do not change.
const uint32_t bod12_calibration
Factory settings - do not change.
uint32_t bod33_action
BOD33 Action at power-on.
uint32_t nvm_boot_size
NVM Bootloader Size
uint32_t wdt_always_on
WDT Always-On at power-on.
uint32_t wdt_window
WDT Window at power-on.