mmc.h 931 B

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright (c) 2009 Openmoko Inc.
  2. //
  3. // Authors: Marek Lindner <marek@openmoko.com>
  4. //
  5. // This program is free software; you can redistribute it and/or
  6. // modify it under the terms of the GNU General Public License
  7. // as published by the Free Software Foundation; either version
  8. // 3 of the License, or (at your option) any later version.
  9. //
  10. #if !defined(_MMC_)
  11. #define _MMC_
  12. #include <integer.h>
  13. typedef unsigned char 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. DSTATUS mmc_disk_initialize(BYTE drv);
  23. DRESULT mmc_disk_read(BYTE drv, BYTE *buff, DWORD sector, BYTE count);
  24. DRESULT mmc_disk_write(BYTE drv, const BYTE *buff, DWORD sector, BYTE count);
  25. DRESULT mmc_disk_ioctl(BYTE drv, BYTE ctrl, void *buff);
  26. #endif