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 (defined __GNUC__) && ((defined __AVR32_UC3A364__) || \
00062 (defined __AVR32_UC3A364S__) || \
00063 (defined __AVR32_UC3A3128__) || \
00064 (defined __AVR32_UC3A3128S__) || \
00065 (defined __AVR32_UC3A3256__) || \
00066 (defined __AVR32_UC3A3256S__))|| \
00067 (defined __ICCAVR32__) && ((defined __AT32UC3A364__) || \
00068 (defined __AT32UC3A364S__) || \
00069 (defined __AT32UC3A3128__) || \
00070 (defined __AT32UC3A3128S__) || \
00071 (defined __AT32UC3A3256__) || \
00072 (defined __AT32UC3A3256S__))
00073 #define ISP_PID ISP_UC3A3_PID
00074 #elif (defined __GNUC__) && ((defined __AVR32_UC3A0128__ )|| \
00075 (defined __AVR32_UC3A0256__) || \
00076 (defined __AVR32_UC3A0512__) || \
00077 (defined __AVR32_UC3A1128__) || \
00078 (defined __AVR32_UC3A1256__) || \
00079 (defined __AVR32_UC3A1512__))|| \
00080 (defined __ICCAVR32__) && ((defined __AT32UC3A0128__) || \
00081 (defined __AT32UC3A0256__) || \
00082 (defined __AT32UC3A0512__) || \
00083 (defined __AT32UC3A1128__) || \
00084 (defined __AT32UC3A1256__) || \
00085 (defined __AT32UC3A1512__))
00086 #define ISP_PID ISP_UC3A_PID
00087 #elif (defined __GNUC__) && ((defined __AVR32_UC3B064__ ) || \
00088 (defined __AVR32_UC3B0128__) || \
00089 (defined __AVR32_UC3B0256__) || \
00090 (defined __AVR32_UC3B164__ ) || \
00091 (defined __AVR32_UC3B1128__) || \
00092 (defined __AVR32_UC3B1256__))|| \
00093 (defined __ICCAVR32__) && ((defined __AT32UC3B064__ ) || \
00094 (defined __AT32UC3B0128__) || \
00095 (defined __AT32UC3B0256__) || \
00096 (defined __AT32UC3B164__ ) || \
00097 (defined __AT32UC3B1128__) || \
00098 (defined __AT32UC3B1256__))
00099 #define ISP_PID ISP_UC3B_PID
00100 #endif
00101
00102
00103
00108
00112 #define USB_HOST_FEATURE DISABLED
00113
00117 #define USB_DEVICE_FEATURE ENABLED
00118
00120
00121
00122
00123
00127
00128 #if USB_HOST_FEATURE == ENABLED
00129
00138 #define VID_PID_TABLE {ATMEL_VID, 1, ISP_PID}
00139
00150 #define CLASS_SUBCLASS_PROTOCOL {APPLICATION_CLASS, DFU_SUBCLASS, DFU_MODE_PROTOCOL}
00151
00153 #define SIZEOF_DATA_STAGE 250
00154
00156 #define DEVICE_ADDRESS 0x05
00157
00159 #define MAX_INTERFACE_SUPPORTED 0x03
00160
00162 #define MAX_EP_PER_INTERFACE 3
00163
00167 #define HOST_STRICT_VID_PID_TABLE DISABLE
00168
00170 #define HOST_AUTO_CFG_ENDPOINT ENABLE
00171
00173 #define HOST_CONTINUOUS_SOF_INTERRUPT DISABLE
00174
00176 #define HOST_ERROR_RESTART ENABLE
00177
00179 #define USB_HOST_PIPE_INTERRUPT_TRANSFER DISABLE
00180
00182 #define ID_PIN_CHANGE_GENERATE_RESET ENABLE
00183
00185 #define TIMEOUT_DELAY_ENABLE ENABLE
00186
00188 #define TIMEOUT_DELAY 10
00189
00191 #define NAK_TIMEOUT_ENABLE DISABLE
00192
00194 #define NAK_SEND_TIMEOUT 0x0FFF
00195
00197 #define NAK_RECEIVE_TIMEOUT 0x0FFF
00198
00199 #if HOST_AUTO_CFG_ENDPOINT == DISABLE
00201 #define User_configure_endpoint()
00202 #endif
00203
00207
00208
00209 #define Usb_id_transition_action()
00210 #define Host_device_disconnection_action()
00211 #define Host_device_connection_action()
00212 #define Host_sof_action()
00213 #define Host_suspend_action()
00214 #define Host_hwup_action()
00215 #define Host_device_supported_action()
00216 #define Host_device_not_supported_action()
00217 #define Host_new_device_connection_action()
00218 #define Host_device_class_not_supported_action()
00219 #define Host_device_error_action()
00220
00225 #define Host_user_check_class_action(x)
00227
00228 extern void host_sof_action(void);
00229 extern void host_suspend_action(void);
00230
00231 #endif // USB_HOST_FEATURE == ENABLED
00232
00234
00235
00236
00237
00241
00242 #if USB_DEVICE_FEATURE == ENABLED
00243
00244 #define NB_ENDPOINTS 1 // Number of endpoints in the application including control endpoint
00245
00249
00250
00251 #define Usb_sof_action()
00252 #define Usb_wake_up_action()
00253 #define Usb_resume_action()
00254 #define Usb_suspend_action()
00255 #define Usb_reset_action()
00256 #define Usb_vbus_on_action() sys_clk_gen_start()
00257 #define Usb_vbus_off_action()
00258 #define Usb_set_configuration_action()
00260
00261 extern void usb_sof_action(void);
00262 extern void usb_suspend_action(void);
00263
00264 #endif // USB_DEVICE_FEATURE == ENABLED
00265
00267
00268
00270 #define USB_INT_LEVEL AVR32_INTC_INT0
00271
00273 #define LOG_STR(str) ((void)(str))
00274
00275
00277
00278
00279 #endif // _CONF_USB_H_