source: rtems/bsps/arm/raspberrypi/console/console-config.c @ d7d66d7

Last change on this file since d7d66d7 was d7d66d7, checked in by Sebastian Huber <sebastian.huber@…>, on Apr 19, 2018 at 4:28:01 AM

bsps: Move console drivers to bsps

This patch is a part of the BSP source reorganization.

Update #3285.

  • Property mode set to 100644
File size: 1.5 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  con->deviceWritePolled((int) Console_Port_Minor, c);
64}
65
66BSP_output_char_function_type BSP_output_char = output_char;
67
68BSP_polling_getchar_function_type BSP_poll_char = NULL;
Note: See TracBrowser for help on using the repository browser.