1 | /**
|
---|
2 | ******************************************************************************
|
---|
3 | * @file ff_gen_drv.h
|
---|
4 | * @author MCD Application Team
|
---|
5 | * @brief Header for ff_gen_drv.c module.
|
---|
6 | *****************************************************************************
|
---|
7 | * @attention
|
---|
8 | *
|
---|
9 | * Copyright (c) 2017 STMicroelectronics. All rights reserved.
|
---|
10 | *
|
---|
11 | * This software component is licensed by ST under BSD 3-Clause license,
|
---|
12 | * the "License"; You may not use this file except in compliance with the
|
---|
13 | * License. You may obtain a copy of the License at:
|
---|
14 | * opensource.org/licenses/BSD-3-Clause
|
---|
15 | *
|
---|
16 | ******************************************************************************
|
---|
17 | **/
|
---|
18 |
|
---|
19 | /* Define to prevent recursive inclusion -------------------------------------*/
|
---|
20 | #ifndef __FF_GEN_DRV_H
|
---|
21 | #define __FF_GEN_DRV_H
|
---|
22 |
|
---|
23 | #ifdef __cplusplus
|
---|
24 | extern "C" {
|
---|
25 | #endif
|
---|
26 |
|
---|
27 | /* Includes ------------------------------------------------------------------*/
|
---|
28 | #include "diskio.h"
|
---|
29 | #include "ff.h"
|
---|
30 | #include "stdint.h"
|
---|
31 |
|
---|
32 |
|
---|
33 | /* Exported types ------------------------------------------------------------*/
|
---|
34 |
|
---|
35 | /**
|
---|
36 | * @brief Disk IO Driver structure definition
|
---|
37 | */
|
---|
38 | typedef struct
|
---|
39 | {
|
---|
40 | DSTATUS (*disk_initialize) (BYTE); /*!< Initialize Disk Drive */
|
---|
41 | DSTATUS (*disk_status) (BYTE); /*!< Get Disk Status */
|
---|
42 | DRESULT (*disk_read) (BYTE, BYTE*, DWORD, UINT); /*!< Read Sector(s) */
|
---|
43 | #if _USE_WRITE == 1
|
---|
44 | DRESULT (*disk_write) (BYTE, const BYTE*, DWORD, UINT); /*!< Write Sector(s) when _USE_WRITE = 0 */
|
---|
45 | #endif /* _USE_WRITE == 1 */
|
---|
46 | #if _USE_IOCTL == 1
|
---|
47 | DRESULT (*disk_ioctl) (BYTE, BYTE, void*); /*!< I/O control operation when _USE_IOCTL = 1 */
|
---|
48 | #endif /* _USE_IOCTL == 1 */
|
---|
49 |
|
---|
50 | }Diskio_drvTypeDef;
|
---|
51 |
|
---|
52 | /**
|
---|
53 | * @brief Global Disk IO Drivers structure definition
|
---|
54 | */
|
---|
55 | typedef struct
|
---|
56 | {
|
---|
57 | uint8_t is_initialized[_VOLUMES];
|
---|
58 | const Diskio_drvTypeDef *drv[_VOLUMES];
|
---|
59 | uint8_t lun[_VOLUMES];
|
---|
60 | volatile uint8_t nbr;
|
---|
61 |
|
---|
62 | }Disk_drvTypeDef;
|
---|
63 |
|
---|
64 | /* Exported constants --------------------------------------------------------*/
|
---|
65 | /* Exported macro ------------------------------------------------------------*/
|
---|
66 | /* Exported functions ------------------------------------------------------- */
|
---|
67 | uint8_t FATFS_LinkDriver(const Diskio_drvTypeDef *drv, char *path);
|
---|
68 | uint8_t FATFS_UnLinkDriver(char *path);
|
---|
69 | uint8_t FATFS_LinkDriverEx(const Diskio_drvTypeDef *drv, char *path, BYTE lun);
|
---|
70 | uint8_t FATFS_UnLinkDriverEx(char *path, BYTE lun);
|
---|
71 | uint8_t FATFS_GetAttachedDriversNbr(void);
|
---|
72 |
|
---|
73 | #ifdef __cplusplus
|
---|
74 | }
|
---|
75 | #endif
|
---|
76 |
|
---|
77 | #endif /* __FF_GEN_DRV_H */
|
---|
78 |
|
---|
79 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
---|
80 |
|
---|