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 "isp.h"
00054 #include "usb_ids.h"
00055
00056
00060
00061 #if UC3A3
00062 #define ISP_PID ISP_UC3A3_PID
00063 #elif (UC3A0 || UC3A1 )
00064 #define ISP_PID ISP_UC3A_PID
00065 #elif UC3B
00066 #define ISP_PID ISP_UC3B_PID
00067 #endif
00068
00069
00070
00075
00079 #define USB_HOST_FEATURE DISABLED
00080
00084 #define USB_DEVICE_FEATURE ENABLED
00085
00087
00088
00089
00090
00094
00095 #if USB_HOST_FEATURE == ENABLED
00096
00105 #define VID_PID_TABLE {ATMEL_VID, 1, ISP_PID}
00106
00117 #define CLASS_SUBCLASS_PROTOCOL {APPLICATION_CLASS, DFU_SUBCLASS, DFU_MODE_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()
00178 #define Host_device_connection_action()
00179 #define 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()
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 void host_sof_action(void);
00196 extern void host_suspend_action(void);
00197
00198 #endif // USB_HOST_FEATURE == ENABLED
00199
00201
00202
00203
00204
00208
00209 #if USB_DEVICE_FEATURE == ENABLED
00210
00211 #define NB_ENDPOINTS 1 // Number of endpoints in the application including control endpoint
00212
00216
00217
00218 #define Usb_sof_action()
00219 #define Usb_wake_up_action()
00220 #define Usb_resume_action()
00221 #define Usb_suspend_action()
00222 #define Usb_reset_action()
00223 #define Usb_vbus_on_action() sys_clk_gen_start()
00224 #define Usb_vbus_off_action()
00225 #define Usb_set_configuration_action()
00227
00228 extern void usb_sof_action(void);
00229 extern void usb_suspend_action(void);
00230
00231 #endif // USB_DEVICE_FEATURE == ENABLED
00232
00234
00235
00237 #define USB_INT_LEVEL AVR32_INTC_INT0
00238
00240 #define LOG_STR(str) ((void)(str))
00241
00242
00244
00245
00246 #endif // _CONF_USB_H_