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

4.115
Last change on this file since c499856 was c499856, checked in by Chris Johns <chrisj@…>, on Mar 20, 2014 at 9:10:47 PM

Change all references of rtems.com to rtems.org.

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