OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [c/] [src/] [lib/] [libbsp/] [arm/] [armulator/] [console/] [console-io.c] - Blame information for rev 1026

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
/*
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
 *  console-io.c,v 1.4 2002/01/04 17:40:39 joel Exp
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
 
22
extern int armulator_stdin;
23
extern int armulator_stdout;
24
extern int armulator_stderr;
25
 
26
/*
27
 *  console_initialize_hardware
28
 *
29
 *  This routine initializes the console hardware.
30
 *
31
 */
32
 
33
void 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
 
44
void 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
 
63
int 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 <rtems/bspIo.h>
79
 
80
void Armulator_BSP_output_char(char c) { console_outbyte_polled( 0, c ); }
81
 
82
BSP_output_char_function_type           BSP_output_char = Armulator_BSP_output_char;
83
BSP_polling_getchar_function_type       BSP_poll_char = NULL;
84
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.