[riot-notifications] [RIOT-OS/RIOT] UART driver doesn't support more advanced configuration? (#10814)

Yegor Yefremov notifications at github.com
Sat Jan 19 14:35:54 CET 2019


Pin inversion can be implemented the same way as hardware flow control is made for STM32. Take a look at the `uart_conf_t` structure. RTS/CTS pinmux and initialization are controlled via `MODULE_STM32_PERIPH_UART_HW_FC` macro. So another macro like `MODULE_STM32_PERIPH_UART_PIN_INVERSION ` as also `uint8_t  rx_inv, tx_inv` can be introduced to enable this functionality.

Also, take a look at @haukepetersen [comment ](https://github.com/RIOT-OS/RIOT/pull/5899#issuecomment-451864097) about enabling hw flow control in the `uart_mode()` routine.

```
/**
 * @brief   Structure for UART configuration data
 */
typedef struct {
    USART_TypeDef *dev;     /**< UART device base register address */
    uint32_t rcc_mask;      /**< bit in clock enable register */
    gpio_t rx_pin;          /**< RX pin */
    gpio_t tx_pin;          /**< TX pin */
#ifndef CPU_FAM_STM32F1
    gpio_af_t rx_af;        /**< alternate function for RX pin */
    gpio_af_t tx_af;        /**< alternate function for TX pin */
#endif
    uint8_t bus;            /**< APB bus */
    uint8_t irqn;           /**< IRQ channel */
#ifdef MODULE_STM32_PERIPH_UART_HW_FC
    gpio_t cts_pin;         /**< CTS pin - set to GPIO_UNDEF when not using HW flow control */
    gpio_t rts_pin;         /**< RTS pin */
#ifndef CPU_FAM_STM32F1
    gpio_af_t cts_af;       /**< alternate function for CTS pin */
    gpio_af_t rts_af;       /**< alternate function for RTS pin */
#endif
#endif
#if defined(CPU_FAM_STM32L0) || defined(CPU_FAM_STM32L4)
    uart_type_t type;       /**< hardware module type (USART or LPUART) */
    uint32_t clk_src;       /**< clock source used for UART */
#endif
#ifdef MODULE_PERIPH_DMA
    dma_t dma;              /**< Logical DMA stream used for TX */
    uint8_t dma_chan;       /**< DMA channel used for TX */
#endif
} uart_conf_t;



```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/issues/10814#issuecomment-455780866
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190119/1a78ea77/attachment.html>


More information about the notifications mailing list