ReactOS 0.4.16-dev-88-ga65b6ae
diskio.h
Go to the documentation of this file.
1/*-----------------------------------------------------------------------/
2/ Low level disk interface modlue include file (C)ChaN, 2014 /
3/-----------------------------------------------------------------------*/
4
5#ifndef _DISKIO_DEFINED
6#define _DISKIO_DEFINED
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
12#define _USE_WRITE 1 /* 1: Enable disk_write function */
13#define _USE_IOCTL 1 /* 1: Enable disk_ioctl fucntion */
14
15#include <typedefs.h>
16
17
18/* Status of Disk Functions */
19typedef BYTE DSTATUS;
20
21/* Results of Disk Functions */
22typedef enum {
23 RES_OK = 0, /* 0: Successful */
24 RES_ERROR, /* 1: R/W Error */
25 RES_WRPRT, /* 2: Write Protected */
26 RES_NOTRDY, /* 3: Not Ready */
27 RES_PARERR /* 4: Invalid Parameter */
29
30
31/*---------------------------------------*/
32/* Prototypes for disk control functions */
33
34DSTATUS disk_openimage(BYTE pdrv, const char* imageFileName);
36
41DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff);
42
43
44/* Disk Status Bits (DSTATUS) */
45
46#define STA_NOINIT 0x01 /* Drive not initialized */
47#define STA_NODISK 0x02 /* No medium in the drive */
48#define STA_PROTECT 0x04 /* Write protected */
49
50
51/* Command code for disk_ioctrl fucntion */
52
53/* Generic command (Used by FatFs) */
54#define CTRL_SYNC 0 /* Complete pending write process (needed at _FS_READONLY == 0) */
55#define GET_SECTOR_COUNT 1 /* Get media size (needed at _USE_MKFS == 1) */
56#define GET_SECTOR_SIZE 2 /* Get sector size (needed at _MAX_SS != _MIN_SS) */
57#define GET_BLOCK_SIZE 3 /* Get erase block size (needed at _USE_MKFS == 1) */
58#define CTRL_TRIM 4 /* Inform device that the data on the block of sectors is no longer used (needed at _USE_TRIM == 1) */
59
60/* Custom command for image file resizing */
61#define SET_SECTOR_COUNT 126
62
63#ifdef __cplusplus
64}
65#endif
66
67#endif
DRESULT disk_read(BYTE pdrv, BYTE *buff, DWORD sector, UINT count)
Definition: diskio.c:99
DSTATUS disk_initialize(BYTE pdrv)
Definition: diskio.c:66
DRESULT disk_write(BYTE pdrv, const BYTE *buff, DWORD sector, UINT count)
Definition: diskio.c:134
VOID disk_cleanup(BYTE pdrv)
Definition: diskio.c:48
DSTATUS disk_status(BYTE pdrv)
Definition: diskio.c:83
DRESULT
Definition: diskio.h:22
@ RES_OK
Definition: diskio.h:23
@ RES_WRPRT
Definition: diskio.h:25
@ RES_ERROR
Definition: diskio.h:24
@ RES_NOTRDY
Definition: diskio.h:26
@ RES_PARERR
Definition: diskio.h:27
DRESULT disk_ioctl(BYTE pdrv, BYTE cmd, void *buff)
Definition: diskio.c:169
DSTATUS disk_openimage(BYTE pdrv, const char *imageFileName)
Definition: diskio.c:24
BYTE DSTATUS
Definition: diskio.h:19
static unsigned char buff[32768]
Definition: fatten.c:17
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint GLsizei count
Definition: gl.h:1545
uint32_t sector
Definition: isohybrid.c:61
unsigned int UINT
Definition: ndis.h:50
Definition: ftp_var.h:139
unsigned char BYTE
Definition: xxhash.c:193