TacOS  0.2
 Tout Structures de données Fichiers Fonctions Variables Définitions de type Énumérations Macros
floppy_utils.h
Aller à la documentation de ce fichier.
1 
30 #ifndef _FLOPPY_UTILS_H_
31 #define _FLOPPY_UTILS_H_
32 
33 #define FLOPPY_BASE 0x03f0
34 
40 {
41  FLOPPY_SRA = 0, // Status register A -- read-only
42  FLOPPY_SRB = 1, // Status register B -- read-only
43  FLOPPY_DOR = 2, // Digital output register
44  FLOPPY_TDR = 3, // Tape drive register
45  FLOPPY_MSR = 4, // Main status register -- read-only
46  FLOPPY_DSR = 4, // Datarate select register -- write-only
47  FLOPPY_FIFO = 5, // Data FIFO
48  FLOPPY_DIR = 7, // Digital input register -- read-only
49  FLOPPY_CCR = 7 // Configuration control register -- write-only
50 };
51 
57 {
58  READ_TRACK = 2,
59  SPECIFY = 3,
60  SENSE_DRIVE_STATUS = 4,
61  WRITE_DATA = 5,
62  READ_DATA = 6,
63  RECALIBRATE = 7,
64  SENSE_INTERRUPT = 8,
65  READ_ID = 10,
66  READ_DELETED_DATA = 12,
67  FORMAT_TRACK = 13,
68  SEEK = 15,
69  VERSION = 16,
70  SCAN_EQUAL = 17,
71  PERPENDICULAR_MODE = 18,
72  CONFIGURE = 19,
73  LOCK = 20,
74  VERIFY = 22,
75  SCAN_LOW_OR_EQUAL = 25,
76  SCAN_HIGH_OR_EQUAL = 29
77 };
78 
83 bool floppy_ready();
84 
90 int floppy_write_command(char cmd);
91 
97 
105 int floppy_seek(int drive, int cylindre, int head);
106 
107 /*
108  * MISC
109  */
110 
116 uint8_t floppy_get_type(int drive);
117 
121 void floppy_detect_drives();
122 
128 
129 #endif
int floppy_write_command(char cmd)
Envoi une commande au controleur floppy.
Definition: floppy_utils.c:53
floppy_registers
Offset des différents registres du controleur disquette.
Definition: floppy_utils.h:39
uint8_t floppy_get_version()
Retourne le numero de version du controleur disquette.
Definition: floppy_utils.c:152
int floppy_seek(int drive, int cylindre, int head)
Déplace la tête de lecture à un cylindre défini.
Definition: floppy_utils.c:81
void floppy_detect_drives()
Fonction de détection des lecteur floppy présents.
Definition: floppy_utils.c:146
bool floppy_ready()
Vérifie si le controleur floppy est en état ready.
Definition: floppy_utils.c:48
unsigned char uint8_t
Definition: types.h:34
floppy_commands
Numéros de commande du controleur disquette.
Definition: floppy_utils.h:56
uint8_t floppy_get_type(int drive)
Retourne le type de disquette accepté par le lecteur.
Definition: floppy_utils.c:133
uint8_t floppy_read_data()
Lis les données disponibles sur la FIFO du controleur.
Definition: floppy_utils.c:68