Contiki 2.5
conf_access.h
Go to the documentation of this file.
1 /* This file has been prepared for Doxygen automatic documentation generation.*/
2 /*! \file conf_access.h *********************************************************************
3  *
4  * \brief
5  * This file contains the possible external configuration of the control access
6  *
7  * \addtogroup usbstick
8  *
9  * \author
10  * Atmel Corporation: http://www.atmel.com \n
11  * Support email: avr@atmel.com
12  ******************************************************************************/
13 /*
14  Copyright (c) 2004 ATMEL Corporation
15  All rights reserved.
16 
17  Redistribution and use in source and binary forms, with or without
18  modification, are permitted provided that the following conditions are met:
19 
20  * Redistributions of source code must retain the above copyright
21  notice, this list of conditions and the following disclaimer.
22  * Redistributions in binary form must reproduce the above copyright
23  notice, this list of conditions and the following disclaimer in
24  the documentation and/or other materials provided with the
25  distribution.
26  * Neither the name of the copyright holders nor the names of
27  contributors may be used to endorse or promote products derived
28  from this software without specific prior written permission.
29 
30  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
31  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
32  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
33  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
34  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
35  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
36  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
37  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
38  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
39  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
40  POSSIBILITY OF SUCH DAMAGE.
41 */
42 
43 /**
44  \addtogroup usbstorage
45  @{
46 */
47 
48 #ifndef _CONF_ACCESS_H_
49 #define _CONF_ACCESS_H_
50 
51 
52 // Active the Logical Unit
53 #define LUN_0 DISABLE // On-Chip flash vitual memory
54 #define LUN_1 DISABLE // NF 2KB
55 #define LUN_2 DISABLE // NF 512B
56 #define LUN_3 DISABLE // Data Flash
57 #define LUN_4 ENABLE //On-chip 32KB
58 #define LUN_5 DISABLE
59 #define LUN_6 DISABLE
60 #define LUN_7 DISABLE
61 #define LUN_USB DISABLE
62 
63 // LUN 0 DEFINE
64 #define LUN_0_INCLUDE "lib_mem\virtual_mem\virtual_mem.h"
65 #define Lun_0_test_unit_ready() virtual_test_unit_ready()
66 #define Lun_0_read_capacity(nb_sect) virtual_read_capacity(nb_sect)
67 #define Lun_0_wr_protect() virtual_wr_protect()
68 #define Lun_0_removal() virtual_removal()
69 #define Lun_0_read_10(ad, sec) virtual_read_10(ad, sec)
70 #define Lun_0_usb_read() virtual_usb_read()
71 #define Lun_0_write_10(ad, sec) virtual_write_10(ad, sec)
72 #define Lun_0_usb_write() virtual_usb_write()
73 #define Lun_0_ram_2_mem(addr , ram) virtual_ram_2_mem(addr, ram)
74 #define Lun_0_ram_2_mem_write() virtual_ram_2_mem_write()
75 #define Lun_0_mem_2_ram(addr , ram) virtual_mem_2_ram(addr, ram)
76 #define Lun_0_mem_2_ram_read() virtual_mem_2_ram_read()
77 #define LUN_0_NAME "VIRTUAL_MEM_ON_CHIP"
78 
79 // LUN 1 DEFINE
80 #if (LUN_1 == ENABLE)
81 #define NF_2K_MEM ENABLE
82 #else
83 #define NF_2K_MEM DISABLE
84 #endif
85 #define LUN_1_INCLUDE "lib_mem\nf_1x_2kb\nf_mem.h"
86 #define Lun_1_test_unit_ready() nf_test_unit_ready()
87 #define Lun_1_read_capacity(nb_sect) nf_read_capacity(nb_sect)
88 #define Lun_1_wr_protect() nf_wr_protect()
89 #define Lun_1_removal() nf_removal()
90 #define Lun_1_read_10(ad, sec) nf_read_10(ad, sec)
91 #define Lun_1_usb_read() nf_usb_read()
92 #define Lun_1_write_10(ad, sec) nf_write_10(ad, sec)
93 #define Lun_1_usb_write() nf_usb_write()
94 #define Lun_1_ram_2_mem(addr , ram) TODO
95 #define Lun_1_ram_2_mem_write() TODO
96 #define Lun_1_mem_2_ram(addr , ram) TODO
97 #define Lun_1_mem_2_ram_read() TODO
98 
99 // LUN 2 DEFINE
100 #if (LUN_2 == ENABLE)
101 #define NF_512_MEM ENABLE
102 #else
103 #define NF_512_MEM DISABLE
104 #endif
105 #define LUN_2_INCLUDE "lib_mem\nf_1x_512\nf_mem.h"
106 #define Lun_2_test_unit_ready() nf_test_unit_ready()
107 #define Lun_2_read_capacity(nb_sect) nf_read_capacity(nb_sect)
108 #define Lun_2_wr_protect() nf_wr_protect()
109 #define Lun_2_removal() nf_removal()
110 #define Lun_2_read_10(ad, sec) nf_read_10(ad, sec)
111 #define Lun_2_usb_read() nf_usb_read()
112 #define Lun_2_write_10(ad, sec) nf_write_10(ad, sec)
113 #define Lun_2_usb_write() nf_usb_write()
114 #define Lun_2_ram_2_mem(addr , ram) TODO
115 #define Lun_2_ram_2_mem_write() TODO
116 #define Lun_2_mem_2_ram(addr , ram) TODO
117 #define Lun_2_mem_2_ram_read() TODO
118 
119 // LUN 3 DEFINE
120 #if (LUN_3 == ENABLE)
121 #define DF_MEM ENABLE
122 #else
123 #define DF_MEM DISABLE
124 #endif
125 #define LUN_ID_DF LUN_ID_3
126 #define LUN_3_INCLUDE "lib_mem\df\df_mem.h"
127 #define Lun_3_test_unit_ready() df_test_unit_ready()
128 #define Lun_3_read_capacity(nb_sect) df_read_capacity(nb_sect)
129 #define Lun_3_wr_protect() df_wr_protect()
130 #define Lun_3_removal() df_removal()
131 #define Lun_3_read_10(ad, sec) df_read_10(ad, sec)
132 #define Lun_3_usb_read() df_usb_read()
133 #define Lun_3_write_10(ad, sec) df_write_10(ad, sec)
134 #define Lun_3_usb_write() df_usb_write()
135 #define Lun_3_ram_2_mem(addr , ram) df_ram_2_df(addr, ram)
136 #define Lun_3_ram_2_mem_write() df_ram_2_df_write()
137 #define Lun_3_mem_2_ram(addr , ram) df_df_2_ram(addr, ram)
138 #define Lun_3_mem_2_ram_read() df_df_2_ram_read()
139 #define LUN_3_NAME "\"On board data flash\""
140 
141 // LUN 3 DEFINE
142 #if (LUN_3 == ENABLE)
143 #define AVR_MEM ENABLE
144 #else
145 #define AVR_MEM DISABLE
146 #endif
147 #define LUN_ID_AVRF LUN_ID_4
148 #define LUN_4_INCLUDE "storage/avr_flash.h"
149 #define Lun_4_test_unit_ready() avrf_test_unit_ready()
150 #define Lun_4_read_capacity(nb_sect) avrf_read_capacity(nb_sect)
151 #define Lun_4_wr_protect() avrf_wr_protect()
152 #define Lun_4_removal() avrf_removal()
153 #define Lun_4_read_10(ad, sec) avrf_read_10(ad, sec)
154 #define Lun_4_usb_read() avrf_usb_read()
155 #define Lun_4_write_10(ad, sec) avrf_write_10(ad,sec)
156 #define Lun_4_usb_write() avrf_usb_write()
157 #define Lun_4_ram_2_mem(addr , ram) TODO
158 #define Lun_4_ram_2_mem_write() TODO
159 #define Lun_4_mem_2_ram(addr , ram) TODO
160 #define Lun_4_mem_2_ram_read() TODO
161 #define LUN_4_NAME "\"AVR Flash Memory\""
162 
163 
164 // LUN USB DEFINE
165 #if (LUN_USB == ENABLE)
166 #define MEM_USB ENABLE
167 #else
168 #define MEM_USB DISABLE
169 #endif
170 #define LUN_USB_INCLUDE "lib_mem\host_mem\host_mem.h"
171 #define Lun_usb_test_unit_ready(lun) host_test_unit_ready(lun)
172 #define Lun_usb_read_capacity(lun,nb_sect) host_read_capacity(lun,nb_sect)
173 #define Lun_usb_wr_protect(lun) host_wr_protect(lun)
174 #define Lun_usb_removal() host_removal()
175 #define Lun_usb_ram_2_mem(addr , ram) host_write_10_ram(addr, ram)
176 #define Lun_usb_mem_2_ram(addr , ram) host_read_10_ram(addr, ram)
177 #define LUN_USB_NAME "\"USB Remote memory\""
178 
179 
180 // ATMEL DEFINE - DO NOT MODIFY
181 
182 // Active interface fonction
183 #define ACCESS_USB ENABLED // USB I/O in control access
184 #define ACCESS_STREAM DISABLED // Stream I/O in control access
185 #define ACCESS_STREAM_RECORD DISABLED // Stream I/O in control access AND RECORD MODE
186 #define ACCESS_MEM_TO_RAM DISABLED // RAM to Mem I/O in control access
187 #define ACCESS_MEM_TO_MEM DISABLED // Mem to Mem I/O in control access
188 
189 
190 
191 // Specific option control access
192 #define GLOBAL_WR_PROTECT DISABLED // To manage a global write protection
193 
194 
195 #endif //! _CONF_ACCESS_H_
196 
197 /** @} */