xref: /original-bsd/sys/news3400/sio/scc.h (revision 42f60e33)
1 /*
2  * Copyright (c) 1992 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * This code is derived from software contributed to Berkeley by
6  * Sony Corp. and Kazumasa Utashiro of Software Research Associates, Inc.
7  *
8  * %sccs.include.redist.c%
9  *
10  * from: $Hdr: scc.h,v 4.300 91/06/09 06:44:56 root Rel41 $ SONY
11  *
12  *	@(#)scc.h	7.2 (Berkeley) 03/10/93
13  */
14 
15 #ifdef news3400
16 #define	splscc		spl4
17 #endif
18 
19 #define	SCCWAIT		DELAY(2)
20 
21 #define SCC_REMOTE0	0
22 #define SCC_REMOTE1	1
23 #define SCC_REMOTE2	2
24 #define SCC_REMOTE3	3
25 #define SCC_REMOTE4	4
26 #define SCC_REMOTE5	5
27 #define SCC_REMOTE6	6
28 #define SCC_REMOTE7	7
29 #define SCC_REMOTE8	8
30 #define SCC_REMOTE9	9
31 
32 #define	SCCVEC0		64
33 #define	SCCVEC1		(SCCVEC0+16)
34 #define SCCVEC2		(SCCVEC0+32)
35 #define SCCVEC3		(SCCVEC0+48)
36 #define SCCVEC4		(SCCVEC0+64)
37 
38 /*
39  *	SCC channel control block
40  */
41 typedef struct scc_dma {
42 	char	*dma_addr;
43 	int	dma_count;
44 } Scc_dma;
45 
46 typedef struct scc_channel {
47 	int	scc_status;		/* channel status		*/
48 	int	scc_param;		/* channel parameter		*/
49 	struct	scc_reg	*scc_port;	/* port address			*/
50 	char	*scc_init;		/* initialize data		*/
51 	int	scc_vec;		/* interrupt vector		*/
52 	Scc_dma	x_dma;
53 	Scc_dma	r_dma;
54 } Scc_channel;
55 
56 /*
57  *	SCC channel status
58  */
59 #define	OACTIVE		0x00000001	/* transmit in progress	*/
60 #define	OSTOP		0x00000002	/* output stop request	*/
61 #define	OFLUSH		0x00000004	/* output flush request	*/
62 #define	OBUSY		0x00000008	/* output in use	*/
63 #define LINE_BREAK	0x00000010	/* line break interrupt	*/
64 #define	ENABLE		0x00000020	/* receiver enable	*/
65 #define	CHAN_ACTIVE	0x80000000	/* channel active	*/
66 
67 /*
68  *	SCC channel usage
69  */
70 #define	SCC_MOUSE	0
71 #define	SCC_KEYBOARD	1
72