- Main Page
- Modules
- Data Structures
- Files
- Related Pages

- File List
- Globals

# ctrl_access.h

Go to the documentation of this file.

    00001
    00002
    00003
    00004
    00005
    00006
    00007
    00008
    00009
    00010
    00011
    00012
    00013
    00014
    00015
    00016
    00017
    00018
    00019
    00020
    00021
    00022
    00023 #ifndef _MEM_CTRL_H_
    00024 #define _MEM_CTRL_H_
    00025
    00026 #include "conf\conf_access.h"
    00027 #include "ctrl_status.h"
    00028
    00029 // FYC: Memory = Logical Unit
    00030 #if (LUN_0 == ENABLE)
    00031    #include    LUN_0_INCLUDE
    00032 #endif
    00033 #if (LUN_1 == ENABLE)
    00034    #include    LUN_1_INCLUDE
    00035 #endif
    00036 #if (LUN_2 == ENABLE)
    00037    #include    LUN_2_INCLUDE
    00038 #endif
    00039 #if (LUN_3 == ENABLE)
    00040    #include    LUN_3_INCLUDE
    00041 #endif
    00042 #if (LUN_4 == ENABLE)
    00043    #include    LUN_4_INCLUDE
    00044 #endif
    00045 #if (LUN_5 == ENABLE)
    00046    #include    LUN_5_INCLUDE
    00047 #endif
    00048 #if (LUN_6 == ENABLE)
    00049    #include    LUN_6_INCLUDE
    00050 #endif
    00051 #if (LUN_7 == ENABLE)
    00052    #include    LUN_7_INCLUDE
    00053 #endif
    00054 #if (LUN_USB == ENABLE)
    00055    #include    LUN_USB_INCLUDE
    00056 #endif
    00057
    00058
    00059 //------- Test the configuration in conf_access.h
    00060
    00061 // Specific option control access
    00062 #ifndef  GLOBAL_WR_PROTECT
    00063 #  error GLOBAL_WR_PROTECT must be defined with ENABLED or DISABLED in conf_access.h
    00064 #endif
    00065 //------- END OF Test the configuration in conf_access.h
    00066
    00067
    00068
    00069 //_____ D E F I N I T I O N S ______________________________________________
    00070
    00071
    00072
    00074
    00075 U8             get_nb_lun();
    00076 U8             get_cur_lun();
    00077 Ctrl_status    mem_test_unit_ready( U8 lun );
    00078 Ctrl_status    mem_read_capacity( U8 lun , U32 _MEM_TYPE_SLOW_ *u32_nb_sector );
    00079 Bool           mem_wr_protect( U8 lun );
    00080 Bool           mem_removal( U8 lun );
    00081 U8 code*       mem_name( U8 lun );
    00082
    00083
    00085
    00086
    00087 //---- Interface for USB ---------------------------------------------------
    00088    Ctrl_status memory_2_usb( U8 lun , U32 addr , U16 nb_sector );
    00089    Ctrl_status usb_2_memory( U8 lun , U32 addr , U16 nb_sector );
    00090 #include "lib_mcu\usb\usb_drv.h"
    00091 #include "conf_usb.h"
    00092 //--------------------------------------------------------------------------
    00093
    00094 //---- Interface for RAM to MEM --------------------------------------------
    00095 Ctrl_status    memory_2_ram( U8 lun , const U32 _MEM_TYPE_SLOW_ *addr , U8 _MEM_TYPE_SLOW_ *ram );
    00096 Ctrl_status    ram_2_memory( U8 lun , const U32 _MEM_TYPE_SLOW_ *addr , U8 _MEM_TYPE_SLOW_ * ram );
    00097 //--------------------------------------------------------------------------
    00098
    00099
    00101 #if (ACCESS_STREAM == ENABLED)
    00102
    00103 #define  ID_STREAM_ERR        0xFF
    00104
    00105
    00106 // RLE #include "dfc_mngt.h"
    00107
    00108 #define  TYPE_STREAM_AUDIO    DFC_ID_AUDIOPROC1
    00109 #define  TYPE_STREAM_AUDIO2   DFC_ID_AUDIOPROC2
    00110 #define  TYPE_STREAM_SIO      DFC_ID_SIO
    00111 #define  TYPE_STREAM_SPI      DFC_ID_SPI
    00112 #define  TYPE_STREAM_DEVNULL  DFC_ID_NULL_DEV
    00113
    00114    U8          stream_mem_to_mem       ( U8 src_lun , U32 src_addr , U8 dest_lun , U32 dest_addr , U16 nb_sector );
    00115    U8          stream_read_10_start    ( U8 TypeStream , U8 lun , U32 addr , U16 nb_sector );
    00116    U8          stream_write_10_start   ( U8 TypeStream , U8 lun , U32 addr , U16 nb_sector );
    00117    U8          stream_to_stream_start  ( U8 TypeStream_src , U8 TypeStream_dest  , U16 nb_sector );
    00118    Ctrl_status stream_state( U8 Id );
    00119    U16         stream_stop( U8 Id );
    00120
    00121 #endif   // (ACCESS_STREAM == ENABLED)
    00122 //--------------------------------------------------------------------------
    00123
    00124 #endif   // _MEM_CTRL_H_
    00125