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 UC3A3
00079 # define USB_HIGH_SPEED_SUPPORT ENABLED
00080 #else
00081 # define USB_HIGH_SPEED_SUPPORT DISABLED
00082 #endif
00083
00085
00086
00087
00088
00092
00093 #if USB_HOST_FEATURE == ENABLED
00094
00103 #define VID_PID_TABLE {ATMEL_VID, 1, MS_EXAMPLE_PID}
00104
00115 #define CLASS_SUBCLASS_PROTOCOL {MS_CLASS, SFF8020I_MMC2_SUBCLASS, BULK_PROTOCOL,\
00116 MS_CLASS, SFF8070I_SUBCLASS, BULK_PROTOCOL,\
00117 MS_CLASS, SCSI_SUBCLASS, BULK_PROTOCOL}
00118
00120 #define SIZEOF_DATA_STAGE 250
00121
00123 #define DEVICE_ADDRESS 0x05
00124
00126 #define MAX_INTERFACE_SUPPORTED 0x03
00127
00129 #define MAX_EP_PER_INTERFACE 3
00130
00134 #define HOST_STRICT_VID_PID_TABLE DISABLE
00135
00137 #define HOST_AUTO_CFG_ENDPOINT ENABLE
00138
00140 #define HOST_CONTINUOUS_SOF_INTERRUPT DISABLE
00141
00143 #define HOST_ERROR_RESTART ENABLE
00144
00146 #define USB_HOST_PIPE_INTERRUPT_TRANSFER DISABLE
00147
00149 #define ID_PIN_CHANGE_GENERATE_RESET ENABLE
00150
00152 #define TIMEOUT_DELAY_ENABLE ENABLE
00153
00155 #define TIMEOUT_DELAY 10
00156
00158 #define NAK_TIMEOUT_ENABLE DISABLE
00159
00161 #define NAK_SEND_TIMEOUT 0x0FFF
00162
00164 #define NAK_RECEIVE_TIMEOUT 0x0FFF
00165
00166 #if HOST_AUTO_CFG_ENDPOINT == DISABLE
00168 #define User_configure_endpoint()
00169 #endif
00170
00174
00175
00176 #define Usb_id_transition_action()
00177 #define Host_device_disconnection_action() (ms_new_device_connected = FALSE, ms_connected = FALSE)
00178 #define Host_device_connection_action()
00179 #define Host_sof_action() host_sof_action()
00180 #define Host_suspend_action()
00181 #define Host_hwup_action()
00182 #define Host_device_supported_action()
00183 #define Host_device_not_supported_action()
00184 #define Host_new_device_connection_action() (ms_new_device_connected = TRUE)
00185 #define Host_device_class_not_supported_action()
00186 #define Host_device_error_action()
00187
00192 #define Host_user_check_class_action(x)
00194
00195 extern volatile Bool ms_new_device_connected;
00196 extern volatile Bool ms_connected;
00197 extern void host_sof_action(void);
00198 extern void host_suspend_action(void);
00199
00200 #endif // USB_HOST_FEATURE == ENABLED
00201
00203
00204
00205
00206
00210
00211 #if USB_DEVICE_FEATURE == ENABLED
00212
00213 #define NB_ENDPOINTS 3 // Number of endpoints in the application including control endpoint
00214 #define EP_MS_IN 1
00215 #define EP_MS_OUT 2
00216
00220
00221
00222 #define Usb_sof_action() usb_sof_action()
00223 #define Usb_wake_up_action()
00224 #define Usb_resume_action()
00225 #define Usb_suspend_action()
00226 #define Usb_reset_action()
00227 #define Usb_vbus_on_action()
00228 #define Usb_vbus_off_action()
00229 #define Usb_set_configuration_action()
00231
00232 #define SBC_VENDOR_ID "ATMEL " // 8 bytes only
00233 #define SBC_PRODUCT_ID "UC3 MASS STORAGE" // 16 bytes only
00234 #define SBC_REVISION_ID "0.00" // 4 bytes only
00235
00239
00240
00241 #define Scsi_start_read_action()
00242 #define Scsi_stop_read_action()
00243 #define Scsi_start_write_action()
00244 #define Scsi_stop_write_action()
00246
00247 extern void usb_sof_action(void);
00248 extern void usb_suspend_action(void);
00249
00250 #endif // USB_DEVICE_FEATURE == ENABLED
00251
00253
00254
00256 #define USB_INT_LEVEL AVR32_INTC_INT0
00257
00259 #define LOG_STR(str) print_dbg(str)
00260
00261
00263
00264
00265 #endif // _CONF_USB_H_