source: rtems/c/src/lib/libbsp/arm/armulator/console/console-io.c @ 0fd4a13

4.104.114.84.95
Last change on this file since 0fd4a13 was caf88699, checked in by Joel Sherrill <joel.sherrill@…>, on 07/31/00 at 18:29:37

New bsp for simulator in gdb. Does not work yet.

  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*
2 *  This file contains the hardware specific portions of the TTY driver
3 *  for the serial ports on the erc32.
4 *
5 *  COPYRIGHT (c) 1989-1997.
6 *  On-Line Applications Research Corporation (OAR).
7 *  Copyright assigned to U.S. Government, 1994.
8 *
9 *  The license and distribution terms for this file may be
10 *  found in the file LICENSE in this distribution or at
11 *  http://www.OARcorp.com/rtems/license.html.
12 *
13 *  $Id$
14 */
15
16#include <bsp.h>
17#include <rtems/libio.h>
18#include <stdlib.h>
19#include <assert.h>
20
21/* external prototypes for monitor interface routines */
22
23/*
24 *  console_outbyte_polled
25 *
26 *  This routine transmits a character using polling.
27 */
28
29extern int armulator_stdin;
30extern int armulator_stdout;
31extern int armulator_stderr;
32
33void console_outbyte_polled(
34  int  port,
35  char ch
36)
37{
38  int nwritten;
39  int _swiwrite (int, char *, int);
40
41  nwritten = _swiwrite (armulator_stdout, &ch , 1);
42
43  /* error if (nwritten == -1 || nwritten == len) */
44}
45
46/*
47 *  console_inbyte_nonblocking
48 *
49 *  This routine polls for a character.
50 */
51
52int console_inbyte_nonblocking(
53  int port
54)
55{
56  int nread;
57  char c;
58  int _swiread (int, char *, int);
59
60  nread = _swiread (armulator_stdin, &c, 1);
61  if ( nread != 1 )
62    return -1;
63
64  return c;
65}
66
67#include <bspIo.h>
68
69void Armulator_BSP_output_char(char c) { console_outbyte_polled( 0, c ); }
70
71BSP_output_char_function_type           BSP_output_char = Armulator_BSP_output_char;
72BSP_polling_getchar_function_type       BSP_poll_char = NULL;
73
Note: See TracBrowser for help on using the repository browser.