1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-27 15:31:17 +01:00

Merge pull request #14232 from benemorius/pr/tradfri-leuart

boards/ikea-tradfri: support EFM32_USE_LEUART=1
This commit is contained in:
Bas Stottelaar 2020-06-20 09:15:51 +02:00 committed by GitHub
commit fb1f9ba80b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 37 additions and 2 deletions

View File

@ -67,6 +67,7 @@ Pin 1 is on the top-left side with only 6 contacts.
| SPI | 0 | USART1 | MOSI: PD15, MISO: PD14, CLK: PD13 | |
| Timer | 0 | TIMER0 + TIMER1 | | TIMER0 is used as prescaler (must be adjecent) |
| UART | 0 | USART0 | RX: PB15, TX: PB14 | Default STDIO output |
| LEUART | 0 | LEUART0 | RX: PB15, TX: PB14 | Alternate to using UART |
### User interface
| Peripheral | Mapped to | Pin | Comments |
@ -92,6 +93,14 @@ Pin 1 is on the top-left side with only 6 contacts.
## Board configuration
### UART selection
By default the UART peripheral is used for the TX/RX pins, however the pinout
is compatible with LEUART also. You can switch from UART to LEUART by compiling
with `EFM32_USE_LEUART=1`.
**Note**: LEUART is not working on the ICC-1 module.
### Clock selection
There are several clock sources that are available for the different
peripherals. You are advised to read [AN0004.1]

View File

@ -107,6 +107,31 @@ static const timer_conf_t timer_config[] = {
* @name UART configuration
* @{
*/
#ifndef EFM32_USE_LEUART
#define EFM32_USE_LEUART 0
#endif
#if EFM32_USE_LEUART
#ifndef STDIO_UART_BAUDRATE
#define STDIO_UART_BAUDRATE (9600)
#endif
static const uart_conf_t uart_config[] = {
{
.dev = LEUART0,
.rx_pin = GPIO_PIN(PB, 15),
.tx_pin = GPIO_PIN(PB, 14),
.loc = USART_ROUTELOC0_RXLOC_LOC9 |
USART_ROUTELOC0_TXLOC_LOC9,
.cmu = cmuClock_LEUART0,
.irq = LEUART0_IRQn
}
};
#define UART_0_ISR_RX isr_leuart0
#else /* EFM32_USE_LEUART */
static const uart_conf_t uart_config[] = {
{
.dev = USART0,
@ -118,9 +143,10 @@ static const uart_conf_t uart_config[] = {
.irq = USART0_RX_IRQn
}
};
#define UART_NUMOF ARRAY_SIZE(uart_config)
#define UART_0_ISR_RX isr_usart0_rx
#endif /* EFM32_USE_LEUART */
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
#ifdef __cplusplus