Gert van der Knokke
/
C1541III
C1541-III mbed edition
main.h@1:0cbbb66a6100, 2011-08-22 (annotated)
- Committer:
- gertk
- Date:
- Mon Aug 22 21:11:59 2011 +0000
- Revision:
- 1:0cbbb66a6100
- Parent:
- 0:28557a4d2215
updated the nRESET pin to an interrupt capable pin (p29)
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gertk | 0:28557a4d2215 | 1 | #ifndef _MAIN_H_INCLUDED |
gertk | 0:28557a4d2215 | 2 | #define _MAIN_H_INCLUDED |
gertk | 0:28557a4d2215 | 3 | |
gertk | 0:28557a4d2215 | 4 | /*constants*/ |
gertk | 0:28557a4d2215 | 5 | #define MAX_NUMBER_OF_DOS_BUFFERS 5 /*the maximum numbers of available buffers within this device*/ |
gertk | 0:28557a4d2215 | 6 | |
gertk | 0:28557a4d2215 | 7 | /*structures*/ |
gertk | 0:28557a4d2215 | 8 | struct DOS_buffer_struct |
gertk | 0:28557a4d2215 | 9 | { |
gertk | 0:28557a4d2215 | 10 | unsigned char buffer_in_use; /*this flag indicates wether the buffer is allready in use*/ |
gertk | 0:28557a4d2215 | 11 | unsigned char buffer[256]; /*the buffer capable of holding a complete block*/ |
gertk | 0:28557a4d2215 | 12 | }; |
gertk | 0:28557a4d2215 | 13 | |
gertk | 0:28557a4d2215 | 14 | struct DOS_channel_struct |
gertk | 0:28557a4d2215 | 15 | { |
gertk | 0:28557a4d2215 | 16 | unsigned char channel_in_use; /*this flag indicates wether this channel is allready in use*/ |
gertk | 0:28557a4d2215 | 17 | unsigned char next_action; /*this holds the next action (if nothing interupts it) for this channel*/ |
gertk | 0:28557a4d2215 | 18 | unsigned char filename[17]; /*the actual filename, as it is stored on the disk*/ |
gertk | 0:28557a4d2215 | 19 | unsigned char filetype; /*filetype can be sequential, program, user, etc.*/ |
gertk | 0:28557a4d2215 | 20 | unsigned char RW; /*file read or write*/ |
gertk | 0:28557a4d2215 | 21 | unsigned char track; /*the current track position on the disk regarding this file*/ |
gertk | 0:28557a4d2215 | 22 | unsigned char sector; /*the current sector position on the disk regarding this file*/ |
gertk | 0:28557a4d2215 | 23 | unsigned char buffer_pointer; /*the current byte position within the block specified by track and sector on the disk regarding this file*/ |
gertk | 0:28557a4d2215 | 24 | unsigned char used_buffer; /*this register holds the value of the connected buffer (if required)*/ |
gertk | 0:28557a4d2215 | 25 | unsigned char status; /*the current status of this file entry in the sa_DOS_buffer*/ |
gertk | 0:28557a4d2215 | 26 | }; |
gertk | 0:28557a4d2215 | 27 | |
gertk | 0:28557a4d2215 | 28 | /*variables*/ |
gertk | 0:28557a4d2215 | 29 | extern unsigned char RAM_buffer[256]; /*this is the buffer capable of holding one 256 byte block, a memory area to which the user or the 1541-III can write/read data to/from*/ |
gertk | 0:28557a4d2215 | 30 | //extern unsigned char BAM_buffer[162]; /*this buffer holds the Block Allocation Map, required for when we want to write to the D64 (max 40 tracks)*/ |
gertk | 0:28557a4d2215 | 31 | extern unsigned char block_buffer[512]; /*this buffers the data 'as read from' or 'to be written to' the card*/ |
gertk | 0:28557a4d2215 | 32 | extern struct DOS_buffer_struct DOS_buffer[MAX_NUMBER_OF_DOS_BUFFERS]; /*this array of structs holds the information about the currently used buffers*/ |
gertk | 0:28557a4d2215 | 33 | extern struct DOS_channel_struct DOS_channel[16]; /*this array of structs holds this information about the currently used channels*/ |
gertk | 0:28557a4d2215 | 34 | |
gertk | 0:28557a4d2215 | 35 | extern unsigned char Card_CID(void); |
gertk | 0:28557a4d2215 | 36 | extern unsigned char Card_CSD(void); |
gertk | 0:28557a4d2215 | 37 | |
gertk | 0:28557a4d2215 | 38 | /*routines*/ |
gertk | 0:28557a4d2215 | 39 | /*--------*/ |
gertk | 0:28557a4d2215 | 40 | // void delay_10uS(unsigned long delay); |
gertk | 0:28557a4d2215 | 41 | |
gertk | 0:28557a4d2215 | 42 | //void CLRWDT(); |
gertk | 0:28557a4d2215 | 43 | |
gertk | 0:28557a4d2215 | 44 | #endif |