From 5f002ced1ff8e2cc54dd2f53153f625066994b8a Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Mon, 12 Oct 2020 01:29:17 +0200 Subject: [PATCH] Revert "cpu/sam0_common: UART: implement inverted RX & TX" This reverts commit 585dc15f99d8a89766bb12d064fa2209909a1b6d. I did misunderstand this feature: This only inverts the data bits (instead of `c` uart will transmit `~c`), not the whole line level. This is not very useful on it's own, so revert it. --- cpu/sam0_common/include/periph_cpu_common.h | 2 -- cpu/sam0_common/periph/uart.c | 12 ------------ 2 files changed, 14 deletions(-) diff --git a/cpu/sam0_common/include/periph_cpu_common.h b/cpu/sam0_common/include/periph_cpu_common.h index ac56558cb7..08254d8224 100644 --- a/cpu/sam0_common/include/periph_cpu_common.h +++ b/cpu/sam0_common/include/periph_cpu_common.h @@ -178,8 +178,6 @@ typedef enum { UART_FLAG_NONE = 0x0, /**< No flags set */ UART_FLAG_RUN_STANDBY = 0x1, /**< run SERCOM in standby mode */ UART_FLAG_WAKEUP = 0x2, /**< wake from sleep on receive */ - UART_FLAG_RXINV = 0x4, /**< invert RX signal */ - UART_FLAG_TXINV = 0x8, /**< invert TX signal */ } uart_flag_t; #ifndef DOXYGEN diff --git a/cpu/sam0_common/periph/uart.c b/cpu/sam0_common/periph/uart.c index 48ddeb9dc6..658e47c158 100644 --- a/cpu/sam0_common/periph/uart.c +++ b/cpu/sam0_common/periph/uart.c @@ -190,18 +190,6 @@ int uart_init(uart_t uart, uint32_t baudrate, uart_rx_cb_t rx_cb, void *arg) if (uart_config[uart].flags & UART_FLAG_RUN_STANDBY) { dev(uart)->CTRLA.reg |= SERCOM_USART_CTRLA_RUNSTDBY; } -#ifdef SERCOM_USART_CTRLA_RXINV - /* COM100-61: The TXINV and RXINV bits in the CTRLA register have inverted functionality. */ - if (uart_config[uart].flags & UART_FLAG_TXINV) { - dev(uart)->CTRLA.reg |= SERCOM_USART_CTRLA_RXINV; - } -#endif -#ifdef SERCOM_USART_CTRLA_TXINV - /* COM100-61: The TXINV and RXINV bits in the CTRLA register have inverted functionality. */ - if (uart_config[uart].flags & UART_FLAG_RXINV) { - dev(uart)->CTRLA.reg |= SERCOM_USART_CTRLA_TXINV; - } -#endif /* calculate and set baudrate */ _set_baud(uart, baudrate);