Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields   Globals   Related Pages  

floppy.h File Reference

Floppy disk driver header. More...

Go to the source code of this file.

Data Structures

struct  floppy_struct
 Floppy geometry structures. More...


Defines

#define FDC_SECTORS   18
 Sectors per track.

#define FDC_HEADS   2
 Heads per track.

#define FDC_TRACKS   80
 Tracks per disk.

#define FDC_SECTOR_SIZE   512
 Bytes per sector.

#define FDC_TIME_MOTOR_SPINUP   500
 FDC motor spin-up time (msec).

#define FDC_TIME_MOTOR_OFF   3000
 FDC timeout to turn the motor off (msec).

#define FDC_DOR   0x3F2
 Digital Output Register.

#define FDC_MSR   0x3F4
 Main Status Register (read).

#define FDC_DSR   0x3F4
 Data Rate Select Register (write).

#define FDC_DATA   0x3F5
 Data Register.

#define FDC_DIR   0x3F7
 Digital Input Register.

#define FDC_CCR   0x3F7
 Configuration Control Register.

#define CMD_SPECIFY   0x03
 Specify.

#define CMD_WRITE   0xC5
 Write.

#define CMD_READ   0xE6
 Read.

#define CMD_RECAL   0x07
 Recalibrate.

#define CMD_SENSEI   0x08
 Send a "sense interrupt status".

#define CMD_FORMAT   0x4D
 Format a track.

#define CMD_SEEK   0x0F
 Seek a track.

#define CMD_VERSION   0x10
 Get the controller version.

#define MSR_BUSY   0x10
 The controller is busy.


Typedefs

typedef floppy_struct floppy_struct
 Floppy geometry structures.


Functions

void floppy_handler ()
 This is the floppy interrupt handler routine. It is invoked every time that a floppy operation successfully completes.

void floppy_thread ()
 This is a routine called from clock_thread() at every clock tick to perform the floppy motor kill countdown and to control the floppy timeouts.

bool init_floppy ()
 Initialize the floppy driver.
Returns:


void fdc_motor_on ()
 Turn the floppy motor on.

void fdc_motor_off ()
 Starts the FDC motor kill countdown.

void fdc_recalibrate ()
 Recalibrate the floppy drive.

bool fdc_seek (int track)
 Seek a track.
Parameters:
track  The track to seek.
Returns:


bool fdc_read (int block, byte *buffer, uint32_t count)
 Read some contiguous blocks from the floppy disk.
Parameters:
block  The starting block to read.
buffer  The destination buffer in memory where the blocks will be copied.
count  How many blocks to read.
Returns:


bool fdc_write (int block, byte *buffer, uint32_t count)
 Write some contiguous blocks to the floppy disk.
Parameters:
block  The starting block to write.
buffer  The address in memory from which the data will be copied.
count  How many blocks to write.
Returns:


bool fdc_is_changed ()
 Check if the floppy disk was changed.
Returns:
  • TRUE if the disk was changed;
  • FALSE otherwise.



Detailed Description

Floppy disk driver header.

Author:
Andrea Righi <drizzt@inwind.it>
Date:
Last update: 2003-11-08
Note:
Copyright (©) 2003 Andrea Righi

Definition in file floppy.h.


Define Documentation

#define CMD_FORMAT   0x4D
 

Format a track.

Definition at line 40 of file floppy.h.

#define CMD_READ   0xE6
 

Read.

Definition at line 37 of file floppy.h.

#define CMD_RECAL   0x07
 

Recalibrate.

Definition at line 38 of file floppy.h.

#define CMD_SEEK   0x0F
 

Seek a track.

Definition at line 41 of file floppy.h.

#define CMD_SENSEI   0x08
 

Send a "sense interrupt status".

Definition at line 39 of file floppy.h.

#define CMD_SPECIFY   0x03
 

Specify.

Definition at line 35 of file floppy.h.

#define CMD_VERSION   0x10
 

Get the controller version.

Definition at line 42 of file floppy.h.

#define CMD_WRITE   0xC5
 

Write.

Definition at line 36 of file floppy.h.

#define FDC_CCR   0x3F7
 

Configuration Control Register.

Definition at line 31 of file floppy.h.

#define FDC_DATA   0x3F5
 

Data Register.

Definition at line 29 of file floppy.h.

#define FDC_DIR   0x3F7
 

Digital Input Register.

Definition at line 30 of file floppy.h.

#define FDC_DOR   0x3F2
 

Digital Output Register.

Definition at line 26 of file floppy.h.

#define FDC_DSR   0x3F4
 

Data Rate Select Register (write).

Definition at line 28 of file floppy.h.

#define FDC_HEADS   2
 

Heads per track.

Definition at line 14 of file floppy.h.

#define FDC_MSR   0x3F4
 

Main Status Register (read).

Definition at line 27 of file floppy.h.

#define FDC_SECTOR_SIZE   512
 

Bytes per sector.

Definition at line 16 of file floppy.h.

#define FDC_SECTORS   18
 

Sectors per track.

Definition at line 13 of file floppy.h.

#define FDC_TIME_MOTOR_OFF   3000
 

FDC timeout to turn the motor off (msec).

Definition at line 22 of file floppy.h.

#define FDC_TIME_MOTOR_SPINUP   500
 

FDC motor spin-up time (msec).

Definition at line 19 of file floppy.h.

#define FDC_TRACKS   80
 

Tracks per disk.

Definition at line 15 of file floppy.h.

#define MSR_BUSY   0x10
 

The controller is busy.

Definition at line 47 of file floppy.h.


Typedef Documentation

typedef struct floppy_struct floppy_struct
 

Floppy geometry structures.


Generated on Fri Feb 20 15:32:18 2004 for Minirighi by doxygen1.2.18