[riot-notifications] [RIOT-OS/RIOT] cpu/stm32_common: enable UART pin inversion (#10937)

Yegor Yefremov notifications at github.com
Mon Feb 4 09:36:33 CET 2019


### Contribution description

Some STM32 UARTs provide pin inversion option. Add related
fields to the uart_conf_t struct, that allow separate inversion
configuration.

MODULE_STM32_PERIPH_UART_PIN_INVERSION macro enables this feature
and USART_CR2_RXINV macro ensures that particular platform supports
pin inversion.

### Testing procedure

    {
          .dev        = USART6,
          .rcc_mask   = RCC_APB2ENR_USART6EN,
          .rx_pin     = GPIO_PIN(PORT_G, 9),
          .tx_pin     = GPIO_PIN(PORT_G, 14),
          .rx_af      = GPIO_AF8,
          .tx_af      = GPIO_AF8,
#ifdef MODULE_STM32_PERIPH_UART_PIN_INVERSION
          .rx_pin_inv = 1, /* invert RX pin */
          .tx_pin_inv = 0,
#endif
          .bus        = APB2,
          .irqn       = USART6_IRQn,
  #ifdef UART_USE_DMA
          .dma_stream = 5,
          .dma_chan   = 4
  #endif
      },


### Issues/PRs references

Fixes: #10935
You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/10937

-- Commit Summary --

  * cpu/stm32_common: enable UART pin inversion

-- File Changes --

    M cpu/stm32_common/include/periph_cpu_common.h (4)
    M cpu/stm32_common/periph/uart.c (7)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/10937.patch
https://github.com/RIOT-OS/RIOT/pull/10937.diff

-- 
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/pull/10937
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190204/bd65f857/attachment.html>


More information about the notifications mailing list