svn / FATFileSystem / trunk / diskio.h

Revision 16, 1.9 kB (checked in by rolf.meyer@…, 2 years ago)

Finaly the FATFileSystem works on both targets ;-)
Sorry for the delay.

Line 
1/*-----------------------------------------------------------------------
2/  Low level disk interface modlue include file  R0.06   (C)ChaN, 2007
3/-----------------------------------------------------------------------*/
4
5#ifndef _DISKIO
6
7#define _READONLY   0   /* 1: Read-only mode */
8#define _USE_IOCTL  1
9
10#include "integer.h"
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16/* Status of Disk Functions */
17typedef BYTE    DSTATUS;
18
19/* Results of Disk Functions */
20typedef 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
32DSTATUS disk_initialize (BYTE);
33DSTATUS disk_status (BYTE);
34DRESULT disk_read (BYTE, BYTE*, DWORD, BYTE);
35#if _READONLY == 0
36DRESULT disk_write (BYTE, const BYTE*, DWORD, BYTE);
37#endif
38DRESULT disk_ioctl (BYTE, BYTE, void*);
39void    disk_timerproc (void);
40
41#ifdef __cplusplus
42};
43#endif
44
45
46/* Disk Status Bits (DSTATUS) */
47
48#define STA_NOINIT      0x01    /* Drive not initialized */
49#define STA_NODISK      0x02    /* No medium in the drive */
50#define STA_PROTECT     0x04    /* Write protected */
51
52
53/* Command code for disk_ioctrl() */
54
55/* Generic command */
56#define CTRL_SYNC           0   /* Mandatory for read/write configuration */
57#define GET_SECTOR_COUNT    1   /* Mandatory for only f_mkfs() */
58#define GET_SECTOR_SIZE     2
59#define GET_BLOCK_SIZE      3   /* Mandatory for only f_mkfs() */
60#define CTRL_POWER          4
61#define CTRL_LOCK           5
62#define CTRL_EJECT          6
63/* MMC/SDC command */
64#define MMC_GET_TYPE        10
65#define MMC_GET_CSD         11
66#define MMC_GET_CID         12
67#define MMC_GET_OCR         13
68#define MMC_GET_SDSTAT      14
69/* ATA/CF command */
70#define ATA_GET_REV         20
71#define ATA_GET_MODEL       21
72#define ATA_GET_SN          22
73
74
75#define _DISKIO
76#endif
Note: See TracBrowser for help on using the browser.