source: rtems/c/src/lib/libbsp/arm/raspberrypi/console/console-config.c @ 8ac62c4

4.115
Last change on this file since 8ac62c4 was c32b1ef, checked in by Alan Cudmore <alan.cudmore@…>, on 03/23/13 at 18:13:07

bsp/raspberrypi: New BSP

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