source: trunk/libs/newlib/src/libgloss/mcore/cmb-outbyte.c @ 444

Last change on this file since 444 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 1.2 KB
Line 
1/* 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 */
35void
36outbyte (char ch)
37{
38    while (!(*SRREG & TRDY))
39        ;
40    *TXREG = GDB_QUOTE_CHAR;
41
42    while (!(*SRREG & TRDY))
43        ;
44    *TXREG = (unsigned short)ch;
45}
Note: See TracBrowser for help on using the repository browser.