OpenCores
URL https://opencores.org/ocsvn/ion/ion/trunk

Subversion Repositories ion

[/] [ion/] [trunk/] [src/] [common/] [fatfs/] [diskio.h] - Blame information for rev 243

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 243 ja_rd
/*-----------------------------------------------------------------------
2
/  Low level disk interface modlue include file   (C)ChaN, 2009
3
/-----------------------------------------------------------------------*/
4
 
5
#ifndef _DISKIO
6
#define _DISKIO
7
 
8
#include "integer.h"
9
 
10
 
11
/* Status of Disk Functions */
12
typedef BYTE    DSTATUS;
13
 
14
/* Results of Disk Functions */
15
typedef enum {
16
        RES_OK = 0,              /* 0: Successful */
17
        RES_ERROR,              /* 1: R/W Error */
18
        RES_WRPRT,              /* 2: Write Protected */
19
        RES_NOTRDY,             /* 3: Not Ready */
20
        RES_PARERR              /* 4: Invalid Parameter */
21
} DRESULT;
22
 
23
 
24
/*---------------------------------------*/
25
/* Prototypes for disk control functions */
26
 
27
int assign_drives (int, int);
28
DSTATUS disk_initialize (BYTE);
29
DSTATUS disk_status (BYTE);
30
DRESULT disk_read (BYTE, BYTE*, DWORD, BYTE);
31
DRESULT disk_write (BYTE, const BYTE*, DWORD, BYTE);
32
DRESULT disk_ioctl (BYTE, BYTE, void*);
33
 
34
 
35
 
36
/* Disk Status Bits (DSTATUS) */
37
 
38
#define STA_NOINIT              0x01    /* Drive not initialized */
39
#define STA_NODISK              0x02    /* No medium in the drive */
40
#define STA_PROTECT             0x04    /* Write protected */
41
 
42
 
43
/* Command code for disk_ioctrl fucntion */
44
 
45
/* Generic command (mandatory for FatFs) */
46
#define CTRL_SYNC                       0        /* Flush disk cache (for write functions) */
47
#define GET_SECTOR_COUNT        1       /* Get media size (for only f_mkfs()) */
48
#define GET_SECTOR_SIZE         2       /* Get sector size (for multiple sector size (_MAX_SS >= 1024)) */
49
#define GET_BLOCK_SIZE          3       /* Get erase block size (for only f_mkfs()) */
50
 
51
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.