Home | History | Annotate | Line # | Download | only in include
mfp.h revision 1.1
      1  1.1  leo  /*	$NetBSD: mfp.h,v 1.1 1995/03/26 07:12:08 leo Exp $	*/
      2  1.1  leo 
      3  1.1  leo /*
      4  1.1  leo  * Copyright (c) 1995 Leo Weppelman.
      5  1.1  leo  * All rights reserved.
      6  1.1  leo  *
      7  1.1  leo  * Redistribution and use in source and binary forms, with or without
      8  1.1  leo  * modification, are permitted provided that the following conditions
      9  1.1  leo  * are met:
     10  1.1  leo  * 1. Redistributions of source code must retain the above copyright
     11  1.1  leo  *    notice, this list of conditions and the following disclaimer.
     12  1.1  leo  * 2. Redistributions in binary form must reproduce the above copyright
     13  1.1  leo  *    notice, this list of conditions and the following disclaimer in the
     14  1.1  leo  *    documentation and/or other materials provided with the distribution.
     15  1.1  leo  * 3. All advertising materials mentioning features or use of this software
     16  1.1  leo  *    must display the following acknowledgement:
     17  1.1  leo  *      This product includes software developed by Leo Weppelman.
     18  1.1  leo  * 4. The name of the author may not be used to endorse or promote products
     19  1.1  leo  *    derived from this software without specific prior written permission
     20  1.1  leo  *
     21  1.1  leo  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     22  1.1  leo  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     23  1.1  leo  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     24  1.1  leo  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     25  1.1  leo  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     26  1.1  leo  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     27  1.1  leo  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     28  1.1  leo  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     29  1.1  leo  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     30  1.1  leo  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     31  1.1  leo  */
     32  1.1  leo 
     33  1.1  leo #ifndef _MACHINE_MFP_H
     34  1.1  leo #define _MACHINE_MFP_H
     35  1.1  leo /*
     36  1.1  leo  * Atari TT hardware: MFP1/MFP2
     37  1.1  leo  * Motorola 68901 Multi-Function Peripheral
     38  1.1  leo  */
     39  1.1  leo 
     40  1.1  leo #define	MFP	((struct mfp *)AD_MFP)
     41  1.1  leo #define	MFP2	((struct mfp *)AD_MFP2)
     42  1.1  leo 
     43  1.1  leo struct mfp {
     44  1.1  leo 	volatile u_char	mfb[48];	/* use only the odd bytes */
     45  1.1  leo };
     46  1.1  leo 
     47  1.1  leo #define	mf_gpip		mfb[ 1]	/* general purpose I/O interrupt port	*/
     48  1.1  leo #define	mf_aer		mfb[ 3]	/* active edge register			*/
     49  1.1  leo #define	mf_ddr		mfb[ 5]	/* data direction register		*/
     50  1.1  leo #define	mf_iera		mfb[ 7]	/* interrupt enable register A		*/
     51  1.1  leo #define	mf_ierb		mfb[ 9]	/* interrupt enable register B		*/
     52  1.1  leo #define	mf_ipra		mfb[11]	/* interrupt pending register A		*/
     53  1.1  leo #define	mf_iprb		mfb[13]	/* interrupt pending register B		*/
     54  1.1  leo #define	mf_isra		mfb[15]	/* interrupt in-service register A	*/
     55  1.1  leo #define	mf_isrb		mfb[17]	/* interrupt in-service register B	*/
     56  1.1  leo #define	mf_imra		mfb[19]	/* interrupt mask register A		*/
     57  1.1  leo #define	mf_imrb		mfb[21]	/* interrupt mask register B		*/
     58  1.1  leo #define	mf_vr		mfb[23]	/* vector register			*/
     59  1.1  leo #define	mf_tacr		mfb[25]	/* timer control register A		*/
     60  1.1  leo #define	mf_tbcr		mfb[27]	/* timer control register B		*/
     61  1.1  leo #define	mf_tcdcr	mfb[29]	/* timer control register C+D		*/
     62  1.1  leo #define	mf_tadr		mfb[31]	/* timer data register A		*/
     63  1.1  leo #define	mf_tbdr		mfb[33]	/* timer data register B		*/
     64  1.1  leo #define	mf_tcdr		mfb[35]	/* timer data register C		*/
     65  1.1  leo #define	mf_tddr		mfb[37]	/* timer data register D		*/
     66  1.1  leo #define	mf_scr		mfb[39]	/* synchronous character register	*/
     67  1.1  leo #define	mf_ucr		mfb[41]	/* USART control register		*/
     68  1.1  leo #define	mf_rsr		mfb[43]	/* receiver status register		*/
     69  1.1  leo #define	mf_tsr		mfb[45]	/* transmitter status register		*/
     70  1.1  leo #define	mf_udr		mfb[47]	/* USART data register			*/
     71  1.1  leo 
     72  1.1  leo /* names of IO port bits: */
     73  1.1  leo #define	IO_PBSY		0x01	/* Parallel Busy			*/
     74  1.1  leo #define	IO_SDCD		0x02	/* Serial Data Carrier Detect		*/
     75  1.1  leo #define	IO_SCTS		0x04	/* Serial Clear To Send			*/
     76  1.1  leo /*		0x08		*//* reserved				*/
     77  1.1  leo #define	IO_AINT		0x10	/* ACIA interrupt (KB or MIDI)		*/
     78  1.1  leo #define	IO_DINT		0x20	/* DMA interrupt (FDC or HDC)		*/
     79  1.1  leo #define	IO_SRI		0x40	/* Serial Ring Indicator		*/
     80  1.1  leo #define	IO_MONO		0x80	/* Monochrome Monitor Detect		*/
     81  1.1  leo 
     82  1.1  leo /* names of interrupts in register A: MFP1 */
     83  1.1  leo #define	IA_MONO		0x80	/* IO_MONO				*/
     84  1.1  leo #define	IA_SRI		0x40	/* IO_SRI				*/
     85  1.1  leo #define	IA_TIMA		0x20	/* Timer A				*/
     86  1.1  leo #define	IA_RRDY		0x10	/* Serial Receiver Ready(=Full)		*/
     87  1.1  leo #define	IA_RERR		0x08	/* Serial Receiver Error		*/
     88  1.1  leo #define	IA_TRDY		0x04	/* Serial Transmitter Ready(=Empty)	*/
     89  1.1  leo #define	IA_TERR		0x02	/* Serial Transmitter Error		*/
     90  1.1  leo #define	IA_TIMB		0x01	/* Timer B				*/
     91  1.1  leo 
     92  1.1  leo /* names of interrupts in register A: MFP2 */
     93  1.1  leo #define	IA_SCSI		0x80	/* SCSI-controller			*/
     94  1.1  leo #define	IA_RTC		0x40	/* Real Time Clock			*/
     95  1.1  leo #define IA_TIMA2	0x20	/* Timer A				*/
     96  1.1  leo /*			0x10	*//* reserved				*/
     97  1.1  leo /*			0x08	*//* reserved				*/
     98  1.1  leo /*			0x04	*//* reserved				*/
     99  1.1  leo /*			0x02	*//* reserved				*/
    100  1.1  leo #define	IA_TIMB2	0x01	/* Timer B				*/
    101  1.1  leo 
    102  1.1  leo /* names of interrupts in register B: MFP1*/
    103  1.1  leo #define	IB_DINT		0x80	/* IO_DINT: from DMA devices		*/
    104  1.1  leo #define	IB_AINT		0x40	/* IO_AINT: from kbd or midi		*/
    105  1.1  leo #define	IB_TIMC		0x20	/* Timer C				*/
    106  1.1  leo #define	IB_TIMD		0x10	/* Timer D				*/
    107  1.1  leo /*			0x08	*//* reserved				*/
    108  1.1  leo #define	IB_SCTS		0x04	/* IO_SCTS				*/
    109  1.1  leo #define	IB_SDCD		0x02	/* IO_SDCD				*/
    110  1.1  leo #define	IB_PBSY		0x01	/* IO_PBSY				*/
    111  1.1  leo 
    112  1.1  leo /* names of interrupts in register B: MFP2*/
    113  1.1  leo #define	IB_SCDM		0x80	/* SCSI-dma				*/
    114  1.1  leo #define	IB_DCHG		0x40	/* Diskette change			*/
    115  1.1  leo /*			0x20	*//* reserved				*/
    116  1.1  leo /*			0x10	*//* reserved				*/
    117  1.1  leo #define	IB_RISB		0x80	/* Serial Ring indicator SCC port B	*/
    118  1.1  leo #define	IB_DMSC		0x40	/* SCC-dma				*/
    119  1.1  leo #define IB_J602_3	0x02	/* Pin 3 J602				*/
    120  1.1  leo #define IB_J602_1	0x01	/* Pin 1 J602				*/
    121  1.1  leo 
    122  1.1  leo /* bits in VR: */
    123  1.1  leo #define	V_S		0x08	/* software end-of-interrupt mode	*/
    124  1.1  leo #define	V_V		0xF0	/* four high bits of vector		*/
    125  1.1  leo 
    126  1.1  leo /* bits in TCR: */
    127  1.1  leo /*			0x07	*//* divider				*/
    128  1.1  leo #define	T_STOP		0x00	/* don't count				*/
    129  1.1  leo #define	T_Q004		0x01	/* divide by 4				*/
    130  1.1  leo #define	T_Q010		0x02	/* divide by 10				*/
    131  1.1  leo #define	T_Q016		0x03	/* divide by 16				*/
    132  1.1  leo #define	T_Q050		0x04	/* divide by 50				*/
    133  1.1  leo #define	T_Q064		0x05	/* divide by 64				*/
    134  1.1  leo #define	T_Q100		0x06	/* divide by 100			*/
    135  1.1  leo #define	T_Q200		0x07	/* divide by 200			*/
    136  1.1  leo #define	T_EXTI		0x08	/* use extern impulse			*/
    137  1.1  leo #define	T_LOWO		0x10	/* force output low			*/
    138  1.1  leo 
    139  1.1  leo /* bits in UCR: */
    140  1.1  leo /*			0x01	*//* not used				*/
    141  1.1  leo #define	U_EVEN		0x02	/* even parity				*/
    142  1.1  leo #define	U_PAR		0x04	/* use parity				*/
    143  1.1  leo /*		0x18		*//* sync/async and stop bits		*/
    144  1.1  leo #define	U_SYNC		0x00	/* synchrone				*/
    145  1.1  leo #define	U_ST1		0x08	/* async, 1 stop bit			*/
    146  1.1  leo #define	U_ST1_5		0x10	/* async, 1.5 stop bit			*/
    147  1.1  leo #define	U_ST2		0x18	/* async, 2 stop bits			*/
    148  1.1  leo /*		0x60		*//* number of data bits		*/
    149  1.1  leo #define	U_D8		0x00	/* 8 data bits				*/
    150  1.1  leo #define	U_D7		0x20	/* 7 data bits				*/
    151  1.1  leo #define	U_D6		0x40	/* 6 data bits				*/
    152  1.1  leo #define	U_D5		0x60	/* 5 data bits				*/
    153  1.1  leo #define	U_Q16		0x80	/* divide clock by 16			*/
    154  1.1  leo 
    155  1.1  leo /* bits in RSR: */
    156  1.1  leo #define	RS_ENA		0x01	/* Receiver Enable			*/
    157  1.1  leo #define	RS_STRIP	0x02	/* Synchronous Strip Enable		*/
    158  1.1  leo #define	RS_CIP		0x04	/* Character in Progress		*/
    159  1.1  leo #define	RS_BREAK	0x08	/* Break Detected			*/
    160  1.1  leo #define	RS_FE		0x10	/* Frame Error				*/
    161  1.1  leo #define	RS_PE		0x20	/* Parity Error				*/
    162  1.1  leo #define	RS_OE		0x40	/* Overrun Error			*/
    163  1.1  leo #define	RS_FULL		0x80	/* Buffer Full				*/
    164  1.1  leo 
    165  1.1  leo /* bits in TSR: */
    166  1.1  leo #define	TS_ENA		0x01	/* Transmitter Enable					*/
    167  1.1  leo /*			0x06	*//* state of dead transmitter output	*/
    168  1.1  leo #define	TS_TRI		0x00	/* Quiet Output Tristate		*/
    169  1.1  leo #define	TS_LOW		0x02	/* Quiet Output Low			*/
    170  1.1  leo #define	TS_HIGH		0x04	/* Quiet Output High			*/
    171  1.1  leo #define	TS_BACK		0x06	/* Loop Back Mode			*/
    172  1.1  leo #define	TS_BREAK	0x08	/* Break Detected			*/
    173  1.1  leo #define	TS_EOT		0x10	/* End of Transmission			*/
    174  1.1  leo #define	TS_TURN		0x20	/* Auto Turnaround			*/
    175  1.1  leo #define	TS_UE		0x40	/* Underrun Error			*/
    176  1.1  leo #define	TS_EMPTY	0x80	/* Buffer Empty				*/
    177  1.1  leo #endif /* _MACHINE_MFP_H */
    178