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

4.104.114.84.95
Last change on this file since b4a45795 was b4a45795, checked in by Joel Sherrill <joel.sherrill@…>, on 10/12/01 at 20:59:42

2001-10-12 Joel Sherrill <joel@…>

  • console/console-io.c: Fixed typo.
  • 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 erc32.
4 *
5 *  COPYRIGHT (c) 1989-1997.
6 *  On-Line Applications Research Corporation (OAR).
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.OARcorp.com/rtems/license.html.
11 *
12 *  $Id$
13 */
14
15#include <bsp.h>
16#include <rtems/libio.h>
17#include <stdlib.h>
18#include <assert.h>
19
20/* external prototypes for monitor interface routines */
21
22extern int armulator_stdin;
23extern int armulator_stdout;
24extern int armulator_stderr;
25
26/*
27 *  console_initialize_hardware
28 *
29 *  This routine initializes the console hardware.
30 *
31 */
32
33void console_initialize_hardware(void)
34{
35  return;
36}
37
38/*
39 *  console_outbyte_polled
40 *
41 *  This routine transmits a character using polling.
42 */
43
44void console_outbyte_polled(
45  int  port,
46  char ch
47)
48{
49  int nwritten;
50  int _swiwrite (int, char *, int);
51
52  nwritten = _swiwrite (armulator_stdout, &ch , 1);
53
54  /* error if (nwritten == -1 || nwritten == len) */
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  int nread;
68  char c;
69  int _swiread (int, char *, int);
70
71  nread = _swiread (armulator_stdin, &c, 1);
72  if ( nread != 1 )
73    return -1;
74
75  return c;
76}
77
78#include <bspIo.h>
79
80void Armulator_BSP_output_char(char c) { console_outbyte_polled( 0, c ); }
81
82BSP_output_char_function_type           BSP_output_char = Armulator_BSP_output_char;
83BSP_polling_getchar_function_type       BSP_poll_char = NULL;
84
Note: See TracBrowser for help on using the repository browser.