1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

boards/samr34-xpro: configure second timer & uart

This commit is contained in:
Benjamin Valentin 2022-04-11 18:02:23 +02:00
parent 760b7f5057
commit 8081312a2f
2 changed files with 29 additions and 1 deletions

View File

@ -51,13 +51,23 @@ static const tc32_conf_t timer_config[] = {
.gclk_id = TC0_GCLK_ID,
.gclk_src = SAM0_GCLK_TIMER,
.flags = TC_CTRLA_MODE_COUNT32,
},
{
.dev = TC2,
.irq = TC2_IRQn,
.mclk = &MCLK->APBCMASK.reg,
.mclk_mask = MCLK_APBCMASK_TC2 | MCLK_APBCMASK_TC3,
.gclk_id = TC2_GCLK_ID,
.gclk_src = SAM0_GCLK_TIMER,
.flags = TC_CTRLA_MODE_COUNT32,
}
};
/* Timer 0 configuration */
#define TIMER_0_CHANNELS 2
#define TIMER_0_ISR isr_tc0
#define TIMER_NUMOF (sizeof(timer_config)/sizeof(timer_config[0]))
#define TIMER_1_CHANNELS 2
#define TIMER_1_ISR isr_tc2
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */
@ -73,6 +83,20 @@ static const uart_conf_t uart_config[] = {
#ifdef MODULE_PERIPH_UART_HW_FC
.rts_pin = GPIO_UNDEF,
.cts_pin = GPIO_UNDEF,
#endif
.mux = GPIO_MUX_D,
.rx_pad = UART_PAD_RX_1,
.tx_pad = UART_PAD_TX_0,
.flags = UART_FLAG_NONE,
.gclk_src = SAM0_GCLK_MAIN,
},
{ /* EXT1 */
.dev = &SERCOM3->USART,
.rx_pin = GPIO_PIN(PA, 17),
.tx_pin = GPIO_PIN(PA, 16),
#ifdef MODULE_PERIPH_UART_HW_FC
.rts_pin = GPIO_UNDEF,
.cts_pin = GPIO_UNDEF,
#endif
.mux = GPIO_MUX_D,
.rx_pad = UART_PAD_RX_1,
@ -84,6 +108,7 @@ static const uart_conf_t uart_config[] = {
/* interrupt function name mapping */
#define UART_0_ISR isr_sercom0
#define UART_1_ISR isr_sercom3
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */

View File

@ -5137,8 +5137,11 @@ boards/samr34\-xpro/include/periph_conf\.h:[0-9]+: warning: Member RTT_FREQUENCY
boards/samr34\-xpro/include/periph_conf\.h:[0-9]+: warning: Member SPI_NUMOF \(macro definition\) of file periph_conf\.h is not documented\.
boards/samr34\-xpro/include/periph_conf\.h:[0-9]+: warning: Member TIMER_0_CHANNELS \(macro definition\) of file periph_conf\.h is not documented\.
boards/samr34\-xpro/include/periph_conf\.h:[0-9]+: warning: Member TIMER_0_ISR \(macro definition\) of file periph_conf\.h is not documented\.
boards/samr34\-xpro/include/periph_conf\.h:[0-9]+: warning: Member TIMER_1_CHANNELS \(macro definition\) of file periph_conf\.h is not documented\.
boards/samr34\-xpro/include/periph_conf\.h:[0-9]+: warning: Member TIMER_1_ISR \(macro definition\) of file periph_conf\.h is not documented\.
boards/samr34\-xpro/include/periph_conf\.h:[0-9]+: warning: Member TIMER_NUMOF \(macro definition\) of file periph_conf\.h is not documented\.
boards/samr34\-xpro/include/periph_conf\.h:[0-9]+: warning: Member UART_0_ISR \(macro definition\) of file periph_conf\.h is not documented\.
boards/samr34\-xpro/include/periph_conf\.h:[0-9]+: warning: Member UART_1_ISR \(macro definition\) of file periph_conf\.h is not documented\.
boards/samr34\-xpro/include/periph_conf\.h:[0-9]+: warning: Member UART_NUMOF \(macro definition\) of file periph_conf\.h is not documented\.
boards/samr34\-xpro/include/periph_conf\.h:[0-9]+: warning: Member ULTRA_LOW_POWER_INTERNAL_OSC_SOURCE \(macro definition\) of file periph_conf\.h is not documented\.
boards/samr34\-xpro/include/periph_conf\.h:[0-9]+: warning: Member adc_channels\[\] \(variable\) of file periph_conf\.h is not documented\.