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 ENABLED
00072
00076 #define USB_DEVICE_FEATURE ENABLED
00077
00079
00080
00081
00082
00086
00087 #if USB_HOST_FEATURE == ENABLED
00088
00097 #define VID_PID_TABLE {ATMEL_VID, 1, ENUM_EXAMPLE_PID}
00098
00109 #define CLASS_SUBCLASS_PROTOCOL {VENDOR_CLASS, NO_SUBCLASS, NO_PROTOCOL}
00110
00112 #define SIZEOF_DATA_STAGE 250
00113
00115 #define DEVICE_ADDRESS 0x05
00116
00118 #define MAX_INTERFACE_SUPPORTED 0x02
00119
00121 #define MAX_EP_PER_INTERFACE 3
00122
00126 #define HOST_STRICT_VID_PID_TABLE DISABLE
00127
00129 #define HOST_AUTO_CFG_ENDPOINT ENABLE
00130
00132 #define HOST_CONTINUOUS_SOF_INTERRUPT DISABLE
00133
00135 #define HOST_ERROR_RESTART ENABLE
00136
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 1
00151
00153 #define NAK_TIMEOUT_ENABLE ENABLE
00154
00156 #define NAK_SEND_TIMEOUT 0x0010
00157
00159 #define NAK_RECEIVE_TIMEOUT 0x0010
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() (tpl_new_device_connected = FALSE)
00173 #define Host_device_connection_action()
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() (tpl_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 tpl_new_device_connected;
00191 extern void host_sof_action(void);
00192 extern void host_suspend_action(void);
00193
00194 #endif // USB_HOST_FEATURE == ENABLED
00195
00197
00198
00199
00200
00204
00205 #if USB_DEVICE_FEATURE == ENABLED
00206
00207 #define NB_ENDPOINTS 3 // Number of endpoints in the application including control endpoint
00208 #define EP_TEMP_IN 1
00209 #define EP_TEMP_OUT 2
00210
00214
00215
00216 #define Usb_sof_action() usb_sof_action()
00217 #define Usb_wake_up_action()
00218 #define Usb_resume_action()
00219 #define Usb_suspend_action()
00220 #define Usb_reset_action()
00221 #define Usb_vbus_on_action()
00222 #define Usb_vbus_off_action()
00223 #define Usb_set_configuration_action()
00225
00226 extern void usb_sof_action(void);
00227 extern void usb_suspend_action(void);
00228
00229 #endif // USB_DEVICE_FEATURE == ENABLED
00230
00232
00233
00235 #define USB_INT_LEVEL AVR32_INTC_INT0
00236
00238 #define LOG_STR(str) print_dbg(str)
00239
00240
00242
00243
00244 #endif // _CONF_USB_H_