You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ff_gen_drv.h 2.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. /* Define to prevent recursive inclusion -------------------------------------*/
  19. #ifndef __FF_GEN_DRV_H
  20. #define __FF_GEN_DRV_H
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. /* Includes ------------------------------------------------------------------*/
  25. #include "diskio.h"
  26. #include "ff.h"
  27. #include "stdint.h"
  28. /* Exported types ------------------------------------------------------------*/
  29. /**
  30. * @brief Disk IO Driver structure definition
  31. */
  32. typedef struct
  33. {
  34. DSTATUS (*disk_initialize) (BYTE); /*!< Initialize Disk Drive */
  35. DSTATUS (*disk_status) (BYTE); /*!< Get Disk Status */
  36. DRESULT (*disk_read) (BYTE, BYTE*, DWORD, UINT); /*!< Read Sector(s) */
  37. #if _USE_WRITE == 1
  38. DRESULT (*disk_write) (BYTE, const BYTE*, DWORD, UINT); /*!< Write Sector(s) when _USE_WRITE = 0 */
  39. #endif /* _USE_WRITE == 1 */
  40. #if _USE_IOCTL == 1
  41. DRESULT (*disk_ioctl) (BYTE, BYTE, void*); /*!< I/O control operation when _USE_IOCTL = 1 */
  42. #endif /* _USE_IOCTL == 1 */
  43. }Diskio_drvTypeDef;
  44. /**
  45. * @brief Global Disk IO Drivers structure definition
  46. */
  47. typedef struct
  48. {
  49. uint8_t is_initialized[_VOLUMES];
  50. const Diskio_drvTypeDef *drv[_VOLUMES];
  51. uint8_t lun[_VOLUMES];
  52. volatile uint8_t nbr;
  53. }Disk_drvTypeDef;
  54. /* Exported constants --------------------------------------------------------*/
  55. /* Exported macro ------------------------------------------------------------*/
  56. /* Exported functions ------------------------------------------------------- */
  57. uint8_t FATFS_LinkDriver(const Diskio_drvTypeDef *drv, char *path);
  58. uint8_t FATFS_UnLinkDriver(char *path);
  59. uint8_t FATFS_LinkDriverEx(const Diskio_drvTypeDef *drv, char *path, BYTE lun);
  60. uint8_t FATFS_UnLinkDriverEx(char *path, BYTE lun);
  61. uint8_t FATFS_GetAttachedDriversNbr(void);
  62. #ifdef __cplusplus
  63. }
  64. #endif
  65. #endif /* __FF_GEN_DRV_H */
  66. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/