source: rtems/c/src/lib/libbsp/arm/raspberrypi/console/console-config.c @ 6b5df95

5
Last change on this file since 6b5df95 was 6b5df95, checked in by YANG Qiao <yangqiao0505@…>, on 08/12/15 at 22:06:49

arm/raspberrypi: add fbcons support for rpi bsp

  • Property mode set to 100644
File size: 1.6 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup raspberrypi_usart
5 *
6 * @brief Console Configuration.
7 */
8
9/*
10 * Copyright (c) 2015 Yang Qiao
11 * based on work by:
12 * Copyright (c) 2013 Alan Cudmore
13 *
14 *  The license and distribution terms for this file may be
15 *  found in the file LICENSE in this distribution or at
16 *
17 *  http://www.rtems.org/license/LICENSE
18 *
19 */
20
21#include <rtems/bspIo.h>
22
23#include <libchip/serial.h>
24
25#include <bspopts.h>
26#include <bsp/irq.h>
27#include <bsp/usart.h>
28#include <bsp/raspberrypi.h>
29#include <bsp/fbcons.h>
30
31console_tbl Console_Configuration_Ports [] = {
32    {
33      .sDeviceName = "/dev/ttyS0",
34      .deviceType = SERIAL_CUSTOM,
35      .pDeviceFns = &bcm2835_usart_fns,
36      .deviceProbe = NULL,
37      .pDeviceFlow = NULL,
38      .ulCtrlPort1 = BCM2835_UART0_BASE,
39      .ulCtrlPort2 = 0,
40      .ulClock = USART0_DEFAULT_BAUD,
41      .ulIntVector = BCM2835_IRQ_ID_UART
42    },
43    {
44      .sDeviceName ="/dev/fbcons",
45      .deviceType = SERIAL_CUSTOM,
46      .pDeviceFns = &fbcons_fns,
47      .deviceProbe = fbcons_probe,
48      .pDeviceFlow = NULL,
49    },
50};
51
52#define PORT_COUNT \
53  (sizeof(Console_Configuration_Ports) \
54    / sizeof(Console_Configuration_Ports [0]))
55
56unsigned long Console_Configuration_Count = PORT_COUNT;
57
58static void output_char(char c)
59{
60  const console_fns *con =
61    Console_Configuration_Ports [Console_Port_Minor].pDeviceFns;
62
63  if (c == '\n') {
64    con->deviceWritePolled((int) Console_Port_Minor, '\r');
65  }
66  con->deviceWritePolled((int) Console_Port_Minor, c);
67}
68
69BSP_output_char_function_type BSP_output_char = output_char;
70
71BSP_polling_getchar_function_type BSP_poll_char = NULL;
Note: See TracBrowser for help on using the repository browser.