source: rtems/c/src/lib/libbsp/mips/csb350/console/console-io.c @ 7cde240

4.104.114.84.95
Last change on this file since 7cde240 was 7cde240, checked in by Jay Monkman <jtm@…>, on Feb 25, 2005 at 5:18:07 AM

2005-02-24 Jay Monkman <jtm@…>

  • acinclude.m4: Added csb350 to list of BSPs.
  • csb350/Makefile.am, csb350/README, csb350/bsp_specs, csb350/configure.ac, csb350/times, csb350/clock/clockdrv.c, csb350/console/console-io.c, csb350/include/bsp.h, csb350/include/tm27.h, csb350/network/network.c, csb350/start/regs.S, csb350/start/start.S, csb350/startup/bspclean.c, csb350/startup/bspstart.c, csb350/startup/linkcmds, csb350/timer/timer.c: New BSP.
  • 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.OARcorp.com/rtems/license.html.
13 *
14 *  $Id$
15 */
16
17#include <bsp.h>
18#include <rtems/libio.h>
19#include <libcpu/au1x00.h>
20
21/*
22 *  console_initialize_hardware
23 *
24 *  This routine initializes the console hardware.
25 *
26 */
27
28void console_initialize_hardware(void)
29{
30    uart0->fifoctrl = 0xf1;   /* enable fifo, max sizes */
31    au_sync();
32}
33
34
35/*
36 *  console_outbyte_polled
37 *
38 *  This routine transmits a character using polling.
39 */
40
41void console_outbyte_polled(
42  int  port,
43  char ch
44)
45{
46    volatile int i;
47
48    /* wait for the fifo to make room */
49    while ((uart0->linestat & 0x20) == 0) {
50        continue;
51    }
52   
53    uart0->txdata = ch;
54    au_sync();
55}
56
57/*
58 *  console_inbyte_nonblocking
59 *
60 *  This routine polls for a character.
61 */
62
63int console_inbyte_nonblocking(
64  int port
65)
66{
67  unsigned char c;
68
69  if (uart0->linestat & 1) {
70      c = (char)uart0->rxdata;
71      return c;
72  } else {
73      return -1;
74  }
75}
76
77#include <rtems/bspIo.h>
78
79void csb250_output_char(char c) 
80{ 
81    console_outbyte_polled( 0, c ); 
82    if (c == '\n') {
83        console_outbyte_polled( 0, '\r' ); 
84    }
85}
86
87BSP_output_char_function_type           BSP_output_char = csb250_output_char;
88BSP_polling_getchar_function_type       BSP_poll_char = NULL;
89
Note: See TracBrowser for help on using the repository browser.