source: rtems/c/src/lib/libbsp/or1k/or1ksim/console/console-config.c @ fd57015

4.115
Last change on this file since fd57015 was fd57015, checked in by Hesham ALMatary <heshamelmatary@…>, on 08/20/14 at 17:23:20

Add new (first) OpenRISC BSP called or1ksim.

This BSP is intended to run on or1ksim (the main OpenRISC emulator).
Fixed version according to Joel comments from the mailing list.

  • Property mode set to 100644
File size: 1.3 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup or1ksim_uart
5 *
6 * @brief Console Configuration.
7 */
8
9/*
10 * Copyright (c) 2014 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/or1ksim.h>
24
25console_tbl Console_Configuration_Ports [] = {
26    {
27      .sDeviceName = "/dev/ttyS0",
28      .deviceType = SERIAL_CUSTOM,
29      .pDeviceFns = &or1ksim_uart_fns,
30      .deviceProbe = NULL,
31      .pDeviceFlow = NULL,
32      .ulCtrlPort1 = OR1KSIM_BSP_UART_BASE,
33      .ulCtrlPort2 = 0,
34      .ulClock = OR1KSIM_UART_DEFAULT_BAUD,
35      .ulIntVector = OR1KSIM_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.