Huseyin Buyukesmeli / FatFS

Dependents:   DISCO-F746NG_uSD Active-WolfMan_V2-5-All-Frank-Board-Functions_copy DISCO-F746NG_uSD DISCO-F746NG_uSD

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ff_gen_drv.h Source File

ff_gen_drv.h

Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    ff_gen_drv.h 
00004   * @author  MCD Application Team
00005   * @version V1.4.0
00006   * @date    23-December-2016
00007   * @brief   Header for ff_gen_drv.c module.
00008   ******************************************************************************
00009   * @attention
00010   *
00011   * <h2><center>&copy; COPYRIGHT 2016 STMicroelectronics</center></h2>
00012   *
00013   * Redistribution and use in source and binary forms, with or without 
00014   * modification, are permitted, provided that the following conditions are met:
00015   *
00016   * 1. Redistribution of source code must retain the above copyright notice, 
00017   *    this list of conditions and the following disclaimer.
00018   * 2. Redistributions in binary form must reproduce the above copyright notice,
00019   *    this list of conditions and the following disclaimer in the documentation
00020   *    and/or other materials provided with the distribution.
00021   * 3. Neither the name of STMicroelectronics nor the names of other 
00022   *    contributors to this software may be used to endorse or promote products 
00023   *    derived from this software without specific written permission.
00024   * 4. This software, including modifications and/or derivative works of this 
00025   *    software, must execute solely and exclusively on microcontroller or
00026   *    microprocessor devices manufactured by or for STMicroelectronics.
00027   * 5. Redistribution and use of this software other than as permitted under 
00028   *    this license is void and will automatically terminate your rights under 
00029   *    this license. 
00030   *
00031   * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" 
00032   * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT 
00033   * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
00034   * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
00035   * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT 
00036   * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00037   * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00038   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 
00039   * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 
00040   * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
00041   * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
00042   * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00043   *
00044   ******************************************************************************
00045   */
00046 
00047 /* Define to prevent recursive inclusion -------------------------------------*/
00048 #ifndef __FF_GEN_DRV_H
00049 #define __FF_GEN_DRV_H
00050 
00051 #ifdef __cplusplus
00052  extern "C" {
00053 #endif 
00054 
00055 /* Includes ------------------------------------------------------------------*/
00056 #include "diskio.h"
00057 #include "ff.h"
00058 
00059 /* Exported types ------------------------------------------------------------*/
00060 
00061 /** 
00062   * @brief  Disk IO Driver structure definition  
00063   */ 
00064 typedef struct
00065 {
00066   DSTATUS (*disk_initialize) (BYTE);                     /*!< Initialize Disk Drive                     */
00067   DSTATUS (*disk_status)     (BYTE);                     /*!< Get Disk Status                           */
00068   DRESULT (*disk_read)       (BYTE, BYTE*, DWORD, UINT);       /*!< Read Sector(s)                            */
00069 #if _USE_WRITE == 1 
00070   DRESULT (*disk_write)      (BYTE, const BYTE*, DWORD, UINT); /*!< Write Sector(s) when _USE_WRITE = 0       */
00071 #endif /* _USE_WRITE == 1 */
00072 #if _USE_IOCTL == 1  
00073   DRESULT (*disk_ioctl)      (BYTE, BYTE, void*);              /*!< I/O control operation when _USE_IOCTL = 1 */
00074 #endif /* _USE_IOCTL == 1 */
00075 
00076 }Diskio_drvTypeDef;
00077 
00078 /** 
00079   * @brief  Global Disk IO Drivers structure definition  
00080   */ 
00081 typedef struct
00082 { 
00083   uint8_t                 is_initialized[_VOLUMES];
00084   Diskio_drvTypeDef       *drv[_VOLUMES];
00085   uint8_t                 lun[_VOLUMES];
00086   __IO uint8_t            nbr;
00087 
00088 }Disk_drvTypeDef;
00089 
00090 /* Exported constants --------------------------------------------------------*/
00091 /* Exported macro ------------------------------------------------------------*/
00092 /* Exported functions ------------------------------------------------------- */
00093 uint8_t FATFS_LinkDriverEx(Diskio_drvTypeDef *drv, char *path, uint8_t lun);
00094 uint8_t FATFS_LinkDriver(Diskio_drvTypeDef *drv, char *path);
00095 uint8_t FATFS_UnLinkDriver(char *path);
00096 uint8_t FATFS_LinkDriverEx(Diskio_drvTypeDef *drv, char *path, BYTE lun);
00097 uint8_t FATFS_UnLinkDriverEx(char *path, BYTE lun);
00098 uint8_t FATFS_GetAttachedDriversNbr(void);
00099 
00100 #ifdef __cplusplus
00101 }
00102 #endif
00103 
00104 #endif /* __FF_GEN_DRV_H */
00105 
00106 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
00107