summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2000-10-19 15:18:20 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2000-10-19 15:18:20 +0000
commit75e8e04a1907ffd75c7d5dc8e3d2ad927b49a9ff (patch)
tree75b0153dac6a82ce9e446813ef2788550b9e72b5
parentf2442183383a7ad70f2a6bc5e8f25e200fa0f54a (diff)
downloadrtems-75e8e04a1907ffd75c7d5dc8e3d2ad927b49a9ff.tar.bz2
2000-10-18 Charles-Antoine Gauthier <charles.gauthier@nrc.ca>
* comm/uart.c (BSP_uart_init): Save more line state parameters.
-rw-r--r--c/src/lib/libbsp/i386/shared/ChangeLog4
-rw-r--r--c/src/lib/libbsp/i386/shared/comm/uart.c23
2 files changed, 26 insertions, 1 deletions
diff --git a/c/src/lib/libbsp/i386/shared/ChangeLog b/c/src/lib/libbsp/i386/shared/ChangeLog
index 8a3b0bf305..0f13f1eafc 100644
--- a/c/src/lib/libbsp/i386/shared/ChangeLog
+++ b/c/src/lib/libbsp/i386/shared/ChangeLog
@@ -1,4 +1,8 @@
+ * comm/uart.c (BSP_uart_init): Save more line state parameters.
+
+2000-10-18 Charles-Antoine Gauthier <charles.gauthier@nrc.ca>
+
* comm/i386-stub-glue.c, comm/tty_drv.c, comm/uart.c, comm/uart.h:
Add the ability to set parity, number of data bits and
number of stop bits to the existing i386 serial drivers.
diff --git a/c/src/lib/libbsp/i386/shared/comm/uart.c b/c/src/lib/libbsp/i386/shared/comm/uart.c
index 50dcd7de6a..91cb5f9be9 100644
--- a/c/src/lib/libbsp/i386/shared/comm/uart.c
+++ b/c/src/lib/libbsp/i386/shared/comm/uart.c
@@ -157,14 +157,35 @@ BSP_uart_init
tmp = uread(uart, MSR);
/* Remember state */
- uart_data[uart].hwFlow = hwFlow;
uart_data[uart].baud = baud;
+ uart_data[uart].databits = databits;
+ uart_data[uart].parity = parity;
+ uart_data[uart].stopbits = stopbits;
+ uart_data[uart].hwFlow = hwFlow;
return;
}
/*
* Set baud
*/
+
+void
+BSP_uart_set_baud(
+ int uart,
+ unsigned long baud
+)
+{
+ /* Sanity check */
+ assert(uart == BSP_UART_COM1 || uart == BSP_UART_COM2);
+
+ BSP_uart_set_attributes( uart, baud, uart_data[uart].databits,
+ uart_data[uart].parity, uart_data[uart].stopbits );
+}
+
+/*
+ * Set all attributes
+ */
+
void
BSP_uart_set_attributes
(