Push single wire operations into stm32_serial.c and added a test to verify HoTT telemetry setup.

This commit is contained in:
Simon Wilks
2012-12-06 17:24:27 +01:00
parent 451ecc1bf4
commit 097aeddcad
5 changed files with 263 additions and 0 deletions
+21
View File
@@ -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:
{
+1
View File
@@ -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: