mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 06:33:33 +08:00
Push single wire operations into stm32_serial.c and added a test to verify HoTT telemetry setup.
This commit is contained in:
@@ -1307,6 +1307,27 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
|
||||
}
|
||||
break;
|
||||
|
||||
/* Set RS485 mode */
|
||||
case TIOCSRS485:
|
||||
{
|
||||
/* Change the TX port to be open-drain/push-pull */
|
||||
if (arg == SER_RS485_ENABLED) {
|
||||
stm32_configgpio(priv->tx_gpio | GPIO_OPENDRAIN);
|
||||
} else {
|
||||
stm32_configgpio(priv->tx_gpio | GPIO_PUSHPULL);
|
||||
}
|
||||
|
||||
/* Enable/disable half-duplex mode */
|
||||
uint32_t cr = up_serialin(priv, STM32_USART_CR3_OFFSET);
|
||||
if (arg == SER_RS485_ENABLED) {
|
||||
cr |= (USART_CR3_HDSEL);
|
||||
} else {
|
||||
cr &= ~(USART_CR3_HDSEL);
|
||||
}
|
||||
up_serialout(priv, STM32_USART_CR3_OFFSET, cr);
|
||||
}
|
||||
break;
|
||||
|
||||
#ifdef CONFIG_SERIAL_TERMIOS
|
||||
case TCGETS:
|
||||
{
|
||||
|
||||
@@ -687,6 +687,7 @@ static int uart_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
|
||||
*(int *)arg = count;
|
||||
}
|
||||
break;
|
||||
|
||||
#ifdef CONFIG_SERIAL_TERMIOS
|
||||
case TCGETS:
|
||||
|
||||
Reference in New Issue
Block a user