My Marlin configs for Fabrikator Mini and CTC i3 Pro B
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

diskio.h 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /*-----------------------------------------------------------------------
  2. / Low level disk interface modlue include file (C)ChaN, 2015
  3. /-----------------------------------------------------------------------*/
  4. #ifndef _DISKIO_DEFINED
  5. #define _DISKIO_DEFINED
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9. #define _DISKIO_WRITE 1 /* 1: Enable disk_write function */
  10. #define _DISKIO_IOCTL 1 /* 1: Enable disk_ioctl fucntion */
  11. #define _DISKIO_ISDIO 0 /* 1: Enable iSDIO control fucntion */
  12. #include "integer.h"
  13. /* Status of Disk Functions */
  14. typedef BYTE DSTATUS;
  15. /* Results of Disk Functions */
  16. typedef enum {
  17. RES_OK = 0, /* 0: Successful */
  18. RES_ERROR, /* 1: R/W Error */
  19. RES_WRPRT, /* 2: Write Protected */
  20. RES_NOTRDY, /* 3: Not Ready */
  21. RES_PARERR /* 4: Invalid Parameter */
  22. } DRESULT;
  23. #if _DISKIO_ISDIO
  24. /* Command structure for iSDIO ioctl command */
  25. typedef struct {
  26. BYTE func; /* Function number: 0..7 */
  27. WORD ndata; /* Number of bytes to transfer: 1..512, or mask + data */
  28. DWORD addr; /* Register address: 0..0x1FFFF */
  29. void* data; /* Pointer to the data (to be written | read buffer) */
  30. } SDIO_CMD;
  31. #endif
  32. /*---------------------------------------*/
  33. /* Prototypes for disk control functions */
  34. DSTATUS disk_initialize (BYTE pdrv);
  35. DSTATUS disk_status (BYTE pdrv);
  36. DRESULT disk_read (BYTE pdrv, BYTE* buff, DWORD sector, UINT count);
  37. #if _DISKIO_WRITE
  38. DRESULT disk_write (BYTE pdrv, const BYTE* buff, DWORD sector, UINT count);
  39. #endif
  40. #if _DISKIO_IOCTL
  41. DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff);
  42. #endif
  43. /* Disk Status Bits (DSTATUS) */
  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. /* Command code for disk_ioctrl fucntion */
  48. /* Generic command (Used by FatFs) */
  49. #define CTRL_SYNC 0 /* Complete pending write process (needed at _FS_READONLY == 0) */
  50. #define GET_SECTOR_COUNT 1 /* Get media size (needed at _USE_MKFS == 1) */
  51. #define GET_SECTOR_SIZE 2 /* Get sector size (needed at _MAX_SS != _MIN_SS) */
  52. #define GET_BLOCK_SIZE 3 /* Get erase block size (needed at _USE_MKFS == 1) */
  53. #define CTRL_TRIM 4 /* Inform device that the data on the block of sectors is no longer used (needed at _USE_TRIM == 1) */
  54. /* Generic command (Not used by FatFs) */
  55. #define CTRL_FORMAT 5 /* Create physical format on the media */
  56. #define CTRL_POWER_IDLE 6 /* Put the device idle state */
  57. #define CTRL_POWER_OFF 7 /* Put the device off state */
  58. #define CTRL_LOCK 8 /* Lock media removal */
  59. #define CTRL_UNLOCK 9 /* Unlock media removal */
  60. #define CTRL_EJECT 10 /* Eject media */
  61. /* MMC/SDC specific ioctl command (Not used by FatFs) */
  62. #define MMC_GET_TYPE 50 /* Get card type */
  63. #define MMC_GET_CSD 51 /* Get CSD */
  64. #define MMC_GET_CID 52 /* Get CID */
  65. #define MMC_GET_OCR 53 /* Get OCR */
  66. #define MMC_GET_SDSTAT 54 /* Get SD status */
  67. #define ISDIO_READ 55 /* Read data form SD iSDIO register */
  68. #define ISDIO_WRITE 56 /* Write data to SD iSDIO register */
  69. #define ISDIO_MRITE 57 /* Masked write data to SD iSDIO register */
  70. /* ATA/CF specific ioctl command (Not used by FatFs) */
  71. #define ATA_GET_REV 60 /* Get F/W revision */
  72. #define ATA_GET_MODEL 61 /* Get model name */
  73. #define ATA_GET_SN 62 /* Get serial number */
  74. /* MMC card type flags (MMC_GET_TYPE) */
  75. #define CT_MMC 0x01 /* MMC ver 3 */
  76. #define CT_SD1 0x02 /* SD ver 1 */
  77. #define CT_SD2 0x04 /* SD ver 2 */
  78. #define CT_SDC (CT_SD1|CT_SD2) /* SD */
  79. #define CT_BLOCK 0x08 /* Block addressing */
  80. #ifdef __cplusplus
  81. }
  82. #endif
  83. #endif