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

Merge pull request #17915 from benpicco/boards/samr34-xpro-enhance

boards/samr34: cleanup, add 2nd uart & timer
This commit is contained in:
Alexandre Abadie 2022-04-12 09:13:46 +02:00 committed by GitHub
commit 84804cee03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 5 deletions

View File

@ -21,6 +21,7 @@
#define PERIPH_CONF_H
#include "periph_cpu.h"
#include "macros/units.h"
#ifdef __cplusplus
extern "C" {
@ -29,7 +30,7 @@ extern "C" {
/**
* @brief GCLK reference speed
*/
#define CLOCK_CORECLOCK (48000000U)
#define CLOCK_CORECLOCK MHZ(48)
/**
* @brief Enable the internal DC/DC converter
@ -50,13 +51,24 @@ 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)
/** @} */
/**
@ -71,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,
@ -82,8 +108,9 @@ 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 (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
@ -109,7 +136,7 @@ static const spi_conf_t spi_config[] = {
}
};
#define SPI_NUMOF (sizeof(spi_config) / sizeof(spi_config[0]))
#define SPI_NUMOF ARRAY_SIZE(spi_config)
/** @} */
/**
@ -127,7 +154,7 @@ static const i2c_conf_t i2c_config[] = {
.flags = I2C_FLAG_NONE
}
};
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
#define I2C_NUMOF ARRAY_SIZE(i2c_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\.