| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,107 @@ |
| 1 |
+/** |
|
| 2 |
+ ****************************************************************************** |
|
| 3 |
+ * @file ff_gen_drv.h |
|
| 4 |
+ * @author MCD Application Team |
|
| 5 |
+ * @version V1.4.1 |
|
| 6 |
+ * @date 14-February-2017 |
|
| 7 |
+ * @brief Header for ff_gen_drv.c module. |
|
| 8 |
+ ****************************************************************************** |
|
| 9 |
+ * @attention |
|
| 10 |
+ * |
|
| 11 |
+ * <h2><center>© COPYRIGHT 2017 STMicroelectronics</center></h2> |
|
| 12 |
+ * |
|
| 13 |
+ * Redistribution and use in source and binary forms, with or without |
|
| 14 |
+ * modification, are permitted, provided that the following conditions are met: |
|
| 15 |
+ * |
|
| 16 |
+ * 1. Redistribution of source code must retain the above copyright notice, |
|
| 17 |
+ * this list of conditions and the following disclaimer. |
|
| 18 |
+ * 2. Redistributions in binary form must reproduce the above copyright notice, |
|
| 19 |
+ * this list of conditions and the following disclaimer in the documentation |
|
| 20 |
+ * and/or other materials provided with the distribution. |
|
| 21 |
+ * 3. Neither the name of STMicroelectronics nor the names of other |
|
| 22 |
+ * contributors to this software may be used to endorse or promote products |
|
| 23 |
+ * derived from this software without specific written permission. |
|
| 24 |
+ * 4. This software, including modifications and/or derivative works of this |
|
| 25 |
+ * software, must execute solely and exclusively on microcontroller or |
|
| 26 |
+ * microprocessor devices manufactured by or for STMicroelectronics. |
|
| 27 |
+ * 5. Redistribution and use of this software other than as permitted under |
|
| 28 |
+ * this license is void and will automatically terminate your rights under |
|
| 29 |
+ * this license. |
|
| 30 |
+ * |
|
| 31 |
+ * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" |
|
| 32 |
+ * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT |
|
| 33 |
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A |
|
| 34 |
+ * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY |
|
| 35 |
+ * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT |
|
| 36 |
+ * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
|
| 37 |
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
|
| 38 |
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, |
|
| 39 |
+ * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
|
| 40 |
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
|
| 41 |
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
|
| 42 |
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
| 43 |
+ * |
|
| 44 |
+ ****************************************************************************** |
|
| 45 |
+ */ |
|
| 46 |
+ |
|
| 47 |
+/* Define to prevent recursive inclusion -------------------------------------*/ |
|
| 48 |
+#ifndef __FF_GEN_DRV_H |
|
| 49 |
+#define __FF_GEN_DRV_H |
|
| 50 |
+ |
|
| 51 |
+#ifdef __cplusplus |
|
| 52 |
+ extern "C" {
|
|
| 53 |
+#endif |
|
| 54 |
+ |
|
| 55 |
+/* Includes ------------------------------------------------------------------*/ |
|
| 56 |
+#include "diskio.h" |
|
| 57 |
+#include "ff.h" |
|
| 58 |
+ |
|
| 59 |
+/* Exported types ------------------------------------------------------------*/ |
|
| 60 |
+ |
|
| 61 |
+/** |
|
| 62 |
+ * @brief Disk IO Driver structure definition |
|
| 63 |
+ */ |
|
| 64 |
+typedef struct |
|
| 65 |
+{
|
|
| 66 |
+ DSTATUS (*disk_initialize) (BYTE); /*!< Initialize Disk Drive */ |
|
| 67 |
+ DSTATUS (*disk_status) (BYTE); /*!< Get Disk Status */ |
|
| 68 |
+ DRESULT (*disk_read) (BYTE, BYTE*, DWORD, UINT); /*!< Read Sector(s) */ |
|
| 69 |
+#if _USE_WRITE == 1 |
|
| 70 |
+ DRESULT (*disk_write) (BYTE, const BYTE*, DWORD, UINT); /*!< Write Sector(s) when _USE_WRITE = 0 */ |
|
| 71 |
+#endif /* _USE_WRITE == 1 */ |
|
| 72 |
+#if _USE_IOCTL == 1 |
|
| 73 |
+ DRESULT (*disk_ioctl) (BYTE, BYTE, void*); /*!< I/O control operation when _USE_IOCTL = 1 */ |
|
| 74 |
+#endif /* _USE_IOCTL == 1 */ |
|
| 75 |
+ |
|
| 76 |
+}Diskio_drvTypeDef; |
|
| 77 |
+ |
|
| 78 |
+/** |
|
| 79 |
+ * @brief Global Disk IO Drivers structure definition |
|
| 80 |
+ */ |
|
| 81 |
+typedef struct |
|
| 82 |
+{
|
|
| 83 |
+ uint8_t is_initialized[_VOLUMES]; |
|
| 84 |
+ Diskio_drvTypeDef *drv[_VOLUMES]; |
|
| 85 |
+ uint8_t lun[_VOLUMES]; |
|
| 86 |
+ __IO uint8_t nbr; |
|
| 87 |
+ |
|
| 88 |
+}Disk_drvTypeDef; |
|
| 89 |
+ |
|
| 90 |
+/* Exported constants --------------------------------------------------------*/ |
|
| 91 |
+/* Exported macro ------------------------------------------------------------*/ |
|
| 92 |
+/* Exported functions ------------------------------------------------------- */ |
|
| 93 |
+uint8_t FATFS_LinkDriverEx(Diskio_drvTypeDef *drv, char *path, uint8_t lun); |
|
| 94 |
+uint8_t FATFS_LinkDriver(Diskio_drvTypeDef *drv, char *path); |
|
| 95 |
+uint8_t FATFS_UnLinkDriver(char *path); |
|
| 96 |
+uint8_t FATFS_LinkDriverEx(Diskio_drvTypeDef *drv, char *path, BYTE lun); |
|
| 97 |
+uint8_t FATFS_UnLinkDriverEx(char *path, BYTE lun); |
|
| 98 |
+uint8_t FATFS_GetAttachedDriversNbr(void); |
|
| 99 |
+ |
|
| 100 |
+#ifdef __cplusplus |
|
| 101 |
+} |
|
| 102 |
+#endif |
|
| 103 |
+ |
|
| 104 |
+#endif /* __FF_GEN_DRV_H */ |
|
| 105 |
+ |
|
| 106 |
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
|
| 107 |
+ |