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 DISABLED
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, HID_EXAMPLE_PID}
00098
00109 #define CLASS_SUBCLASS_PROTOCOL {HID_CLASS, BOOT_SUBCLASS, KEYBOARD_PROTOCOL,\
00110 HID_CLASS, NO_SUBCLASS, KEYBOARD_PROTOCOL,\
00111 HID_CLASS, BOOT_SUBCLASS, MOUSE_PROTOCOL,\
00112 HID_CLASS, NO_SUBCLASS, MOUSE_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() (keyboard_hid_new_device_connected = FALSE, keyboard_hid_connected = FALSE,\
00173 mouse_hid_new_device_connected = FALSE, mouse_hid_connected = FALSE)
00174 #define Host_device_connection_action()
00175 #define Host_sof_action() host_sof_action()
00176 #define Host_suspend_action()
00177 #define Host_hwup_action()
00178 #define Host_device_supported_action()
00179 #define Host_device_not_supported_action()
00180 #define Host_new_device_connection_action() (keyboard_hid_new_device_connected = TRUE,\
00181 mouse_hid_new_device_connected = TRUE)
00182 #define Host_device_class_not_supported_action()
00183 #define Host_device_error_action()
00184
00189 #define Host_user_check_class_action(x)
00191
00192 extern Bool keyboard_hid_new_device_connected;
00193 extern Bool keyboard_hid_connected;
00194 extern Bool mouse_hid_new_device_connected;
00195 extern Bool mouse_hid_connected;
00196 extern void host_sof_action(void);
00197 extern void host_suspend_action(void);
00198
00199 #endif // USB_HOST_FEATURE == ENABLED
00200
00202
00203
00204
00205
00209
00210 #if USB_DEVICE_FEATURE == ENABLED
00211
00212 #define NB_ENDPOINTS 5 // Number of endpoints in the application including control endpoint
00213 #define EP_FC_IN 1
00214 #define EP_FC_OUT 2
00215 #define EP_MS_IN 3
00216 #define EP_MS_OUT 4
00217
00221
00222
00223 #define Usb_sof_action() usb_sof_action()
00224 #define Usb_wake_up_action()
00225 #define Usb_resume_action()
00226 #define Usb_suspend_action()
00227 #define Usb_reset_action()
00228 #define Usb_vbus_on_action()
00229 #define Usb_vbus_off_action()
00230 #define Usb_set_configuration_action()
00232
00233 #define SBC_VENDOR_ID "ATMEL " // 8 bytes only
00234 #define SBC_PRODUCT_ID "UC3 MASS STORAGE" // 16 bytes only
00235 #define SBC_REVISION_ID "0.00" // 4 bytes only
00236
00240
00241
00242 #define Scsi_start_read_action()
00243 #define Scsi_stop_read_action()
00244 #define Scsi_start_write_action()
00245 #define Scsi_stop_write_action()
00247
00248 extern void usb_sof_action(void);
00249 extern void usb_suspend_action(void);
00250
00251 #endif // USB_DEVICE_FEATURE == ENABLED
00252
00254
00255
00257 #define USB_INT_LEVEL AVR32_INTC_INT0
00258
00260 #define LOG_STR(str) print_dbg(str)
00261
00262
00264
00265
00266 #endif // _CONF_USB_H_