summaryrefslogtreecommitdiffstats
path: root/bsps/m68k/mcf5225x/console/debugio.c
diff options
context:
space:
mode:
Diffstat (limited to 'bsps/m68k/mcf5225x/console/debugio.c')
-rw-r--r--bsps/m68k/mcf5225x/console/debugio.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/bsps/m68k/mcf5225x/console/debugio.c b/bsps/m68k/mcf5225x/console/debugio.c
new file mode 100644
index 0000000000..b91048a310
--- /dev/null
+++ b/bsps/m68k/mcf5225x/console/debugio.c
@@ -0,0 +1,35 @@
+/*
+ * Multi UART console serial I/O.
+ *
+ * TO DO: Add DMA input/output
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#include <stdio.h>
+#include <fcntl.h>
+#include <rtems/libio.h>
+#include <rtems/termiostypes.h>
+#include <termios.h>
+#include <bsp.h>
+#include <malloc.h>
+
+#include <rtems/bspIo.h>
+
+static void _BSP_null_char(char c)
+{
+ rtems_interrupt_level level=UART0_IRQ_LEVEL;
+
+ rtems_interrupt_disable(level);
+ while ((MCF_UART_USR(CONSOLE_PORT) & MCF_UART_USR_TXRDY) == 0)
+ continue;
+ MCF_UART_UTB(CONSOLE_PORT) = c;
+ while ((MCF_UART_USR(CONSOLE_PORT) & MCF_UART_USR_TXRDY) == 0)
+ continue;
+ rtems_interrupt_enable(level);
+}
+
+BSP_output_char_function_type BSP_output_char = _BSP_null_char;
+BSP_polling_getchar_function_type BSP_poll_char = NULL;