mmcdrv.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /****************************************************************************
  2. * This file is part of the MMC device driver.
  3. *
  4. * Copyright (c) 2002-2004 by Michael Fischer. All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. *
  10. * 1. Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * 2. Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in the
  14. * documentation and/or other materials provided with the distribution.
  15. * 3. Neither the name of the author nor the names of its contributors may
  16. * be used to endorse or promote products derived from this software
  17. * without specific prior written permission.
  18. *
  19. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  20. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  21. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  22. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
  23. * THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  24. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  25. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  26. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  27. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  28. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  29. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  30. * SUCH DAMAGE.
  31. *
  32. ****************************************************************************
  33. * History:
  34. *
  35. * 10.10.04 mifi First Version
  36. ****************************************************************************/
  37. #ifndef __MMCDRV_H__
  38. #define __MMCDRV_H__
  39. #include "typedefs.h"
  40. /*-------------------------------------------------------------------------*/
  41. /* global defines */
  42. /*-------------------------------------------------------------------------*/
  43. //
  44. // Here we can switch on/off some
  45. // feature of the software
  46. //
  47. #define MMC_SUPPORT_WRITE 1
  48. #define MMC_OK 0x00
  49. #define MMC_ERROR 0x01
  50. #define MMC_DRIVE_NOT_FOUND 0x02
  51. #define MMC_PARAM_ERROR 0x03
  52. #define MMC_BUSY 0x04
  53. #define MMC_NOT_SUPPORTED 0x08
  54. #define MMC_DRIVE_C 0
  55. //
  56. // Sector size
  57. //
  58. #define MMC_SECTOR_SIZE 512
  59. #define MAX_SECTOR_SIZE MMC_SECTOR_SIZE
  60. /*-------------------------------------------------------------------------*/
  61. /* global types */
  62. /*-------------------------------------------------------------------------*/
  63. typedef void MMC_MOUNT_FUNC(int nDevice);
  64. /*-------------------------------------------------------------------------*/
  65. /* global macros */
  66. /*-------------------------------------------------------------------------*/
  67. /*-------------------------------------------------------------------------*/
  68. /* Prototypes */
  69. /*-------------------------------------------------------------------------*/
  70. int MMCInit(int nMMCMode, MMC_MOUNT_FUNC * pMountFunc, MMC_MOUNT_FUNC * pUnMountFunc);
  71. int MMCMountAllDevices(int nMMCMode, BYTE *pSectorBuffer);
  72. int MMCGetSectorSize(BYTE bDevice);
  73. int MMCIsCDROMDevice(BYTE bDevice);
  74. int MMCIsZIPDevice(BYTE bDevice);
  75. int MMCUnMountDevice(BYTE bDevice);
  76. DWORD MMCGetTotalSectors(BYTE bDevice);
  77. int MMCReadSectors(BYTE bDevice, void *pData, DWORD dwStartSector, WORD wSectorCount);
  78. #if (MMC_SUPPORT_WRITE == 1)
  79. int MMCWriteSectors(BYTE bDevice, void *pData, DWORD dwStartSector, WORD wSectorCount);
  80. #endif
  81. #endif /* !__MMCDRV_H__ */