df_mem.h

Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 #ifndef _DFMEM_H_
00015 #define _DFMEM_H_
00016 
00017 #include "conf\conf_access.h"
00018 #include "modules\control_access\ctrl_status.h"
00019 
00020 
00021 
00022 
00023 //_____ D E F I N I T I O N S ______________________________________________
00024 
00026 #define  ENTRY_SIZE           32    // size of entrie in byte
00027 
00028 
00029 
00030 // First sector of the disk virtual (this disk isn't partitioned, only one partion)
00031 #define  PBR_SECTOR           (0)
00032 #define  FAT_SECTOR           (PBR_SECTOR  + VMEM_RESERVED_SIZE)
00033 #define  ROOT_SECTOR          (FAT_SECTOR  + (VMEM_SIZE_FAT*VMEM_NB_FATS))
00034 #define  FILE_SECTOR          (ROOT_SECTOR + ((ENTRY_SIZE*VMEM_NB_ROOT_ENTRY) / VMEM_SECTOR_SIZE))                   // 1(sector) = size root dir
00035 
00036 
00037 
00038 
00039 
00040 //---- CONTROL FONCTIONS ----
00041 
00042 // those fonctions are declared in df_mem.h
00043 void           df_mem_init(void);
00044 Ctrl_status    df_test_unit_ready(void);
00045 Ctrl_status    df_read_capacity( U32 _MEM_TYPE_SLOW_ *u32_nb_sector );
00046 Bool           df_wr_protect(void);
00047 Bool           df_removal(void);
00048 
00049 
00050 //---- ACCESS DATA FONCTIONS ----
00051 
00052 // Standard functions for open in read/write mode the device
00053 Ctrl_status    df_read_10( U32 addr , U16 nb_sector );
00054 Ctrl_status    df_write_10( U32 addr , U16 nb_sector );
00055 
00056 // Standard functions for read/write 1 sector to 1 sector ram buffer
00057 Ctrl_status    df_ram_2_df( U32 addr, U8 *ram);
00058 Ctrl_status    df_df_2_ram( U32 addr, U8 *ram);
00059 
00060 Ctrl_status    df_ram_2_df_write(void);
00061 Ctrl_status    df_df_2_ram_read(void);
00062 
00063 //** If your device transfer have a specific transfer for USB (Particularity of Chejudo product, or bootloader)
00064 #ifdef DF_VALIDATION
00065 #include "virtual_usb.h"
00066 #else
00067 #include "lib_mcu\usb\usb_drv.h"    // In this case the driver must be known for the USB access
00068 #endif
00069 Ctrl_status df_usb_read( void );
00070 Ctrl_status df_usb_write( void );
00071 
00072 
00073 
00074 
00075 
00076 #endif   // _DFMEM_H_
00077 

Generated on Fri Jun 15 14:07:32 2007 for Atmel by  doxygen 1.5.1-p1