Back to home page

LXR

 
 

    


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

0001 /*
0002  * Copyright (c) 2013 Eugeniy Meshcheryakov <eugen@debian.org>
0003  *
0004  * Copyright (c) 2011 Sebastian Huber.  All rights reserved.
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 <rtems/bspIo.h>
0012 
0013 #include <libchip/serial.h>
0014 
0015 #include <bspopts.h>
0016 #include <bsp/irq.h>
0017 #include <bsp/uart.h>
0018 #include <bsp/lm3s69xx.h>
0019 
0020 console_tbl Console_Configuration_Ports [] = {
0021   #ifdef LM3S69XX_ENABLE_UART_0
0022     {
0023       .sDeviceName = "/dev/ttyS0",
0024       .deviceType = SERIAL_CUSTOM,
0025       .pDeviceFns = &lm3s69xx_uart_fns,
0026       .ulCtrlPort1 = LM3S69XX_UART_0_BASE,
0027       .ulClock = LM3S69XX_UART_BAUD,
0028       .ulIntVector = LM3S69XX_IRQ_UART_0,
0029       .pDeviceParams = (void *)0
0030     },
0031   #endif
0032   #ifdef LM3S69XX_ENABLE_UART_1
0033     {
0034       .sDeviceName = "/dev/ttyS1",
0035       .deviceType = SERIAL_CUSTOM,
0036       .pDeviceFns = &lm3s69xx_uart_fns,
0037       .ulCtrlPort1 = LM3S69XX_UART_1_BASE,
0038       .ulClock = LM3S69XX_UART_BAUD,
0039       .ulIntVector = LM3S69XX_IRQ_UART_1,
0040       .pDeviceParams = (void *)1
0041     },
0042   #endif
0043   #ifdef LM3S69XX_ENABLE_UART_2
0044     {
0045       .sDeviceName = "/dev/ttyS2",
0046       .deviceType = SERIAL_CUSTOM,
0047       .pDeviceFns = &lm3s69xx_uart_fns,
0048       .ulCtrlPort1 = LM3S69XX_UART_2_BASE,
0049       .ulClock = LM3S69XX_UART_BAUD,
0050       .ulIntVector = LM3S69XX_IRQ_UART_2,
0051       .pDeviceParams = (void *)2
0052     }
0053   #endif
0054 };
0055 
0056 #define PORT_COUNT \
0057   (sizeof(Console_Configuration_Ports) \
0058     / sizeof(Console_Configuration_Ports [0]))
0059 
0060 unsigned long Console_Configuration_Count = PORT_COUNT;
0061 
0062 static void output_char(char c)
0063 {
0064   const console_fns *con =
0065     Console_Configuration_Ports [Console_Port_Minor].pDeviceFns;
0066 
0067   con->deviceWritePolled((int) Console_Port_Minor, c);
0068 }
0069 
0070 BSP_output_char_function_type BSP_output_char = output_char;
0071 
0072 BSP_polling_getchar_function_type BSP_poll_char = NULL;