source: rtems/c/src/lib/libbsp/or1k/generic_or1k/console/console-config.c @ 3d597c0

4.115
Last change on this file since 3d597c0 was 3d597c0, checked in by Hesham ALMatary <heshamelmatary@…>, on 04/18/15 at 16:25:51

Rename or1ksim BSP to generic_or1k

or1ksim BSP was initially named after or1ksim simulator, and it was
intented to only run there. But now it can also run on QEMU, jor1k and
real FPGA boards without modifications. It makes more sense to give
it a new generic name like generic_or1k.

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