You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2020/08/06 06:04:22 UTC
[incubator-nuttx] 05/11: stm32h7 serial:Add SINGLEWIRE PUSHPULL
option
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 48c81522f9bf0e1396581ddfac79249907b89c2b
Author: David Sidrane <Da...@NscDg.com>
AuthorDate: Tue Aug 4 06:41:02 2020 -0700
stm32h7 serial:Add SINGLEWIRE PUSHPULL option
---
arch/arm/src/stm32h7/stm32_serial.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/arm/src/stm32h7/stm32_serial.c b/arch/arm/src/stm32h7/stm32_serial.c
index 5fd6f61..2a0e9ef 100644
--- a/arch/arm/src/stm32h7/stm32_serial.c
+++ b/arch/arm/src/stm32h7/stm32_serial.c
@@ -1531,7 +1531,9 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
if ((arg & SER_SINGLEWIRE_ENABLED) != 0)
{
- uint32_t gpio_val = GPIO_OPENDRAIN;
+ uint32_t gpio_val = (arg & SER_SINGLEWIRE_PUSHPULL) ==
+ SER_SINGLEWIRE_PUSHPULL ?
+ GPIO_PUSHPULL : GPIO_OPENDRAIN;
gpio_val |= (arg & SER_SINGLEWIRE_PULL_MASK) == SER_SINGLEWIRE_PULLUP ? GPIO_PULLUP : GPIO_FLOAT;
gpio_val |= (arg & SER_SINGLEWIRE_PULL_MASK) == SER_SINGLEWIRE_PULLDOWN ? GPIO_PULLDOWN : GPIO_FLOAT;
stm32_configgpio((priv->tx_gpio & ~(GPIO_PUPD_MASK | GPIO_OPENDRAIN)) | gpio_val);