source: rtems/c/src/lib/libbsp/mips/csb350/console/console-io.c @ 9b4422a2

4.115
Last change on this file since 9b4422a2 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 1.6 KB
Line 
1/*
2 *  This file contains the hardware specific portions of the TTY driver
3 *  for the serial ports on the csb350.
4 *
5 *  Logic based on the jmr3904-io.c file in newlib 1.8.2
6 *
7 *  COPYRIGHT (c) 1989-2000.
8 *  On-Line Applications Research Corporation (OAR).
9 *
10 *  The license and distribution terms for this file may be
11 *  found in the file LICENSE in this distribution or at
12 *  http://www.rtems.com/license/LICENSE.
13 */
14
15#include <bsp.h>
16#include <rtems/libio.h>
17#include <libcpu/au1x00.h>
18
19/*
20 *  console_initialize_hardware
21 *
22 *  This routine initializes the console hardware.
23 *
24 */
25
26void console_initialize_hardware(void)
27{
28    uart0->fifoctrl = 0xf1;   /* enable fifo, max sizes */
29    au_sync();
30}
31
32
33/*
34 *  console_outbyte_polled
35 *
36 *  This routine transmits a character using polling.
37 */
38
39void console_outbyte_polled(
40  int  port,
41  char ch
42)
43{
44    /* wait for the fifo to make room */
45    while ((uart0->linestat & 0x20) == 0) {
46        continue;
47    }
48
49    uart0->txdata = ch;
50    au_sync();
51}
52
53/*
54 *  console_inbyte_nonblocking
55 *
56 *  This routine polls for a character.
57 */
58
59int console_inbyte_nonblocking(
60  int port
61)
62{
63  unsigned char c;
64
65  if (uart0->linestat & 1) {
66      c = (char)uart0->rxdata;
67      return c;
68  } else {
69      return -1;
70  }
71}
72
73#include <rtems/bspIo.h>
74
75void csb250_output_char(char c)
76{
77    console_outbyte_polled( 0, c );
78    if (c == '\n') {
79        console_outbyte_polled( 0, '\r' );
80    }
81}
82
83int csb250_get_char(void)
84{
85  return console_inbyte_nonblocking(0);
86}
87
88BSP_output_char_function_type           BSP_output_char = csb250_output_char;
89BSP_polling_getchar_function_type       BSP_poll_char = csb250_get_char;
90
Note: See TracBrowser for help on using the repository browser.