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:23 UTC
[incubator-nuttx] 06/11: stm32l4 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 579fbe2e52e83f6bbf092d3d474b7869bbdbfc96
Author: David Sidrane <Da...@NscDg.com>
AuthorDate: Tue Aug 4 06:41:27 2020 -0700
stm32l4 serial:Add SINGLEWIRE PUSHPULL option
---
arch/arm/src/stm32l4/stm32l4_serial.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/arm/src/stm32l4/stm32l4_serial.c b/arch/arm/src/stm32l4/stm32l4_serial.c
index 89c607b..1d6c7a8 100644
--- a/arch/arm/src/stm32l4/stm32l4_serial.c
+++ b/arch/arm/src/stm32l4/stm32l4_serial.c
@@ -1873,7 +1873,9 @@ static int stm32l4serial_ioctl(FAR struct file *filep, int cmd,
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;