Speed up Webserver demo data rate by not sending a full ethernet frame each time...
[pub/USBasp.git] / Projects / Webserver / Lib / FATFs / diskio.h
1 /*-----------------------------------------------------------------------
2 / Low level disk interface modlue include file R0.07 (C)ChaN, 2010
3 /-----------------------------------------------------------------------*/
4
5 #ifndef _DISKIO
6
7 #define _READONLY 0 /* 1: Read-only mode */
8 #define _USE_IOCTL 0
9
10 #include "integer.h"
11 #include "ff.h"
12
13 #include "../DataflashManager.h"
14
15
16 /* Status of Disk Functions */
17 typedef BYTE DSTATUS;
18
19 /* Results of Disk Functions */
20 typedef enum {
21 RES_OK = 0, /* 0: Successful */
22 RES_ERROR, /* 1: R/W Error */
23 RES_WRPRT, /* 2: Write Protected */
24 RES_NOTRDY, /* 3: Not Ready */
25 RES_PARERR /* 4: Invalid Parameter */
26 } DRESULT;
27
28
29 /*---------------------------------------*/
30 /* Prototypes for disk control functions */
31
32 BOOL assign_drives (int argc, char *argv[]);
33 DSTATUS disk_initialize (BYTE);
34 DSTATUS disk_status (BYTE);
35 DRESULT disk_read (BYTE, BYTE*, DWORD, BYTE);
36 #if _READONLY == 0
37 DRESULT disk_write (BYTE, const BYTE*, DWORD, BYTE);
38 #endif
39 DRESULT disk_ioctl (BYTE, BYTE, void*);
40
41
42 /* Disk Status Bits (DSTATUS) */
43
44 #define STA_NOINIT 0x01 /* Drive not initialized */
45 #define STA_NODISK 0x02 /* No medium in the drive */
46 #define STA_PROTECT 0x04 /* Write protected */
47
48
49 /* Command code for disk_ioctrl() */
50
51 /* Generic command */
52 #define CTRL_SYNC 0 /* Mandatory for write functions */
53 #define GET_SECTOR_COUNT 1 /* Mandatory for only f_mkfs() */
54 #define GET_SECTOR_SIZE 2 /* Mandatory for multiple sector size cfg */
55 #define GET_BLOCK_SIZE 3 /* Mandatory for only f_mkfs() */
56 #define CTRL_POWER 4
57 #define CTRL_LOCK 5
58 #define CTRL_EJECT 6
59 /* MMC/SDC command */
60 #define MMC_GET_TYPE 10
61 #define MMC_GET_CSD 11
62 #define MMC_GET_CID 12
63 #define MMC_GET_OCR 13
64 #define MMC_GET_SDSTAT 14
65 /* ATA/CF command */
66 #define ATA_GET_REV 20
67 #define ATA_GET_MODEL 21
68 #define ATA_GET_SN 22
69
70
71 #define _DISKIO
72 #endif