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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib/] [libgloss/] [mcore/] [cmb-outbyte.c] - Blame information for rev 57

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

Line No. Rev Author Line
1 56 joel
/* cmb-outbyte.c -- outbyte function for CMB1200 eval board.
2
 *
3
 * Copyright (c) 1999 Cygnus Support
4
 *
5
 * The authors hereby grant permission to use, copy, modify, distribute,
6
 * and license this software and its documentation for any purpose, provided
7
 * that existing copyright notices are retained in all copies and that this
8
 * notice is included verbatim in any distributions. No written agreement,
9
 * license, or royalty fee is required for any of the authorized uses.
10
 * Modifications to this software may be copyrighted by their authors
11
 * and need not follow the licensing terms described here, provided that
12
 * the new terms are clearly indicated on the first page of each file where
13
 * they apply.
14
 */
15
#include <_ansi.h>
16
 
17
#define _TX  0x40
18
#define _SR  0x86
19
 
20
#define UART0_BASE 0x10009000
21
#define UART1_BASE 0x1000a000
22
 
23
#define UART_BASE UART0_BASE
24
 
25
#define TXREG ((volatile unsigned short *)(UART_BASE + _TX))
26
#define SRREG ((volatile unsigned short *)(UART_BASE + _SR))
27
 
28
#define TRDY  0x2000
29
 
30
#define GDB_QUOTE_CHAR 15  /* ^O */
31
 
32
/*
33
 * outbyte -- send a byte to the UART.
34
 */
35
void
36
_DEFUN (outbyte, (ch),
37
        char ch)
38
{
39
    while (!(*SRREG & TRDY))
40
        ;
41
    *TXREG = GDB_QUOTE_CHAR;
42
 
43
    while (!(*SRREG & TRDY))
44
        ;
45
    *TXREG = (unsigned short)ch;
46
}

powered by: WebSVN 2.1.0

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