mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 17:48:54 +08:00
stm32 serial:Add SINGLEWIRE PUSHPULL option
This commit is contained in:
committed by
Xiang Xiao
parent
5a76767cd7
commit
749dbce431
@@ -1980,7 +1980,9 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
|
|||||||
#else
|
#else
|
||||||
if ((arg & SER_SINGLEWIRE_ENABLED) != 0)
|
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) ==
|
gpio_val |= ((arg & SER_SINGLEWIRE_PULL_MASK) ==
|
||||||
SER_SINGLEWIRE_PULLUP) ? GPIO_PULLUP
|
SER_SINGLEWIRE_PULLUP) ? GPIO_PULLUP
|
||||||
: GPIO_FLOAT;
|
: GPIO_FLOAT;
|
||||||
|
|||||||
Reference in New Issue
Block a user