source: trunk/libs/newlib/src/newlib/libc/sys/sysnec810/write.c @ 577

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

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

File size: 598 bytes
Line 
1static volatile char *data = (char *)(0x20);
2static volatile char *control = (char *)(0x24);
3
4extern void _outb (volatile char*, unsigned char);
5extern unsigned char _inb (volatile char*);
6
7static unsigned char
8 read_scc_reg (unsigned char n)
9{
10  _outb (control, n);
11  return _inb(control);
12}
13
14static void write_scc_data (unsigned char n)
15{
16  _outb (data, n);
17}
18
19int
20_write (int dev, void *buf, unsigned int len)
21{
22  int i;
23  char *string = (char*)buf;
24
25  for (i = 0; i < len; i++) 
26    {
27      int j;
28
29      for (j = 0 ; j < 5000; j++)
30        ;
31      write_scc_data (string[i]);
32
33    }
34  return len;
35}
36
Note: See TracBrowser for help on using the repository browser.