Keyboard firmwares for Atmel AVR and Cortex-M
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

diskio.h 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*-----------------------------------------------------------------------
  2. / Low level disk interface module include file
  3. /-----------------------------------------------------------------------*/
  4. #ifndef _DISKIO_DEFINED
  5. #define _DISKIO_DEFINED
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9. #include "integer.h"
  10. #include "ff.h"
  11. #include "../DataflashManager.h"
  12. /* Status of Disk Functions */
  13. typedef BYTE DSTATUS;
  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. /* Prototypes for disk control functions */
  24. DSTATUS disk_initialize (BYTE);
  25. DSTATUS disk_status (BYTE);
  26. DRESULT disk_read (BYTE, BYTE*, DWORD, BYTE);
  27. DRESULT disk_write (BYTE, const BYTE*, DWORD, BYTE);
  28. DRESULT disk_ioctl (BYTE, BYTE, void*);
  29. /* Disk Status Bits (DSTATUS) */
  30. #define STA_NOINIT 0x01 /* Drive not initialized */
  31. #define STA_NODISK 0x02 /* No medium in the drive */
  32. #define STA_PROTECT 0x04 /* Write protected */
  33. #ifdef __cplusplus
  34. }
  35. #endif
  36. #endif