Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:47

0001 /*
0002  *  Multi UART console serial I/O.
0003  *
0004  *  TO DO: Add DMA input/output
0005  *
0006  *  The license and distribution terms for this file may be
0007  *  found in the file LICENSE in this distribution or at
0008  *  http://www.rtems.org/license/LICENSE.
0009  */
0010 
0011 #include <stdio.h>
0012 #include <fcntl.h>
0013 #include <rtems/libio.h>
0014 #include <rtems/termiostypes.h>
0015 #include <termios.h>
0016 #include <bsp.h>
0017 #include <malloc.h>
0018 
0019 #include <rtems/bspIo.h>
0020 
0021 static void _BSP_null_char(char c)
0022 {
0023   rtems_interrupt_level level=UART0_IRQ_LEVEL;
0024 
0025   rtems_interrupt_disable(level);
0026   while ((MCF_UART_USR(CONSOLE_PORT) & MCF_UART_USR_TXRDY) == 0)
0027     continue;
0028   MCF_UART_UTB(CONSOLE_PORT) = c;
0029   while ((MCF_UART_USR(CONSOLE_PORT) & MCF_UART_USR_TXRDY) == 0)
0030     continue;
0031   rtems_interrupt_enable(level);
0032 }
0033 
0034 BSP_output_char_function_type     BSP_output_char = _BSP_null_char;
0035 BSP_polling_getchar_function_type BSP_poll_char = NULL;