Skip to content

Commit

Permalink
[BACKPORT] stm32l4:serial add HW HS on UART 4 & 5
Browse files Browse the repository at this point in the history
  • Loading branch information
davids5 authored and dagar committed Aug 1, 2019
1 parent 4380c12 commit b4013dc
Showing 1 changed file with 15 additions and 22 deletions.
37 changes: 15 additions & 22 deletions arch/arm/src/stm32l4/stm32l4_serial.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/****************************************************************************
* arch/arm/src/stm32l4/stm32l4_serial.c
*
* Copyright (C) 2009-2014, 2016-2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <[email protected]>
* Copyright (C) 2009-2014, 2016-2017,2019 Gregory Nutt. All rights reserved.
* Authors: Gregory Nutt <[email protected]>
* David Sidrane <[email protected]>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -642,23 +643,19 @@ static struct stm32l4_serial_s g_uart4priv =
.parity = CONFIG_UART4_PARITY,
.bits = CONFIG_UART4_BITS,
.stopbits2 = CONFIG_UART4_2STOP,
#ifdef CONFIG_SERIAL_IFLOWCONTROL
.iflow = false,
#if defined(CONFIG_SERIAL_OFLOWCONTROL) && defined(CONFIG_UART4_OFLOWCONTROL)
.oflow = true,
.cts_gpio = GPIO_UART4_CTS,
#endif
#ifdef CONFIG_SERIAL_OFLOWCONTROL
.oflow = false,
#if defined(CONFIG_SERIAL_IFLOWCONTROL) && defined(CONFIG_UART4_IFLOWCONTROL)
.iflow = true,
.rts_gpio = GPIO_UART4_RTS,
#endif
.baud = CONFIG_UART4_BAUD,
.apbclock = STM32L4_PCLK1_FREQUENCY,
.usartbase = STM32L4_UART4_BASE,
.tx_gpio = GPIO_UART4_TX,
.rx_gpio = GPIO_UART4_RX,
#ifdef CONFIG_SERIAL_OFLOWCONTROL
.cts_gpio = 0,
#endif
#ifdef CONFIG_SERIAL_IFLOWCONTROL
.rts_gpio = 0,
#endif
#ifdef CONFIG_UART4_RXDMA
.rxdma_channel = DMAMAP_UART4_RX,
.rxfifo = g_uart4rxfifo,
Expand Down Expand Up @@ -707,23 +704,19 @@ static struct stm32l4_serial_s g_uart5priv =
.parity = CONFIG_UART5_PARITY,
.bits = CONFIG_UART5_BITS,
.stopbits2 = CONFIG_UART5_2STOP,
#ifdef CONFIG_SERIAL_IFLOWCONTROL
.iflow = false,
#if defined(CONFIG_SERIAL_OFLOWCONTROL) && defined(CONFIG_UART5_OFLOWCONTROL)
.oflow = true,
.cts_gpio = GPIO_UART5_CTS,
#endif
#ifdef CONFIG_SERIAL_OFLOWCONTROL
.oflow = false,
#if defined(CONFIG_SERIAL_IFLOWCONTROL) && defined(CONFIG_UART5_IFLOWCONTROL)
.iflow = true,
.rts_gpio = GPIO_UART5_RTS,
#endif
.baud = CONFIG_UART5_BAUD,
.apbclock = STM32L4_PCLK1_FREQUENCY,
.usartbase = STM32L4_UART5_BASE,
.tx_gpio = GPIO_UART5_TX,
.rx_gpio = GPIO_UART5_RX,
#ifdef CONFIG_SERIAL_OFLOWCONTROL
.cts_gpio = 0,
#endif
#ifdef CONFIG_SERIAL_IFLOWCONTROL
.rts_gpio = 0,
#endif
#ifdef CONFIG_UART5_RXDMA
.rxdma_channel = DMAMAP_UART5_RX,
.rxfifo = g_uart5rxfifo,
Expand Down

0 comments on commit b4013dc

Please sign in to comment.