/*
 * $Header: /smsa/bsd:include/dev/fdc.h:bsd  1.5  $
 * $Source: /smsa/bsd:include/dev/fdc.h: $
 *
 * Copyright (c) 1988 Acorn Computers Ltd., Cambridge, England
 */
/*
 *	A500 3.5" Floppy disc interface - interrupt control structures
 *
 *	Author: J.M. Collins, Xi Software Ltd 1987.
 *
 *	First we define the device structure.
 */

#ifndef __dev_fdc_h
#define __dev_fdc_h

typedef struct
{
    volatile unsigned char
	fdc_status,	fdc_fill1[3],
	fdc_track,	fdc_fill2[3],
	fdc_sector,	fdc_fill3[3],
	fdc_data,	fdc_fill4[3];
} FDCDev, *FDCDevRef;

#define	fdc_command	fdc_status
#define	FDC4ADDRESS	((FDCDevRef)0x03310000)
#define	FDC5ADDRESS	((FDCDevRef)0x03290000)

/*
 *	Define status bits.
 */

#define	FDS_NOTREADY	0x80
#define	FDS_WPROT	0x40
#define	FDS_WFAULT	0x20
#define	FDS_RNF		0x10
#define	FDS_CRC		0x08
#define	FDS_LDATA	0x04
#define	FDS_DRQ		0x02
#define	FDS_BUSY	0x01

/*
 *	Command codes.
 */

#define	FDC_RESTORE	0x00
#define	FDC_SEEK	0x10
#define	FDC_STEP	0x20
#define	FDC_STEPIN	0x40
#define	FDC_STEPOUT	0x60
#define FDC_RDSEC	0x80
#define	FDC_WRSEC	0xA0
#define	FDC_RDADDR	0xC0
#define	FDC_RDTRK	0xE0
#define	FDC_WRTRK	0xF0
#define	FDC_FRCINT	0xD0

#define	FDC_PC_DISABLE	0x02
#define	FDC_HEADSETTLE	0x04
#define FDC_NOSPINUP    0x08

/*
 *	This shouldn't be here (then why is it)!
 */

#define	NBPSCTR		512
#define	SCTRSHFT	9
#define	POFFMASK	0x00007fff

#endif/*__dev_fdc_h*/

/* EOF fdc.h */
