21#ifndef PERIPH_CPU_COMMON_H
22#define PERIPH_CPU_COMMON_H
25#include "exti_config.h"
26#include "timer_config.h"
35#define CPUID_LEN (16U)
41#define PERIPH_SPI_NEEDS_INIT_CS
42#define PERIPH_SPI_NEEDS_TRANSFER_BYTE
43#ifndef MODULE_PERIPH_DMA
44#define PERIPH_SPI_NEEDS_TRANSFER_REG
45#define PERIPH_SPI_NEEDS_TRANSFER_REGS
53#define PERIPH_I2C_NEED_READ_REG
54#define PERIPH_I2C_NEED_READ_REGS
55#define PERIPH_I2C_NEED_WRITE_REG
56#define PERIPH_I2C_NEED_WRITE_REGS
62#define PERIPH_I2C_MAX_BYTES_PER_FRAME 256
69typedef uint32_t gpio_t;
75#define GPIO_UNDEF (0xffffffff)
81#ifdef MODULE_PERIPH_GPIO_FAST_READ
83#define GPIO_PIN(x, y) (((gpio_t)(&PORT_IOBUS_SEC->Group[x])) | y)
85#define GPIO_PIN(x, y) (((gpio_t)(&PORT_IOBUS->Group[x])) | y)
89#define GPIO_PIN(x, y) (((gpio_t)(&PORT_SEC->Group[x])) | y)
91#define GPIO_PIN(x, y) (((gpio_t)(&PORT->Group[x])) | y)
113#define GPIO_MODE(pr, ie, pe) (pr | (ie << 1) | (pe << 2))
119#define HAVE_GPIO_MODE_T
129#define HAVE_GPIO_SLEW_T
137#define HAVE_GPIO_PULL_STRENGTH_T
145#define HAVE_GPIO_DRIVE_STRENGTH_T
153#define HAVE_GPIO_PULL_T
161#define HAVE_GPIO_STATE_T
171#define HAVE_GPIO_IRQ_TRIG_T
180#define HAVE_GPIO_CONF_T
187#define HAVE_GPIO_FLANK_T
300#define HAVE_UART_DATA_BITS_T
313#define uart_pin_rx(dev) uart_config[dev].rx_pin
314#define uart_pin_tx(dev) uart_config[dev].tx_pin
322#ifndef UART_TXBUF_SIZE
323#define UART_TXBUF_SIZE (64)
343#ifdef MODULE_PERIPH_UART_HW_FC
372 volatile uint32_t *mclk;
385#define TC_CONFIG(tim) { \
386 .dev = {.tc = tim}, \
387 .mclk = MCLK_ ## tim, \
388 .mclk_mask = MCLK_ ## tim ## _MASK, \
389 .gclk_id = tim ## _GCLK_ID, \
390 .type = TIMER_TYPE_TC, }
392#define TC_CONFIG(tim) { \
393 .dev = {.tc = tim}, \
394 .pm_mask = PM_APBCMASK_ ## tim, \
395 .gclk_id = tim ## _GCLK_ID, \
396 .type = TIMER_TYPE_TC, }
403#define TCC_CONFIG(tim) { \
404 .dev = {.tcc = tim}, \
405 .mclk = MCLK_ ## tim, \
406 .mclk_mask = MCLK_ ## tim ## _MASK, \
407 .gclk_id = tim ## _GCLK_ID, \
408 .type = TIMER_TYPE_TCC, }
410#define TCC_CONFIG(tim) { \
411 .dev = {.tcc = tim}, \
412 .pm_mask = PM_APBCMASK_ ## tim, \
413 .gclk_id = tim ## _GCLK_ID, \
414 .type = TIMER_TYPE_TCC, }
461#define HAVE_SPI_MODE_T
474#define HAVE_SPI_CLK_T
488#define spi_pin_mosi(dev) spi_config[dev].mosi_pin
489#define spi_pin_miso(dev) spi_config[dev].miso_pin
490#define spi_pin_clk(dev) spi_config[dev].clk_pin
509#ifdef MODULE_PERIPH_DMA
529#define HAVE_I2C_SPEED_T
543#define i2c_pin_sda(dev) i2c_config[dev].sda_pin
544#define i2c_pin_scl(dev) i2c_config[dev].scl_pin
578 volatile uint32_t *mclk;
592#define TIMER_CHANNEL_NUMOF (2)
637#ifdef MODULE_PERIPH_GPIO
647#ifdef MODULE_PERIPH_GPIO
684 if (src == SAM0_VREG_BUCK) {
685 SUPC->VREG.reg |= (1 << SUPC_VREG_SEL_Pos);
688 SUPC->VREG.reg &= ~(1 << SUPC_VREG_SEL_Pos);
690 while (!(SUPC->STATUS.reg & SUPC_STATUS_VREGRDY)) {}
723 if (sercom == SERCOM0) {
728 if (sercom == SERCOM1) {
733 if (sercom == SERCOM2) {
738 if (sercom == SERCOM3) {
743 if (sercom == SERCOM4) {
748 if (sercom == SERCOM5) {
753 if (sercom == SERCOM6) {
758 if (sercom == SERCOM7) {
766 return SERCOM_INST_NUM;
777#if defined(CPU_COMMON_SAMD21)
778 PM->APBCMASK.reg |= (PM_APBCMASK_SERCOM0 << id);
779#elif defined (CPU_COMMON_SAMD5X)
781 MCLK->APBAMASK.reg |= (1 << (
id + 12));
783 MCLK->APBBMASK.reg |= (1 << (
id + 7));
785 MCLK->APBDMASK.reg |= (1 << (
id - 4));
789 MCLK->APBCMASK.reg |= (MCLK_APBCMASK_SERCOM0 << id);
791#if defined(CPU_COMMON_SAML21)
793 MCLK->APBDMASK.reg |= (MCLK_APBDMASK_SERCOM5);
807#if defined(CPU_COMMON_SAMD21)
808 PM->APBCMASK.reg &= ~(PM_APBCMASK_SERCOM0 << id);
809#elif defined (CPU_COMMON_SAMD5X)
811 MCLK->APBAMASK.reg &= ~(1 << (
id + 12));
813 MCLK->APBBMASK.reg &= ~(1 << (
id + 7));
815 MCLK->APBDMASK.reg &= ~(1 << (
id - 4));
819 MCLK->APBCMASK.reg &= ~(MCLK_APBCMASK_SERCOM0 << id);
821#if defined (CPU_COMMON_SAML21)
823 MCLK->APBDMASK.reg &= ~(MCLK_APBDMASK_SERCOM5);
829#ifdef CPU_COMMON_SAMD5X
830static inline uint8_t _sercom_gclk_id_core(uint8_t
sercom_id) {
851#if defined(CPU_COMMON_SAMD21)
852 GCLK->CLKCTRL.reg = (GCLK_CLKCTRL_CLKEN | GCLK_CLKCTRL_GEN(gclk) |
853 (SERCOM0_GCLK_ID_CORE + id));
854 while (GCLK->STATUS.reg & GCLK_STATUS_SYNCBUSY) {}
855#elif defined(CPU_COMMON_SAMD5X)
856 GCLK->PCHCTRL[_sercom_gclk_id_core(
id)].reg = (GCLK_PCHCTRL_CHEN | GCLK_PCHCTRL_GEN(gclk));
859 GCLK->PCHCTRL[SERCOM0_GCLK_ID_CORE + id].reg = (GCLK_PCHCTRL_CHEN | GCLK_PCHCTRL_GEN(gclk));
861#if defined(CPU_COMMON_SAML21)
863 GCLK->PCHCTRL[SERCOM5_GCLK_ID_CORE].reg = (GCLK_PCHCTRL_CHEN | GCLK_PCHCTRL_GEN(gclk));
874#ifdef RSTC_RCAUSE_BACKUP
875 return RSTC->RCAUSE.reg & RSTC_RCAUSE_BACKUP;
895#ifndef ADC_INPUTCTRL_DIFFMODE
896#define ADC_INPUTCTRL_DIFFMODE (1 << 7)
902#define ADC_REFSEL_AREFA_PIN GPIO_PIN(PA, 3)
907#define ADC_REFSEL_AREFB_PIN GPIO_PIN(PA, 4)
909#if defined(ADC_REFCTRL_REFSEL_AREFC) || DOXYGEN
913#define ADC_REFSEL_AREFC_PIN GPIO_PIN(PA, 6)
917#define HAVE_ADC_RES_T
920#if defined(ADC_CTRLB_RESSEL)
924#elif defined(ADC_CTRLC_RESSEL)
929 ADC_RES_16BIT_2SAMPL = ( 0x1 << 2) | 0x1,
930 ADC_RES_16BIT_4SAMPL = ( 0x2 << 2) | 0x1,
931 ADC_RES_16BIT_8SAMPL = ( 0x3 << 2) | 0x1,
932 ADC_RES_16BIT_16SAMPL = ( 0x4 << 2) | 0x1,
933 ADC_RES_16BIT_32SAMPL = ( 0x5 << 2) | 0x1,
934 ADC_RES_16BIT_64SAMPL = ( 0x6 << 2) | 0x1,
935 ADC_RES_16BIT_128SAMPL = ( 0x7 << 2) | 0x1,
936 ADC_RES_16BIT_256SAMPL = ( 0x8 << 2) | 0x1,
937 ADC_RES_16BIT_512SAMPL = ( 0x9 << 2) | 0x1,
938 ADC_RES_16BIT_1024SAMPL = ( 0xA << 2) | 0x1,
942#define ADC_RES_16BIT ADC_RES_16BIT_16SAMPL
949#ifndef ETH_RX_BUFFER_COUNT
950#define ETH_RX_BUFFER_COUNT (4)
953#ifndef ETH_TX_BUFFER_COUNT
954#define ETH_TX_BUFFER_COUNT (2)
957#ifndef ETH_RX_BUFFER_SIZE
958#define ETH_RX_BUFFER_SIZE (1536)
961#ifndef ETH_TX_BUFFER_SIZE
962#define ETH_TX_BUFFER_SIZE (1536)
969#if defined(GMAC_INST_NUM) || defined(DOXYGEN)
990#define USBDEV_CPU_DMA_ALIGNMENT (4)
995#define USBDEV_CPU_DMA_REQUIREMENTS __attribute__((aligned(USBDEV_CPU_DMA_ALIGNMENT)))
1000#if defined(USB_INST_NUM) || defined(DOXYGEN)
1013#define SDMMC_CPU_DMA_ALIGNMENT 4
1018#define SDMMC_CPU_DMA_REQUIREMENTS __attribute__((aligned(SDMMC_CPU_DMA_ALIGNMENT)))
1035#define NWDT_TIME_LOWER_LIMIT (8U)
1036#define NWDT_TIME_UPPER_LIMIT (16384U)
1042#define WDT_HAS_STOP (1)
1046#define WDT_HAS_INIT (1)
1056#if defined(REV_DMAC) || DOXYGEN
1106#define DMA_TRIGGER_DISABLED 0
1111#if defined(CPU_COMMON_SAML21) || defined(DOXYGEN)
1112#define DMA_DESCRIPTOR_IN_LPSRAM
1118#ifdef DMA_DESCRIPTOR_IN_LPSRAM
1119#define DMA_DESCRIPTOR_ATTRS __attribute__((section(".backup.bss")))
1121#define DMA_DESCRIPTOR_ATTRS
1253 const void *src,
void *dst,
size_t num,
dma_incr_t incr);
1274 size_t num,
bool incr);
1393#ifdef FLASH_USER_PAGE_SIZE
1394#define FLASH_USER_PAGE_AUX_SIZE (FLASH_USER_PAGE_SIZE - sizeof(nvm_user_page_t))
1396#define FLASH_USER_PAGE_AUX_SIZE (AUX_PAGE_SIZE * AUX_NB_OF_PAGES - sizeof(nvm_user_page_t))
1433#define sam0_flashpage_aux_get(offset) \
1434 (const void*)((uint8_t*)NVMCTRL_USER + sizeof(nvm_user_page_t) + (offset))
1441#define sam0_flashpage_aux_cfg() \
1442 ((const nvm_user_page_t*)NVMCTRL_USER)
#define assert(cond)
abort the program if assertion is false
@ GPIO_OUT
select GPIO MASK as output
@ GPIO_IN
select GPIO MASK as input
@ I2C_SPEED_NORMAL
normal mode: ~100 kbit/s
@ I2C_SPEED_FAST_PLUS
fast plus mode: ~1000 kbit/s
@ I2C_SPEED_LOW
low speed mode: ~10 kbit/s
@ I2C_SPEED_HIGH
high speed mode: ~3400 kbit/s
@ I2C_SPEED_FAST
fast mode: ~400 kbit/s
@ SPI_CLK_10MHZ
drive the SPI bus with 10MHz
@ SPI_CLK_5MHZ
drive the SPI bus with 5MHz
@ SPI_CLK_400KHZ
drive the SPI bus with 400KHz
@ SPI_CLK_1MHZ
drive the SPI bus with 1MHz
@ SPI_CLK_100KHZ
drive the SPI bus with 100KHz
enum IRQn IRQn_Type
Interrupt Number Definition.
static void cortexm_sleep(int deep)
Put the CPU into (deep) sleep mode, using the WFI instruction.
adc_res_t
Possible ADC resolution settings.
@ ADC_RES_8BIT
ADC resolution: 8 bit.
@ ADC_RES_14BIT
ADC resolution: 14 bit.
@ ADC_RES_6BIT
ADC resolution: 6 bit.
@ ADC_RES_10BIT
ADC resolution: 10 bit.
@ ADC_RES_12BIT
ADC resolution: 12 bit.
gpio_irq_trig_t
Definition of possible IRQ triggers.
@ GPIO_TRIGGER_EDGE_FALLING
edge triggered IRQ on falling flanks only
@ GPIO_TRIGGER_LEVEL_HIGH
level triggered IRQ on high input
@ GPIO_TRIGGER_EDGE_RISING
edge triggered IRQ on rising flanks only
@ GPIO_TRIGGER_EDGE_BOTH
edge triggered IRQ on falling AND rising flanks
@ GPIO_TRIGGER_LEVEL_LOW
level triggered IRQ on low input
gpio_pull_t
Enumeration of pull resistor configurations.
gpio_pull_strength_t
Enumeration of pull resistor values.
gpio_state_t
Enumeration of GPIO states (direction)
gpio_slew_t
Enumeration of slew rate settings.
gpio_drive_strength_t
Enumeration of drive strength options.
typedef gpio_conf_t
GPIO pin configuration.
@ GPIO_FLOATING
No pull ups nor pull downs enabled.
@ GPIO_PULL_KEEP
Keep the signal at current logic level with pull up/down resistors.
@ GPIO_PULL_DOWN
Pull down resistor enabled.
@ GPIO_PULL_UP
Pull up resistor enabled.
@ GPIO_PULL_WEAKEST
Use the weakest (highest Ohm value) resistor.
@ GPIO_PULL_WEAK
Use a weak pull resistor.
@ GPIO_PULL_STRONG
Use a strong pull resistor.
@ GPIO_PULL_STRONGEST
Use the strongest pull resistor.
@ GPIO_OUTPUT_OPEN_SOURCE
Use pin as output in open emitter configuration.
@ GPIO_USED_BY_PERIPHERAL
The GPIO pin is used by a peripheral.
@ GPIO_OUTPUT_OPEN_DRAIN
Use pin as output in open collector configuration.
@ GPIO_OUTPUT_PUSH_PULL
Use pin as output in push-pull configuration.
@ GPIO_DISCONNECT
Disconnect pin from all peripherals.
@ GPIO_INPUT
Use pin as input.
@ GPIO_SLEW_SLOWEST
let the output voltage level rise/fall as slow as possible
@ GPIO_SLEW_FAST
let the output voltage level rise/fall fast
@ GPIO_SLEW_SLOW
let the output voltage level rise/fall slowly
@ GPIO_SLEW_FASTEST
let the output voltage level rise/fall as fast as possible
@ GPIO_DRIVE_STRONG
Use a strong drive strength.
@ GPIO_DRIVE_WEAK
Use a weak drive strength.
@ GPIO_DRIVE_STRONGEST
Use the strongest drive strength.
@ GPIO_DRIVE_WEAKEST
Use the weakest drive strength.
spi_mode_t
Support SPI modes.
@ SPI_MODE_0
CPOL=0, CPHA=0.
@ SPI_MODE_2
CPOL=1, CPHA=0.
@ SPI_MODE_1
CPOL=0, CPHA=1.
@ SPI_MODE_3
CPOL=1, CPHA=1.
gpio_mode_t
Available pin modes.
#define GPIO_MODE(oe, ic, pr, dr)
Generate GPIO mode bitfields.
uart_data_bits_t
Definition of possible data bits lengths in a UART frame.
@ UART_DATA_BITS_6
6 data bits
@ UART_DATA_BITS_5
5 data bits
@ UART_DATA_BITS_7
7 data bits
@ UART_DATA_BITS_8
8 data bits
uint8_t rtc_get_tamper_event(void)
Get and clear the RTC tamper event that has woken the CPU from Deep Sleep.
uart_rxpad_t
Available values for SERCOM UART RX pad selection.
@ UART_PAD_RX_1
select pad 1
@ UART_PAD_RX_0
use pad 0 for RX line
@ UART_PAD_RX_3
select pad 3
@ UART_PAD_RX_2
select pad 2
void gpio_disable_mux(gpio_t pin)
Disable alternate function (PMUX setting) for a PORT pin.
void dma_prepare(dma_t dma, uint8_t width, const void *src, void *dst, size_t num, dma_incr_t incr)
Prepare the DMA channel for an individual transfer.
void dma_init(void)
Initialize DMA.
@ TIMER_TYPE_TC
Timer is a TC timer
@ TIMER_TYPE_TCC
Timer is a TCC timer.
int rtc_tamper_register(gpio_t pin, gpio_flank_t flank)
Enable Tamper Detection IRQs.
static uint8_t sercom_id(const void *sercom)
Return the numeric id of a SERCOM device derived from its address.
void dma_wait(dma_t dma)
Wait for a DMA channel to finish the transfer.
void dma_cancel(dma_t dma)
Cancel an active DMA transfer.
i2c_flag_t
Available SERCOM I2C flag selections.
@ I2C_FLAG_NONE
No flags set.
@ I2C_FLAG_RUN_STANDBY
run SERCOM in standby mode
void dma_prepare_dst(dma_t dma, void *dst, size_t num, bool incr)
Prepare a transfer without modifying the source address settings.
void cpu_pm_cb_leave(int deep)
Called after the power management left a power mode.
void gpio_init_mux(gpio_t pin, gpio_mux_t mux)
Set up alternate function (PMUX setting) for a PORT pin.
void dma_setup(dma_t dma, unsigned trigger, uint8_t prio, bool irq)
Initialize a previously allocated DMA channel with one-time settings.
uint32_t sam0_gclk_freq(uint8_t id)
Returns the frequency of a GCLK provider.
dma_t dma_acquire_channel(void)
Acquire a DMA channel.
spi_misopad_t
Available values for SERCOM SPI MISO pad selection.
@ SPI_PAD_MISO_1
use pad 1 for MISO line
@ SPI_PAD_MISO_2
use pad 2 for MISO line
@ SPI_PAD_MISO_0
use pad 0 for MISO line
@ SPI_PAD_MISO_3
use pad 3 for MISO line
void dma_release_channel(dma_t dma)
Release a previously acquired DMA channel.
void gpio_pm_cb_leave(int deep)
Called after the power management left a power mode.
static void sercom_set_gen(void *sercom, uint8_t gclk)
Configure generator clock for given SERCOM device.
uint8_t rtc_tamper_pin_mask(gpio_t pin)
Get the tamper event mask for a certain pin.
uart_flag_t
Available SERCOM UART flag selections.
@ UART_FLAG_TX_ONDEMAND
Only enable TX pin on demand.
@ UART_FLAG_NONE
No flags set.
@ UART_FLAG_RUN_STANDBY
run SERCOM in standby mode
@ UART_FLAG_WAKEUP
wake from sleep on receive
void sam0_flashpage_aux_reset(const nvm_user_page_t *cfg)
Reset the configuration area, apply a new configuration.
static void sam0_cortexm_sleep(int deep)
Wrapper for cortexm_sleep calling power management callbacks.
static void sercom_clk_dis(void *sercom)
Disable peripheral clock for given SERCOM device.
static bool cpu_woke_from_backup(void)
Returns true if the CPU woke deep sleep (backup/standby)
void cpu_pm_cb_enter(int deep)
Called before the power management enters a power mode.
void dma_append_dst(dma_t dma, DmacDescriptor *next, void *dst, size_t num, bool incr)
Append a second transfer descriptor after the default channel descriptor, copying source and block si...
void sam0_flashpage_aux_write(uint32_t offset, const void *data, size_t len)
Write data to the user configuration area.
uart_txpad_t
Available values for SERCOM UART TX pad selection.
@ UART_PAD_TX_0_RTS_2_CTS_3
TX is pad 0, on top RTS on pad 2 and CTS on pad 3.
@ UART_PAD_TX_0
select pad 0
@ UART_PAD_TX_2
select pad 2
dma_incr_t
Available DMA address increment modes.
@ DMA_INCR_NONE
Don't increment any addresses after a beat.
@ DMA_INCR_DEST
Increment destination address after a beat.
@ DMA_INCR_BOTH
Increment both addresses after a beat.
@ DMA_INCR_SRC
Increment the source address after a beat.
void dma_append(dma_t dma, DmacDescriptor *descriptor, uint8_t width, const void *src, void *dst, size_t num, dma_incr_t incr)
Append a second transfer descriptor after the default channel descriptor.
void rtc_tamper_enable(void)
Enable Tamper Detection IRQs.
void rtc_tamper_init(void)
Power on the RTC (if the RTC/RTT is not otherwise used)
unsigned dma_t
DMA channel type.
void sam0_gclk_enable(uint8_t id)
Enables an on-demand GCLK that has been configured in cpu.c.
void dma_append_src(dma_t dma, DmacDescriptor *next, const void *src, size_t num, bool incr)
Append a second transfer descriptor after the default channel descriptor, copying destination and blo...
gpio_mux_t
Available MUX values for configuring a pin's alternate function.
@ GPIO_MUX_E
select peripheral function E
@ GPIO_MUX_J
select peripheral function J
@ GPIO_MUX_K
select peripheral function K
@ GPIO_MUX_M
select peripheral function M
@ GPIO_MUX_H
select peripheral function H
@ GPIO_MUX_I
select peripheral function I
@ GPIO_MUX_D
select peripheral function D
@ GPIO_MUX_G
select peripheral function G
@ GPIO_MUX_C
select peripheral function C
@ GPIO_MUX_N
select peripheral function N
@ GPIO_MUX_A
select peripheral function A
@ GPIO_MUX_L
select peripheral function L
@ GPIO_MUX_B
select peripheral function B
@ GPIO_MUX_DISABLED
Disable
@ GPIO_MUX_F
select peripheral function F
static void sam0_set_voltage_regulator(sam0_supc_t src)
Switch the internal voltage regulator used for generating the internal MCU voltages.
spi_mosipad_t
Available values for SERCOM SPI MOSI and SCK pad selection.
@ SPI_PAD_MOSI_2_SCK_3
use pad 2 for MOSI, pad 3 for SCK
@ SPI_PAD_MOSI_0_SCK_3
use pad 0 for MOSI, pad 3 for SCK
@ SPI_PAD_MOSI_3_SCK_1
use pad 3 for MOSI, pad 1 for SCK
@ SPI_PAD_MOSI_0_SCK_1
use pad 0 for MOSI, pad 1 for SCK
static void sercom_clk_en(void *sercom)
Enable peripheral clock for given SERCOM device.
sam0_supc_t
Available voltage regulators on the supply controller.
void dma_prepare_src(dma_t dma, const void *src, size_t num, bool incr)
Prepare a transfer without modifying the destination address settings.
void dma_start(dma_t dma)
Start a DMA transfer.
void gpio_pm_cb_enter(int deep)
Called before the power management enters a power mode.
ADC Channel Configuration.
uint32_t inputctrl
ADC channel pin multiplexer value
Frequency meter configuration.
uint8_t gclk_src
GCLK source select for reference.
gpio_t pin
GPIO at which the frequency is to be measured.
I2C configuration structure.
uint8_t gclk_src
GCLK source which supplys SERCOM.
gpio_mux_t mux
alternate function (mux)
uint8_t flags
allow SERCOM to run in standby mode
SercomI2cm * dev
pointer to the used I2C device
PWM channel configuration data structure.
uint8_t chan
TCC channel to use.
gpio_mux_t mux
pin function multiplex value
PWM device configuration.
tc_tcc_cfg_t tim
timer configuration
uint8_t chan_numof
number of channels
const pwm_conf_chan_t * chan
channel configuration
uint8_t gclk_src
GCLK source which clocks TIMER.
NVM User Row Mapping - Dedicated Entries Config values will be applied at power-on.
Ethernet parameters struct.
Gmac * dev
ptr to the device registers
gpio_t mdc
MII interface, clock gpio.
gpio_t mdio
MII interface, data gpio.
gpio_t refclk
REFCLK gpio.
gpio_t rst_pin
PHY reset gpio.
gpio_t int_pin
PHY interrupt gpio.
USB peripheral parameters.
gpio_mux_t d_mux
alternate function (mux) for data pins
uint8_t gclk_src
GCLK source which supplys 48 MHz
UsbDevice * device
ptr to the device registers
SDHC peripheral configuration.
gpio_t wp
Write Protect pin (must be GPIO_UNDEF if not connected)
void * sdhc
SDHC peripheral.
gpio_t cd
Card Detect pin (must be GPIO_UNDEF if not connected)
SPI device configuration.
gpio_mux_t miso_mux
alternate function for MISO pin (mux)
spi_misopad_t miso_pad
pad to use for MISO line
gpio_mux_t clk_mux
alternate function for CLK pin (mux)
spi_mosipad_t mosi_pad
pad to use for MOSI and CLK line
gpio_mux_t mosi_mux
alternate function for MOSI pin (mux)
uint8_t gclk_src
GCLK source which supplys SERCOM.
void * dev
pointer to the used SPI device
Timer device configuration.
uint16_t flags
flags for CTRA, e.g.
uint32_t pm_mask
PM_APBCMASK bits to enable Timer.
uint8_t gclk_src
GCLK source which supplys Timer.
IRQn_Type irq
IRQ# of Timer Interrupt.
uint16_t gclk_ctrl
GCLK_CLKCTRL_ID for the Timer.
Tc * dev
pointer to the used Timer device
Common configuration for timer devices.
uint16_t gclk_id
TCn_GCLK_ID.
uint8_t type
Timer type (TC/TCC)
uint32_t pm_mask
PM_APBCMASK bits to enable Timer.
UART device configuration.
gpio_mux_t mux
alternative function for pins
uint8_t gclk_src
GCLK source which supplys SERCOM.
uart_txpad_t tx_pad
pad selection for TX line
SercomUsart * dev
pointer to the used UART device
uart_rxpad_t rx_pad
pad selection for RX line
uart_flag_t flags
set optional SERCOM flags
GPIO pin configuration for SAM0 MCUs.
bool initial_value
Initial value of the output.
gpio_pull_t pull
Pull resistor configuration.
gpio_state_t state
State of the pin.
gpio_drive_strength_t drive_strength
Drive strength of the GPIO.