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, CDC_EXAMPLE_PID}
00098
00109 #define CLASS_SUBCLASS_PROTOCOL {CDC_COMM_CLASS, CDC_COMM_ABSTRACT_CM_SUBCLASS, CDC_COMM_V25ter_PROTOCOL, \
00110 CDC_DATA_CLASS, NO_SUBCLASS, NO_PROTOCOL}
00111
00113 #define SIZEOF_DATA_STAGE 250
00114
00116 #define DEVICE_ADDRESS 0x05
00117
00119 #define MAX_INTERFACE_SUPPORTED 0x03
00120
00122 #define MAX_EP_PER_INTERFACE 3
00123
00127 #define HOST_STRICT_VID_PID_TABLE DISABLE
00128
00130 #define HOST_AUTO_CFG_ENDPOINT ENABLE
00131
00133 #define HOST_CONTINUOUS_SOF_INTERRUPT ENABLE
00134
00136 #define HOST_ERROR_RESTART ENABLE
00137
00139 #define USB_HOST_PIPE_INTERRUPT_TRANSFER DISABLE
00140
00142 #define ID_PIN_CHANGE_GENERATE_RESET ENABLE
00143
00145 #define TIMEOUT_DELAY_ENABLE ENABLE
00146
00148 #define TIMEOUT_DELAY 10
00149
00151 #define NAK_TIMEOUT_ENABLE DISABLE
00152
00154 #define NAK_SEND_TIMEOUT 0x0FFF
00155
00157 #define NAK_RECEIVE_TIMEOUT 0x0FFF
00158
00159 #if HOST_AUTO_CFG_ENDPOINT == DISABLE
00161 #define User_configure_endpoint()
00162 #endif
00163
00167
00168
00169 #define Usb_id_transition_action()
00170 #define Host_device_disconnection_action() (cdc_new_device_connected = FALSE, cdc_connected = FALSE)
00171 #define Host_device_connection_action()
00172 #define Host_sof_action() host_sof_action()
00173 #define Host_suspend_action()
00174 #define Host_hwup_action()
00175 #define Host_device_supported_action()
00176 #define Host_device_not_supported_action()
00177 #define Host_new_device_connection_action() (cdc_new_device_connected = TRUE)
00178 #define Host_device_class_not_supported_action()
00179 #define Host_device_error_action()
00180
00185 #define Host_user_check_class_action(x)
00187
00188 extern volatile Bool cdc_new_device_connected;
00189 extern volatile Bool cdc_connected;
00190 extern void host_sof_action(void);
00191 extern void host_suspend_action(void);
00192
00193 #endif // USB_HOST_FEATURE == ENABLED
00194
00196
00197
00198
00199
00203
00204 #if USB_DEVICE_FEATURE == ENABLED
00205
00206 #define NB_ENDPOINTS 4 // Number of endpoints in the application including control endpoint
00207 #define TX_EP 0x01
00208 #define RX_EP 0x02
00209 #define INT_EP 0x03
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() Usb_enable_sof_interrupt()
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_