00001
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048 #ifndef _CONF_USB_H_
00049 #define _CONF_USB_H_
00050
00051 #include "compiler.h"
00052 #include "board.h"
00053 #include "print_funcs.h"
00054 #include "usb_ids.h"
00055
00056
00060
00061
00062
00067
00071 #define USB_HOST_FEATURE DISABLED
00072
00076 #define USB_DEVICE_FEATURE ENABLED
00077
00078 #if __GNUC__ && __AVR32__ && \
00079 (__AVR32_UC3A364__ || __AVR32_UC3A364S__ || \
00080 __AVR32_UC3A3128__ || __AVR32_UC3A3128S__ || \
00081 __AVR32_UC3A3256__ || __AVR32_UC3A3256S__)
00082 # define USB_HIGH_SPEED_SUPPORT ENABLED
00083
00084 #elif __ICCAVR32__ && \
00085 (__AT32UC3A364__ || __AT32UC3A364S__ || \
00086 __AT32UC3A3128__ || __AT32UC3A3128S__ || \
00087 __AT32UC3A3256__ || __AT32UC3A3256S__)
00088 # define USB_HIGH_SPEED_SUPPORT ENABLED
00089 #else
00090 # define USB_HIGH_SPEED_SUPPORT DISABLED
00091 #endif
00092
00094
00095
00096
00097
00101
00102 #if USB_HOST_FEATURE == ENABLED
00103
00112 #define VID_PID_TABLE {ATMEL_VID, 1, MS_EXAMPLE_PID}
00113
00124 #define CLASS_SUBCLASS_PROTOCOL {MS_CLASS, SFF8020I_MMC2_SUBCLASS, BULK_PROTOCOL,\
00125 MS_CLASS, SFF8070I_SUBCLASS, BULK_PROTOCOL,\
00126 MS_CLASS, SCSI_SUBCLASS, BULK_PROTOCOL}
00127
00129 #define SIZEOF_DATA_STAGE 250
00130
00132 #define DEVICE_ADDRESS 0x05
00133
00135 #define MAX_INTERFACE_SUPPORTED 0x03
00136
00138 #define MAX_EP_PER_INTERFACE 3
00139
00143 #define HOST_STRICT_VID_PID_TABLE DISABLE
00144
00146 #define HOST_AUTO_CFG_ENDPOINT ENABLE
00147
00149 #define HOST_CONTINUOUS_SOF_INTERRUPT DISABLE
00150
00152 #define HOST_ERROR_RESTART ENABLE
00153
00155 #define USB_HOST_PIPE_INTERRUPT_TRANSFER DISABLE
00156
00158 #define ID_PIN_CHANGE_GENERATE_RESET ENABLE
00159
00161 #define TIMEOUT_DELAY_ENABLE ENABLE
00162
00164 #define TIMEOUT_DELAY 10
00165
00167 #define NAK_TIMEOUT_ENABLE DISABLE
00168
00170 #define NAK_SEND_TIMEOUT 0x0FFF
00171
00173 #define NAK_RECEIVE_TIMEOUT 0x0FFF
00174
00175 #if HOST_AUTO_CFG_ENDPOINT == DISABLE
00177 #define User_configure_endpoint()
00178 #endif
00179
00183
00184
00185 #define Usb_id_transition_action()
00186 #define Host_device_disconnection_action() (ms_new_device_connected = FALSE, ms_connected = FALSE)
00187 #define Host_device_connection_action()
00188 #define Host_sof_action() host_sof_action()
00189 #define Host_suspend_action()
00190 #define Host_hwup_action()
00191 #define Host_device_supported_action()
00192 #define Host_device_not_supported_action()
00193 #define Host_new_device_connection_action() (ms_new_device_connected = TRUE)
00194 #define Host_device_class_not_supported_action()
00195 #define Host_device_error_action()
00196
00201 #define Host_user_check_class_action(x)
00203
00204 extern volatile Bool ms_new_device_connected;
00205 extern volatile Bool ms_connected;
00206 extern void host_sof_action(void);
00207 extern void host_suspend_action(void);
00208
00209 #endif // USB_HOST_FEATURE == ENABLED
00210
00212
00213
00214
00215
00219
00220 #if USB_DEVICE_FEATURE == ENABLED
00221
00222 #define NB_ENDPOINTS 3 // Number of endpoints in the application including control endpoint
00223 #define EP_MS_IN 1
00224 #define EP_MS_OUT 2
00225
00229
00230
00231 #define Usb_sof_action() usb_sof_action()
00232 #define Usb_wake_up_action()
00233 #define Usb_resume_action()
00234 #define Usb_suspend_action()
00235 #define Usb_reset_action()
00236 #define Usb_vbus_on_action()
00237 #define Usb_vbus_off_action()
00238 #define Usb_set_configuration_action()
00240
00241 #define SBC_VENDOR_ID "ATMEL " // 8 bytes only
00242 #define SBC_PRODUCT_ID "UC3 MASS STORAGE" // 16 bytes only
00243 #define SBC_REVISION_ID "0.00" // 4 bytes only
00244
00248
00249
00250 #define Scsi_start_read_action()
00251 #define Scsi_stop_read_action()
00252 #define Scsi_start_write_action()
00253 #define Scsi_stop_write_action()
00255
00256 extern void usb_sof_action(void);
00257 extern void usb_suspend_action(void);
00258
00259 #endif // USB_DEVICE_FEATURE == ENABLED
00260
00262
00263
00265 #define USB_INT_LEVEL AVR32_INTC_INT0
00266
00268 #define LOG_STR(str) print_dbg(str)
00269
00270
00272
00273
00274 #endif // _CONF_USB_H_