Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpu/sam0_common: Implement time-sharing of SERCOMs #21029

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -324,14 +324,6 @@ static const uart_conf_t uart_config[] = {
},
};

/* interrupt function name mapping */
#define UART_0_ISR isr_sercom0_2
#define UART_0_ISR_TX isr_sercom0_0
#define UART_1_ISR isr_sercom4_2
#define UART_1_ISR_TX isr_sercom4_0
#define UART_2_ISR isr_sercom1_2
#define UART_2_ISR_TX isr_sercom1_0

#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */

Expand Down
4 changes: 0 additions & 4 deletions boards/adafruit-itsybitsy-m4/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,6 @@ static const uart_conf_t uart_config[] = {
},
};

/* interrupt function name mapping */
#define UART_0_ISR isr_sercom3_2
#define UART_0_ISR_TX isr_sercom3_0

#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */

Expand Down
8 changes: 1 addition & 7 deletions boards/adafruit-metro-m4-express/include/arduino_iomap.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,8 @@ extern "C" {

/**
* @brief SPI_DEV(1) is connected to D11/D12/D13
*
* The SPI on D11/D12/D13 is only available when `periph_uart` is not used due
* to a conflicting use of the same SERCOM. If it is available, it is the last
* SPI bus.
*/
#if !MODULE_PERIPH_UART
# define ARDUINO_SPI_D11D12D13 SPI_DEV(1)
#endif
#define ARDUINO_SPI_D11D12D13 SPI_DEV(1)
/** @} */

/**
Expand Down
10 changes: 2 additions & 8 deletions boards/adafruit-metro-m4-express/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ static const spi_conf_t spi_config[] = {
.rx_trigger = SERCOM2_DMAC_ID_RX,
#endif
},
#if !MODULE_PERIPH_UART
{ /* D11=MOSI, D12=MISO, D13=SCK */
.dev = &(SERCOM3->SPI),
.miso_pin = GPIO_PIN(PA, 17), /* C: SERCOM1.1, D: SERCOM3.0 */
Expand All @@ -181,12 +180,11 @@ static const spi_conf_t spi_config[] = {
.miso_pad = SPI_PAD_MISO_0,
.mosi_pad = SPI_PAD_MOSI_3_SCK_1,
.gclk_src = SAM0_GCLK_PERIPH,
# if MODULE_PERIPH_DMA
#if MODULE_PERIPH_DMA
.tx_trigger = SERCOM3_DMAC_ID_TX,
.rx_trigger = SERCOM3_DMAC_ID_RX,
# endif
},
#endif
},
#if MODULE_PERIPH_SPI_ON_QSPI
{ /* QSPI in SPI mode */
.dev = QSPI,
Expand Down Expand Up @@ -253,10 +251,6 @@ static const uart_conf_t uart_config[] = {
},
};

/* interrupt function name mapping */
#define UART_0_ISR isr_sercom3_2
#define UART_0_ISR_TX isr_sercom3_0

#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */

Expand Down
4 changes: 0 additions & 4 deletions boards/adafruit-pybadge/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,6 @@ static const uart_conf_t uart_config[] = {
}
};

/* interrupt function name mapping */
#define UART_0_ISR isr_sercom5_2
#define UART_0_ISR_TX isr_sercom5_0

#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */

Expand Down
12 changes: 4 additions & 8 deletions boards/arduino-mkrwan1300/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ extern "C" {
static const uart_conf_t uart_config[] = {
{
.dev = &SERCOM5->USART,
.rx_pin = GPIO_PIN(PB,23), /* ARDUINO_PIN_13, RX Pin */
.tx_pin = GPIO_PIN(PB,22), /* ARDUINO_PIN_14, TX Pin */
.rx_pin = GPIO_PIN(PB, 23), /* ARDUINO_PIN_13, RX Pin */
.tx_pin = GPIO_PIN(PB, 22), /* ARDUINO_PIN_14, TX Pin */
#ifdef MODULE_PERIPH_UART_HW_FC
.rts_pin = GPIO_UNDEF,
.cts_pin = GPIO_UNDEF,
Expand All @@ -52,8 +52,8 @@ static const uart_conf_t uart_config[] = {
},
{ /* LoRa module */
.dev = &SERCOM4->USART,
.rx_pin = GPIO_PIN(PA,15),
.tx_pin = GPIO_PIN(PA,12),
.rx_pin = GPIO_PIN(PA, 15),
.tx_pin = GPIO_PIN(PA, 12),
#ifdef MODULE_PERIPH_UART_HW_FC
.rts_pin = GPIO_UNDEF,
.cts_pin = GPIO_UNDEF,
Expand All @@ -66,10 +66,6 @@ static const uart_conf_t uart_config[] = {
},
};

/* interrupt function name mapping */
#define UART_0_ISR isr_sercom5
#define UART_1_ISR isr_sercom4

#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */

Expand Down
7 changes: 2 additions & 5 deletions boards/arduino-nano-33-iot/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ static const tc32_conf_t timer_config[] = {
static const uart_conf_t uart_config[] = {
{
.dev = &SERCOM5->USART,
.rx_pin = GPIO_PIN(PB,23),
.tx_pin = GPIO_PIN(PB,22),
.rx_pin = GPIO_PIN(PB, 23),
.tx_pin = GPIO_PIN(PB, 22),
#ifdef MODULE_SAM0_PERIPH_UART_HW_FC
.rts_pin = GPIO_UNDEF,
.cts_pin = GPIO_UNDEF,
Expand All @@ -133,9 +133,6 @@ static const uart_conf_t uart_config[] = {
}
};

/* interrupt function name mapping */
#define UART_0_ISR isr_sercom5

#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */

Expand Down
7 changes: 2 additions & 5 deletions boards/common/arduino-mkr/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ extern "C" {
static const uart_conf_t uart_config[] = {
{
.dev = &SERCOM5->USART,
.rx_pin = GPIO_PIN(PB,23), /* ARDUINO_PIN_13, RX Pin */
.tx_pin = GPIO_PIN(PB,22), /* ARDUINO_PIN_14, TX Pin */
.rx_pin = GPIO_PIN(PB, 23), /* ARDUINO_PIN_13, RX Pin */
.tx_pin = GPIO_PIN(PB, 22), /* ARDUINO_PIN_14, TX Pin */
#ifdef MODULE_PERIPH_UART_HW_FC
.rts_pin = GPIO_UNDEF,
.cts_pin = GPIO_UNDEF,
Expand All @@ -52,9 +52,6 @@ static const uart_conf_t uart_config[] = {
}
};

/* interrupt function name mapping */
#define UART_0_ISR isr_sercom5

#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */

Expand Down
12 changes: 4 additions & 8 deletions boards/common/arduino-zero/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ static const tc32_conf_t timer_config[] = {
static const uart_conf_t uart_config[] = {
{
.dev = &SERCOM5->USART,
.rx_pin = GPIO_PIN(PB,23),
.tx_pin = GPIO_PIN(PB,22),
.rx_pin = GPIO_PIN(PB, 23),
.tx_pin = GPIO_PIN(PB, 22),
#ifdef MODULE_PERIPH_UART_HW_FC
.rts_pin = GPIO_UNDEF,
.cts_pin = GPIO_UNDEF,
Expand All @@ -141,8 +141,8 @@ static const uart_conf_t uart_config[] = {
},
{
.dev = &SERCOM0->USART,
.rx_pin = GPIO_PIN(PA,11),
.tx_pin = GPIO_PIN(PA,10),
.rx_pin = GPIO_PIN(PA, 11),
.tx_pin = GPIO_PIN(PA, 10),
#ifdef MODULE_PERIPH_UART_HW_FC
.rts_pin = GPIO_UNDEF,
.cts_pin = GPIO_UNDEF,
Expand All @@ -155,10 +155,6 @@ static const uart_conf_t uart_config[] = {
}
};

/* interrupt function name mapping */
#define UART_0_ISR isr_sercom5
#define UART_1_ISR isr_sercom0

#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */

Expand Down
6 changes: 0 additions & 6 deletions boards/common/saml1x/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,6 @@ static const uart_conf_t uart_config[] = {
}
};

/* interrupt function name mapping */
#define UART_0_ISR isr_sercom2_2
#define UART_0_ISR_TX isr_sercom2_0
#define UART_1_ISR isr_sercom1_2
#define UART_1_ISR_TX isr_sercom1_0

#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */

Expand Down
3 changes: 0 additions & 3 deletions boards/feather-m0/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,6 @@ static const uart_conf_t uart_config[] = {
}
};

/* interrupt function name mapping */
#define UART_0_ISR isr_sercom0

#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */

Expand Down
3 changes: 0 additions & 3 deletions boards/samd10-xmini/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,6 @@ static const uart_conf_t uart_config[] = {
},
};

/* interrupt function name mapping */
#define UART_0_ISR isr_sercom0

#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */

Expand Down
17 changes: 6 additions & 11 deletions boards/samd20-xpro/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ static const tc32_conf_t timer_config[] = {
static const uart_conf_t uart_config[] = {
{ /* Virtual COM Port */
.dev = &SERCOM3->USART,
.rx_pin = GPIO_PIN(PA,25),
.tx_pin = GPIO_PIN(PA,24),
.rx_pin = GPIO_PIN(PA, 25),
.tx_pin = GPIO_PIN(PA, 24),
#ifdef MODULE_PERIPH_UART_HW_FC
.rts_pin = GPIO_UNDEF,
.cts_pin = GPIO_UNDEF,
Expand All @@ -152,8 +152,8 @@ static const uart_conf_t uart_config[] = {
},
{ /* EXT1 */
.dev = &SERCOM4->USART,
.rx_pin = GPIO_PIN(PB,9),
.tx_pin = GPIO_PIN(PB,8),
.rx_pin = GPIO_PIN(PB, 9),
.tx_pin = GPIO_PIN(PB, 8),
#ifdef MODULE_PERIPH_UART_HW_FC
.rts_pin = GPIO_UNDEF,
.cts_pin = GPIO_UNDEF,
Expand All @@ -166,8 +166,8 @@ static const uart_conf_t uart_config[] = {
},
{ /* EXT2 */
.dev = &SERCOM0->USART,
.rx_pin = GPIO_PIN(PA,9),
.tx_pin = GPIO_PIN(PA,8),
.rx_pin = GPIO_PIN(PA, 9),
.tx_pin = GPIO_PIN(PA, 8),
#ifdef MODULE_PERIPH_UART_HW_FC
.rts_pin = GPIO_UNDEF,
.cts_pin = GPIO_UNDEF,
Expand All @@ -180,11 +180,6 @@ static const uart_conf_t uart_config[] = {
},
};

/* interrupt function name mapping */
#define UART_0_ISR isr_sercom3
#define UART_1_ISR isr_sercom4
#define UART_2_ISR isr_sercom0

#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */

Expand Down
17 changes: 6 additions & 11 deletions boards/samd21-xpro/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ static const tc32_conf_t timer_config[] = {
static const uart_conf_t uart_config[] = {
{ /* Virtual COM Port */
.dev = &SERCOM3->USART,
.rx_pin = GPIO_PIN(PA,23),
.tx_pin = GPIO_PIN(PA,22),
.rx_pin = GPIO_PIN(PA, 23),
.tx_pin = GPIO_PIN(PA, 22),
#ifdef MODULE_PERIPH_UART_HW_FC
.rts_pin = GPIO_UNDEF,
.cts_pin = GPIO_UNDEF,
Expand All @@ -154,8 +154,8 @@ static const uart_conf_t uart_config[] = {
},
{ /* EXT1 */
.dev = &SERCOM4->USART,
.rx_pin = GPIO_PIN(PB,9),
.tx_pin = GPIO_PIN(PB,8),
.rx_pin = GPIO_PIN(PB, 9),
.tx_pin = GPIO_PIN(PB, 8),
#ifdef MODULE_PERIPH_UART_HW_FC
.rts_pin = GPIO_UNDEF,
.cts_pin = GPIO_UNDEF,
Expand All @@ -168,8 +168,8 @@ static const uart_conf_t uart_config[] = {
},
{ /* EXT2/3 */
.dev = &SERCOM4->USART,
.rx_pin = GPIO_PIN(PB,11),
.tx_pin = GPIO_PIN(PB,10),
.rx_pin = GPIO_PIN(PB, 11),
.tx_pin = GPIO_PIN(PB, 10),
#ifdef MODULE_PERIPH_UART_HW_FC
.rts_pin = GPIO_UNDEF,
.cts_pin = GPIO_UNDEF,
Expand All @@ -182,11 +182,6 @@ static const uart_conf_t uart_config[] = {
}
};

/* interrupt function name mapping */
#define UART_0_ISR isr_sercom3
#define UART_1_ISR isr_sercom4
#define UART_2_ISR isr_sercom5

#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */

Expand Down
13 changes: 0 additions & 13 deletions boards/same54-xpro/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,19 +182,6 @@ static const uart_conf_t uart_config[] = {
}
};

/* interrupt function name mapping */
#define UART_0_ISR isr_sercom2_2
#define UART_0_ISR_TX isr_sercom2_0

#define UART_1_ISR isr_sercom0_2
#define UART_1_ISR_TX isr_sercom0_0

#define UART_2_ISR isr_sercom5_2
#define UART_2_ISR_TX isr_sercom5_0

#define UART_3_ISR isr_sercom1_2
#define UART_3_ISR_TX isr_sercom1_0

#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */

Expand Down
9 changes: 2 additions & 7 deletions boards/saml21-xpro/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ static const tc32_conf_t timer_config[] = {
static const uart_conf_t uart_config[] = {
{ /* Virtual COM Port */
.dev = &SERCOM3->USART,
.rx_pin = GPIO_PIN(PA,23),
.tx_pin = GPIO_PIN(PA,22),
.rx_pin = GPIO_PIN(PA, 23),
.tx_pin = GPIO_PIN(PA, 22),
#ifdef MODULE_PERIPH_UART_HW_FC
.rts_pin = GPIO_UNDEF,
.cts_pin = GPIO_UNDEF,
Expand Down Expand Up @@ -111,11 +111,6 @@ static const uart_conf_t uart_config[] = {
}
};

/* interrupt function name mapping */
#define UART_0_ISR isr_sercom3
#define UART_1_ISR isr_sercom4
#define UART_2_ISR isr_sercom1

#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */

Expand Down
Loading
Loading