blob: a28fe94fedb67ddbb21496c8181029007d7d9ffb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
/* sys/sio.h -- Utility methods to read/write the SIO
Copyright 2000 Free Software Foundation, Inc.
Written by Stephane Carrez (stcarrez@worldnet.fr)
This file is part of GEL.
GEL is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GEL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GEL; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifndef _SYS_SIO_H
#define _SYS_SIO_H
#include <sys/param.h>
#include <sys/ports.h>
#ifdef __cplusplus
extern "C" {
#endif
extern void serial_init (void);
/* Return != 0 if there is something to read on the serial line. */
extern unsigned char serial_receive_pending (void);
/* Wait until the SIO has finished to send the character. */
extern void serial_flush (void);
/* Return != 0 if serial port is ready to send another char. */
extern unsigned char serial_send_ready (void);
/* Send the character on the serial line. */
extern void serial_send (char c);
/* Wait for a character on the serial line and return it. */
extern unsigned char serial_recv (void);
/** Write the string on the serial line.
@param msg null terminated string to write.
@see serial_init, serial_send
*/
extern void serial_print (const char *msg);
/** Wait for a string from serial line.
@param msg buffer that will hold the string.
@see serial_init, serial_recv
*/
extern void serial_getline (char *buf);
#ifdef mc6811
//# include <asm-m68hc11/sio.h>
#endif
#ifdef mc68hcs12
# include <asm-m68hcs12/sio.h>
#elif defined(mc6812)
//# include <asm-m68hc12/sio.h>
#endif
#ifdef __cplusplus
};
#endif
#endif /* _SYS_SIO_H */
|