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
00057
00061
00062
00063
00068
00072 #define USB_HOST_FEATURE ENABLED
00073
00077 #define USB_DEVICE_FEATURE ENABLED
00078
00079 #if UC3A3
00080 # define USB_HIGH_SPEED_SUPPORT ENABLED
00081 #else
00082 # define USB_HIGH_SPEED_SUPPORT DISABLED
00083 #endif
00084
00086
00087
00088
00089
00093
00094 #if USB_HOST_FEATURE == ENABLED
00095
00104 #define VID_PID_TABLE {ATMEL_VID, 1, HID_EXAMPLE_PID}
00105
00116 #define CLASS_SUBCLASS_PROTOCOL {HID_CLASS, BOOT_SUBCLASS, KEYBOARD_PROTOCOL,\
00117 HID_CLASS, NO_SUBCLASS, KEYBOARD_PROTOCOL,\
00118 HID_CLASS, BOOT_SUBCLASS, MOUSE_PROTOCOL,\
00119 HID_CLASS, NO_SUBCLASS, MOUSE_PROTOCOL}
00120
00122 #define SIZEOF_DATA_STAGE 250
00123
00125 #define DEVICE_ADDRESS 0x05
00126
00128 #define MAX_INTERFACE_SUPPORTED 0x03
00129
00131 #define MAX_EP_PER_INTERFACE 3
00132
00136 #define HOST_STRICT_VID_PID_TABLE DISABLE
00137
00139 #define HOST_AUTO_CFG_ENDPOINT ENABLE
00140
00142 #define HOST_CONTINUOUS_SOF_INTERRUPT DISABLE
00143
00145 #define HOST_ERROR_RESTART ENABLE
00146
00148 #define USB_HOST_PIPE_INTERRUPT_TRANSFER DISABLE
00149
00151 #define ID_PIN_CHANGE_GENERATE_RESET ENABLE
00152
00154 #define TIMEOUT_DELAY_ENABLE ENABLE
00155
00157 #define TIMEOUT_DELAY 10
00158
00160 #define NAK_TIMEOUT_ENABLE DISABLE
00161
00163 #define NAK_SEND_TIMEOUT 0x0FFF
00164
00166 #define NAK_RECEIVE_TIMEOUT 0x0FFF
00167
00168 #if HOST_AUTO_CFG_ENDPOINT == DISABLE
00170 #define User_configure_endpoint()
00171 #endif
00172
00176
00177
00178 #define Usb_id_transition_action()
00179 #define Host_device_disconnection_action() (mouse_hid_new_device_connected = FALSE, mouse_hid_connected = FALSE)
00180 #define Host_device_connection_action()
00181 #define Host_sof_action() host_sof_action()
00182 #define Host_suspend_action()
00183 #define Host_hwup_action()
00184 #define Host_device_supported_action()
00185 #define Host_device_not_supported_action()
00186 #define Host_new_device_connection_action() (mouse_hid_new_device_connected = TRUE)
00187 #define Host_device_class_not_supported_action()
00188 #define Host_device_error_action()
00189
00194 #define Host_user_check_class_action(x)
00196
00197 extern Bool keyboard_hid_new_device_connected;
00198 extern Bool keyboard_hid_connected;
00199 extern volatile Bool mouse_hid_new_device_connected;
00200 extern volatile Bool mouse_hid_connected;
00201 extern void host_sof_action(void);
00202 extern void host_suspend_action(void);
00203
00204 #endif // USB_HOST_FEATURE == ENABLED
00205
00207
00208
00209
00210
00214
00215 #if USB_DEVICE_FEATURE == ENABLED
00216
00217 #define NB_ENDPOINTS 2 // Number of endpoints in the application including control endpoint
00218 #define EP_HID_MOUSE_IN 1
00219
00223
00224
00225 #define Usb_sof_action() usb_sof_action()
00226 #define Usb_wake_up_action()
00227 #define Usb_resume_action()
00228 #define Usb_suspend_action()
00229 #define Usb_reset_action()
00230 #define Usb_vbus_on_action()
00231 #define Usb_vbus_off_action()
00232 #define Usb_set_configuration_action()
00234
00235 extern void usb_sof_action(void);
00236 extern void usb_suspend_action(void);
00237
00238 #endif // USB_DEVICE_FEATURE == ENABLED
00239
00241
00242
00244 #define USB_INT_LEVEL AVR32_INTC_INT0
00245
00247 #define LOG_STR(str) //print_dbg(str)
00248
00249
00251
00252
00253 #endif // _CONF_USB_H_