fatdrv.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. /****************************************************************************
  2. * This file is part of the FAT 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. * 03.08.04 mifi First Version
  36. ****************************************************************************/
  37. #ifndef __FATDRV_H__
  38. #define __FATDRV_H__
  39. #include "typedefs.h"
  40. /*-------------------------------------------------------------------------*/
  41. /* global defines */
  42. /*-------------------------------------------------------------------------*/
  43. /*
  44. * Define the hardware here
  45. */
  46. #define FAT_USE_IDE_INTERFACE 0
  47. #define FAT_USE_USB_INTERFACE 0
  48. #define FAT_USE_MMC_INTERFACE 1
  49. #if (FAT_USE_IDE_INTERFACE >= 1)
  50. #include "ide.h"
  51. #define HW_SUPPORT_WRITE IDE_SUPPORT_WRITE
  52. #define HW_SUPPORT_ATAPI IDE_SUPPORT_ATAPI
  53. #define HW_OK IDE_OK
  54. #define HW_ERROR IDE_ERROR
  55. #define HW_DRIVE_C IDE_DRIVE_C
  56. #define HW_DRIVE_D IDE_DRIVE_D
  57. #define HW_DRIVE_E IDE_DRIVE_E
  58. #define HW_SECTOR_SIZE IDE_SECTOR_SIZE
  59. #endif /* (FAT_USE_IDE_INTERFACE >= 1) */
  60. #if (FAT_USE_USB_INTERFACE >= 1)
  61. #include "usbdrv.h"
  62. #define HW_SUPPORT_WRITE USB_SUPPORT_WRITE
  63. #define HW_SUPPORT_ATAPI USB_SUPPORT_ATAPI
  64. #define HW_OK USB_OK
  65. #define HW_ERROR USB_ERROR
  66. #define HW_DRIVE_C USB_DRIVE_C
  67. #define HW_DRIVE_D USB_DRIVE_D
  68. #define HW_DRIVE_E USB_DRIVE_E
  69. #define HW_SECTOR_SIZE USB_SECTOR_SIZE
  70. #endif /* (FAT_USE_USB_INTERFACE >= 1) */
  71. #if (FAT_USE_MMC_INTERFACE >= 1)
  72. #include "mmcdrv.h"
  73. #define HW_SUPPORT_WRITE MMC_SUPPORT_WRITE
  74. #define HW_SUPPORT_ATAPI MMC_SUPPORT_ATAPI
  75. #define HW_OK MMC_OK
  76. #define HW_ERROR MMC_ERROR
  77. #define HW_DRIVE_C MMC_DRIVE_C
  78. #define HW_DRIVE_D MMC_DRIVE_C
  79. #define HW_DRIVE_E MMC_DRIVE_C
  80. #define HW_SECTOR_SIZE MMC_SECTOR_SIZE
  81. #endif /* (FAT_USE_MMC_INTERFACE >= 1) */
  82. /*-------------------------------------------------------------------------*/
  83. /* global types */
  84. /*-------------------------------------------------------------------------*/
  85. /*-------------------------------------------------------------------------*/
  86. /* global macros */
  87. /*-------------------------------------------------------------------------*/
  88. /*-------------------------------------------------------------------------*/
  89. /* Prototypes */
  90. /*-------------------------------------------------------------------------*/
  91. #if (FAT_USE_IDE_INTERFACE >= 1)
  92. #define HWInit IDEInit
  93. #define HWMountAllDevices IDEMountAllDevices
  94. #define HWGetSectorSize IDEGetSectorSize
  95. #define HWIsCDROMDevice IDEIsCDROMDevice
  96. #define HWIsZIPDevice IDEIsZIPDevice
  97. #define HWUnMountDevice IDEUnMountDevice
  98. #define HWGetTotalSectors IDEGetTotalSectors
  99. #define HWReadSectors IDEReadSectors
  100. #define HWWriteSectors IDEWriteSectors
  101. #endif /* (FAT_USE_IDE_INTERFACE >= 1) */
  102. #if (FAT_USE_USB_INTERFACE >= 1)
  103. #define HWInit USBInit
  104. #define HWMountAllDevices USBMountAllDevices
  105. #define HWGetSectorSize USBGetSectorSize
  106. #define HWIsCDROMDevice USBIsCDROMDevice
  107. #define HWIsZIPDevice USBIsZIPDevice
  108. #define HWUnMountDevice USBUnMountDevice
  109. #define HWGetTotalSectors USBGetTotalSectors
  110. #define HWReadSectors USBReadSectors
  111. #define HWWriteSectors USBWriteSectors
  112. #endif /* (FAT_USE_USB_INTERFACE == 1) */
  113. #if (FAT_USE_MMC_INTERFACE >= 1)
  114. #define HWInit MMCInit
  115. #define HWMountAllDevices MMCMountAllDevices
  116. #define HWGetSectorSize MMCGetSectorSize
  117. #define HWIsCDROMDevice MMCIsCDROMDevice
  118. #define HWIsZIPDevice MMCIsZIPDevice
  119. #define HWUnMountDevice MMCUnMountDevice
  120. #define HWGetTotalSectors MMCGetTotalSectors
  121. #define HWReadSectors MMCReadSectors
  122. #define HWWriteSectors MMCWriteSectors
  123. #endif /* (FAT_USE_MMC_INTERFACE == 1) */
  124. #endif /* !__FATDRV_H__ */