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:21 UTC

[incubator-nuttx] 04/11: stm32f7 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 d61f14dd3c1599c013112e12c37e6a9bc8c1d6cc
Author: David Sidrane <Da...@NscDg.com>
AuthorDate: Tue Aug 4 06:40:45 2020 -0700

    stm32f7 serial:Add SINGLEWIRE PUSHPULL option
---
 arch/arm/src/stm32f7/stm32_serial.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm/src/stm32f7/stm32_serial.c b/arch/arm/src/stm32f7/stm32_serial.c
index a1667b2..18fac84 100644
--- a/arch/arm/src/stm32f7/stm32_serial.c
+++ b/arch/arm/src/stm32f7/stm32_serial.c
@@ -2437,7 +2437,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) ==