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 "board.h"
00052
00053 #include "tracedump.h"
00054 #include "supervisor.h"
00055 #include "usb_ids.h"
00056
00057
00061
00062
00063
00068
00072 #define USB_HOST_FEATURE ENABLED
00073
00077 #define USB_DEVICE_FEATURE ENABLED
00078
00080
00081
00082
00083
00087
00088 #if USB_HOST_FEATURE == ENABLED
00089
00098 #define VID_PID_TABLE {ATMEL_VID, 1, EVK1100_CTRL_PANEL_DEMO_PID}
00099
00110 #define CLASS_SUBCLASS_PROTOCOL {MS_CLASS, SFF8020I_MMC2_SUBCLASS, BULK_PROTOCOL,\
00111 MS_CLASS, SFF8070I_SUBCLASS, BULK_PROTOCOL,\
00112 MS_CLASS, SCSI_SUBCLASS, BULK_PROTOCOL}
00113
00115 #define SIZEOF_DATA_STAGE 250
00116
00118 #define DEVICE_ADDRESS 0x05
00119
00121 #define MAX_INTERFACE_SUPPORTED 0x03
00122
00124 #define MAX_EP_PER_INTERFACE 3
00125
00129 #define HOST_STRICT_VID_PID_TABLE DISABLE
00130
00132 #define HOST_AUTO_CFG_ENDPOINT ENABLE
00133
00135 #define HOST_CONTINUOUS_SOF_INTERRUPT DISABLE
00136
00138 #define HOST_ERROR_RESTART ENABLE
00139
00141 #define USB_HOST_PIPE_INTERRUPT_TRANSFER DISABLE
00142
00144 #define ID_PIN_CHANGE_GENERATE_RESET ENABLE
00145
00147 #define TIMEOUT_DELAY_ENABLE ENABLE
00148
00150 #define TIMEOUT_DELAY 10
00151
00153 #define NAK_TIMEOUT_ENABLE DISABLE
00154
00156 #define NAK_SEND_TIMEOUT 0x0FFF
00157
00159 #define NAK_RECEIVE_TIMEOUT 0x0FFF
00160
00161 #if HOST_AUTO_CFG_ENDPOINT == DISABLE
00163 #define User_configure_endpoint()
00164 #endif
00165
00169
00170
00171 #define Usb_id_transition_action()
00172 #define Host_device_disconnection_action() ( v_supervisor_Device_Disconnects() )
00173 #define Host_device_connection_action() ( v_supervisor_Device_Connects() )
00174 #define Host_sof_action() host_sof_action()
00175 #define Host_suspend_action()
00176 #define Host_hwup_action()
00177 #define Host_device_supported_action()
00178 #define Host_device_not_supported_action()
00179 #define Host_new_device_connection_action() (ms_new_device_connected = TRUE)
00180 #define Host_device_class_not_supported_action()
00181 #define Host_device_error_action()
00182
00187 #define Host_user_check_class_action(x)
00189
00190 extern volatile Bool ms_new_device_connected;
00191 extern volatile Bool ms_connected;
00192 extern void host_sof_action(void);
00193 extern void host_suspend_action(void);
00194
00195 #endif // USB_HOST_FEATURE == ENABLED
00196
00198
00199
00200
00201
00205
00206 #if USB_DEVICE_FEATURE == ENABLED
00207
00208 #define NB_ENDPOINTS 3 // Number of endpoints in the application including control endpoint
00209 #define EP_MS_IN 1
00210 #define EP_MS_OUT 2
00211
00215
00216
00217 #define Usb_sof_action() usb_sof_action()
00218 #define Usb_wake_up_action()
00219 #define Usb_resume_action()
00220 #define Usb_suspend_action()
00221 #define Usb_reset_action()
00222 #define Usb_vbus_on_action() ( v_supervisor_Host_Connects() )
00223 #define Usb_vbus_off_action() ( v_supervisor_Host_Disconnects() )
00224 #define Usb_set_configuration_action()
00226
00227 #define SBC_VENDOR_ID "ATMEL " // 8 bytes only
00228 #define SBC_PRODUCT_ID "UC3 CTRLPANEL " // 16 bytes only
00229 #define SBC_REVISION_ID "0.00" // 4 bytes only
00230
00234
00235
00236 #define Scsi_start_read_action()
00237 #define Scsi_stop_read_action()
00238 #define Scsi_start_write_action()
00239 #define Scsi_stop_write_action()
00241
00242 extern void usb_sof_action(void);
00243 extern void usb_suspend_action(void);
00244
00245 #endif // USB_DEVICE_FEATURE == ENABLED
00246
00248
00249
00251 #define USB_INT_LEVEL AVR32_INTC_INT0
00252
00254
00255 #define LOG_STR(str) NAKED_TRACE_COM2(str)
00256
00257
00259
00260
00261 #endif // _CONF_USB_H_