source: uKadecot/trunk/tools/makefsdata/diskio.h@ 101

Last change on this file since 101 was 101, checked in by coas-nagasima, 9 years ago

TOPPERS/uKadecotのソースコードを追加

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/plain
File size: 2.6 KB
RevLine 
[101]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 "integer.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 */
28} DRESULT;
29
30
31/*---------------------------------------*/
32/* Prototypes for disk control functions */
33
34
35DSTATUS disk_status (BYTE pdrv);
36DSTATUS disk_initialize (BYTE pdrv);
37DRESULT disk_read (BYTE pdrv, BYTE* buff, DWORD sector, UINT count);
38DRESULT disk_write (BYTE pdrv, const BYTE* buff, DWORD sector, UINT count);
39DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff);
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 fucntion */
50
51/* Generic command (Used by FatFs) */
52#define CTRL_SYNC 0 /* Complete pending write process (needed at _FS_READONLY == 0) */
53#define GET_SECTOR_COUNT 1 /* Get media size (needed at _USE_MKFS == 1) */
54#define GET_SECTOR_SIZE 2 /* Get sector size (needed at _MAX_SS != _MIN_SS) */
55#define GET_BLOCK_SIZE 3 /* Get erase block size (needed at _USE_MKFS == 1) */
56#define CTRL_TRIM 4 /* Inform device that the data on the block of sectors is no longer used (needed at _USE_TRIM == 1) */
57
58/* Generic command (Not used by FatFs) */
59#define CTRL_FORMAT 5 /* Create physical format on the media */
60#define CTRL_POWER_IDLE 6 /* Put the device idle state */
61#define CTRL_POWER_OFF 7 /* Put the device off state */
62#define CTRL_LOCK 8 /* Lock media removal */
63#define CTRL_UNLOCK 9 /* Unlock media removal */
64#define CTRL_EJECT 10 /* Eject media */
65
66/* MMC/SDC specific command (Not used by FatFs) */
67#define MMC_GET_TYPE 50 /* Get card type */
68#define MMC_GET_CSD 51 /* Get CSD */
69#define MMC_GET_CID 52 /* Get CID */
70#define MMC_GET_OCR 53 /* Get OCR */
71#define MMC_GET_SDSTAT 54 /* Get SD status */
72
73/* ATA/CF specific command (Not used by FatFs) */
74#define ATA_GET_REV 60 /* Get F/W revision */
75#define ATA_GET_MODEL 61 /* Get model name */
76#define ATA_GET_SN 62 /* Get serial number */
77
78
79#ifdef __cplusplus
80}
81#endif
82
83#endif
Note: See TracBrowser for help on using the repository browser.