<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<IP DBVersion="V4.0" Name="FATFS" Version="STM32Cube_FW_L0_V1.0.0" RootFolder="Middlewares/Third_Party/FatFs/" CodeTemplate="fatfs_c.ftl;fatfs_h.ftl"
    IncludeFile="ff.h;ff_gen_drv.h"
    xmlns:ns0="http://www.w3.org/2001/XMLSchema-instance"
    ns0:schemaLocation="http://mcd.rou.st.com/modules.php?name=mcu ../../../../../../../doc/V4/Development/Specifications/db/IP_Configs.xsd"
    xmlns="http://mcd.rou.st.com/modules.php?name=mcu">

    <!-- NB: No SDIO on L0 (kept to avoid failing during automatic tests) -->
    <RefConfig Name="FATFS_SDIO_Init" Comment="SD">          
        <Component Name="Middleware:FATFS:SDIO"/>
        <Component Name="Middleware:FATFS:CODE_PAGE:$VIRTUAL_CODE_PAGE"/>
        <ConfigFile Name="FF_CONF"/>  
        <ConfigFile Name="FATFS_INIT"/>
        <ConfigFile Name="FATFS_HEADER"/>
    </RefConfig>
    
    <!-- NB: No USBH on L0 (kept to avoid failing during automatic tests) -->
    <RefConfig Name="FATFS_USB_Init" Comment="USBH">             
        <Component Name="Middleware:FATFS:USBH"/>
        <Component Name="Middleware:FATFS:CODE_PAGE:$VIRTUAL_CODE_PAGE"/>
        <ConfigFile Name="FF_CONF"/>
        <ConfigFile Name="FATFS_INIT"/>
        <ConfigFile Name="FATFS_HEADER"/>
    </RefConfig>
    
    <!-- (kept to avoid failing during automatic tests) -->
    <RefConfig Name="FATFS_FSMC_NAND16_Init" Comment="NAND">      
        <Component Name="Middleware:FATFS:NAND"/>
        <Component Name="Middleware:FATFS:CODE_PAGE:$VIRTUAL_CODE_PAGE"/>
        <ConfigFile Name="FF_CONF"/>
        <ConfigFile Name="FATFS_INIT"/>
        <ConfigFile Name="FATFS_HEADER"/>
    </RefConfig>
    
    <!-- NB: No SDRAM on L0 (kept to avoid failing during automatic tests) -->
    <RefConfig Name="FATFS_FMC_SDRAM_Init" Comment="SDRAMDISK">      
        <Component Name="Middleware:FATFS:SDRAM"/>
        <Component Name="Middleware:FATFS:CODE_PAGE:$VIRTUAL_CODE_PAGE"/>
        <ConfigFile Name="FF_CONF"/>
         <!--  <ConfigFile Name="FF_HANDLES"/> -->  
        <ConfigFile Name="FATFS_INIT"/>
        <ConfigFile Name="FATFS_HEADER"/>
    </RefConfig>
    
    <RefConfig Name="FATFS_USER_DEFINED_Init" Comment="USER">             
        <Component Name="Middleware:FATFS:GENERIC"/>
        <Component Name="Middleware:FATFS:CODE_PAGE:$VIRTUAL_CODE_PAGE"/>
        <ConfigFile Name="FF_CONF"/>
        <ConfigFile Name="USER_DISKIO_C"/>
        <ConfigFile Name="USER_DISKIO_H"/>
        <ConfigFile Name="FATFS_INIT"/>
        <ConfigFile Name="FATFS_HEADER"/>
    </RefConfig>
    
    <RefComponent Cclass="Middleware" Cgroup="FATFS" Cversion="0.1.0">
        <!-- <File Name="src/*.h" Category="header"/>  -->
        <File Name="src/diskio.h" Category="header"/>
        <File Name="src/ff.h" Category="header"/>
        <File Name="src/ff_gen_drv.h" Category="header"/>
        <File Name="src/integer.h" Category="header"/>
        
        <!--  <File Name="src/*.c" Category="source"/> -->
        <File Name="src/diskio.c" Category="source"/>
        <File Name="src/ff.c" Category="source"/>
        <File Name="src/ff_gen_drv.c" Category="source"/>
        
        <File Name="src/option/syscall.c" Category="source"/>

        <SubComponent Csub="CODE_PAGE" Cvariant="932" >
            <File Name="src/option/cc932.c" Category="source"/>
        </SubComponent>
        <SubComponent Csub="CODE_PAGE" Cvariant="936" >
            <File Name="src/option/cc936.c" Category="source"/>
        </SubComponent>
        <SubComponent Csub="CODE_PAGE" Cvariant="949" >
            <File Name="src/option/cc949.c" Category="source"/>
        </SubComponent>
        <SubComponent Csub="CODE_PAGE" Cvariant="950" >
            <File Name="src/option/cc950.c" Category="source"/>
        </SubComponent>
        <SubComponent Csub="CODE_PAGE" Cvariant="850" >
            <File Name="src/option/ccsbcs.c" Category="source"/>
        </SubComponent>
    </RefComponent>

    <!-- use specific template file "fatfs_conf_R12c.ftl" to generate header file containing #define -->
    <RefConfigFile Name="FF_CONF" Description="Header file for #define" Template="fatfs_conf_R12c.ftl">      
        <File Name="Target/ffconf.h" Category="header" Version="R0.12" Condition="all"/>
        <!-- Parameters for Function and Buffer Configurations -->
        <Argument Name="_FS_TINY" GenericType="simple" Comment="0:Normal or 1:Tiny"/>
        <Argument Name="_FS_READONLY" GenericType="simple" Comment="0:Read/Write or 1:Read only"/>
        <Argument Name="_FS_MINIMIZE" GenericType="simple" Comment="0 to 3"/>
        <Argument Name="_USE_STRFUNC" GenericType="simple" Comment="0:Disable or 1-2:Enable"/>
        <Argument Name="_USE_FIND" GenericType="simple" Comment="0:Disable or 1:Enable"/>                  <!-- New in R0.11 --> 
        <Argument Name="_USE_MKFS" GenericType="simple" Comment="0:Disable or 1:Enable"/>
        <Argument Name="_USE_FORWARD" GenericType="simple" Comment="0:Disable or 1:Enable"/>
        <Argument Name="_USE_LABEL" GenericType="simple" Comment="0:Disable or 1:Enable"/>
        <Argument Name="_USE_FASTSEEK" GenericType="simple" Comment="0:Disable or 1:Enable"/>
        <!-- Parameters for Locale and Namespace Configurations -->
        <Argument Name="_CODE_PAGE" GenericType="simple" Comment="The _CODE_PAGE specifies the OEM code page to be used on the target system"/>
        <Argument Name="_USE_LFN" GenericType="simple" Comment="0 to 3"/>
        <Argument Name="_MAX_LFN" GenericType="simple" Comment="Maximum LFN length to handle (12 to 255)"/>
        <Argument Name="_LFN_UNICODE" GenericType="simple" Comment="0:ANSI/OEM or 1:Unicode"/>
        <Argument Name="_STRF_ENCODE" GenericType="simple" Comment="0:ANSI/OEM, 1:UTF-16LE, 2:UTF-16BE, 3:UTF-8"/>
        <Argument Name="_FS_RPATH" GenericType="simple" Comment="0 to 2"/>	
        <!-- Parameters for Physical Drive Configurations  -->
        <Argument Name="_VOLUMES" GenericType="simple" Comment="Number of volumes (logical drives) to be used"/>
        <Argument Name="_MAX_SS" GenericType="simple" Comment="512, 1024, 2048 or 4096"/>
        <Argument Name="_MIN_SS" GenericType="simple" Comment="512, 1024, 2048 or 4096"/>
        <Argument Name="_MULTI_PARTITION" GenericType="simple" Comment="0:Single partition, 1:Enable multiple partition"/>
        <Argument Name="_USE_TRIM" GenericType="simple" Comment="0:Disable or 1:Enable"/>                  <!-- Renamed in R0.11 --> 
        <Argument Name="_FS_NOFSINFO" GenericType="simple" Comment="0: Load all informations in the FSINFO if available, 1: Do not trust free cluster count in the FSINFO"/>
        <!-- Parameters for System Configurations   -->
        <Argument Name="_FS_NORTC" GenericType="simple" Comment="0 or 1"/>                                 <!-- New in R0.11 -->  
        <Argument Name="_NORTC_YEAR" GenericType="simple" Comment="1980..2107"/>                           <!-- New in R0.11 -->  
        <Argument Name="_NORTC_MON" GenericType="simple" Comment="1..12"/>                                 <!-- New in R0.11 -->  
        <Argument Name="_NORTC_MDAY" GenericType="simple" Comment="1..31"/>                                <!-- New in R0.11 -->  
        <Argument Name="_WORD_ACCESS" GenericType="simple" Comment="0 or 1"/>
        <Argument Name="_FS_REENTRANT" GenericType="simple" Comment="0:Disable or 1:Enable"/>
        <Argument Name="_FS_TIMEOUT" GenericType="simple" Comment="Timeout period in unit of time ticks"/>
        <Argument Name="_SYNC_t" GenericType="simple" Comment="O/S dependent type of sync object. e.g. HANDLE, OS_EVENT*, ID and etc.."/>		
        <Argument Name="_FS_LOCK" GenericType="simple" Comment="0:Disable or >=1:Enable"/>        
        <!-- Internal: for detecting enabled modes and include the right files -->
        <Argument Name="_FS_FATFS_SDIO" GenericType="simple" Comment="0:Disable or >=1:Enable"/> 
        <Argument Name="_FS_FATFS_SRAM" GenericType="simple" Comment="0:Disable or >=1:Enable"/> 
        <Argument Name="_FS_FATFS_USB" GenericType="simple" Comment="0:Disable or >=1:Enable"/> 
        <Argument Name="_HUSBH" GenericType="simple" Comment=""/>
        <!-- R0.12 -->
        <Argument Name="_USE_EXPAND" GenericType="simple" Comment=""/>
        <Argument Name="_USE_CHMOD" GenericType="simple" Comment=""/>
        <Argument Name="_FS_EXFAT" GenericType="simple" Comment=""/>
        <!-- To better support CMSIS-RTOS v2 with updated FatFS syscall.c -->
        <Argument Name="_USE_MUTEX" GenericType="simple" Comment="FatFS synchronization object"/>		
    </RefConfigFile> 
   
    <!-- Generate a generic diskio C driver file  -->
    <RefConfigFile Name="USER_DISKIO_C" Description="GENERIC C diskio driver file" Template="fatfs_user_diskio_c.ftl">       
        <File Name="Target/user_diskio.c" Category="source" Version="R0.12" Condition="all"/>    
        <Argument Name="NEW_DISKIO_API" GenericType="simple" Comment=""/>
    </RefConfigFile>
    
    <!-- Generate a generic diskio H driver file -->
    <RefConfigFile Name="USER_DISKIO_H" Description="GENERIC H driver file" Template="fatfs_user_diskio_h.ftl">       
        <File Name="Target/user_diskio.h" Category="header" Version="R0.12" Condition="all"/>                    
    </RefConfigFile>
    
    <!-- Generate a init code file (fatfs.c) -->
    <RefConfigFile Name="FATFS_INIT" Description="FATFS Init code file" Template="fatfs_init.ftl">       
        <File Name="App/fatfs.c" Category="source" Version="R0.12" Condition="all"/>        
        <Argument Name="_FS_NORTC" GenericType="simple" Comment="0 or 1"/>                           <!-- New in R0.11 -->                  
        <Argument Name="_MULTI_PARTITION" GenericType="simple" Comment="0 or 1"/>
    </RefConfigFile>
    
    <!-- Generate header for the init code file (fatfs.h) -->
    <RefConfigFile Name="FATFS_HEADER" Description="FATFS header file" Template="fatfs_header.ftl">       
        <File Name="App/fatfs.h" Category="source" Version="R0.12" Condition="all"/>
    </RefConfigFile>
</IP>
