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
00059
00060
00061
00066
00070 #if BOARD == EVK1100
00071
00072
00073
00074 # define USB_HOST_FEATURE ENABLED
00075 #else
00076 # define USB_HOST_FEATURE DISABLED
00077 #endif
00078
00082 #define USB_DEVICE_FEATURE ENABLED
00083
00085
00086
00087
00091
00092 #if USB_HOST_FEATURE == ENABLED
00093
00094 #define PIPE_AUDIO_IN pipe_audio_in
00095 extern U8 pipe_audio_in;
00096
00105 #define VID_PID_TABLE {ATMEL_VID, 1, AUDIO_MIC_EXAMPLE_PID}
00106
00117 #define CLASS_SUBCLASS_PROTOCOL { AUDIO_CLASS, AUDIOCONTROL_SUBCLASS, NO_PROTOCOL, \
00118 AUDIO_CLASS, AUDIOSTREAMING_SUBCLASS, NO_PROTOCOL }
00119
00121 #define SIZEOF_DATA_STAGE 1024
00122
00124 #define DEVICE_ADDRESS 0x05
00125
00127 #define MAX_INTERFACE_SUPPORTED 0x08
00128
00130 #define MAX_EP_PER_INTERFACE 2
00131
00135 #define HOST_STRICT_VID_PID_TABLE DISABLE
00136
00138 #define HOST_AUTO_CFG_ENDPOINT ENABLE
00139
00141 #define HOST_CONTINUOUS_SOF_INTERRUPT DISABLE
00142
00144 #define HOST_ERROR_RESTART ENABLE
00145
00147 #define USB_HOST_PIPE_INTERRUPT_TRANSFER DISABLE
00148
00150 #define ID_PIN_CHANGE_GENERATE_RESET ENABLE
00151
00153 #define TIMEOUT_DELAY_ENABLE ENABLE
00154
00156 #define TIMEOUT_DELAY 10
00157
00159 #define NAK_TIMEOUT_ENABLE DISABLE
00160
00162 #define NAK_SEND_TIMEOUT 0x0FFF
00163
00165 #define NAK_RECEIVE_TIMEOUT 0x0FFF
00166
00167 #if HOST_AUTO_CFG_ENDPOINT == DISABLE
00169 #define User_configure_endpoint()
00170 #endif
00171
00175
00176
00177 #define Usb_id_transition_action()
00178 #define Host_device_disconnection_action() (audio_new_device_connected = FALSE, audio_connected = FALSE, host_user_check_class_init() )
00179 #define Host_device_connection_action()
00180 #define Host_sof_action() host_sof_action()
00181 #define Host_suspend_action()
00182 #define Host_hwup_action()
00183 #define Host_device_supported_action()
00184 #define Host_device_not_supported_action()
00185 #define Host_new_device_connection_action() (audio_new_device_connected = TRUE)
00186 #define Host_device_class_not_supported_action()
00187 #define Host_device_error_action()
00188
00193 #define Host_user_check_class_action(x) (host_user_check_class(x))
00195
00196 extern volatile Bool audio_new_device_connected;
00197 extern volatile Bool audio_connected;
00198 extern void host_sof_action(void);
00199 extern void host_suspend_action(void);
00200 extern void host_user_check_class_init(void);
00201 extern Bool host_user_check_class(const U8 *descriptor);
00203
00204 #endif // USB_HOST_FEATURE == ENABLED
00205
00206
00207
00210
00215 #ifndef USE_USB_PADS_REGULATOR
00216 #define USE_USB_PADS_REGULATOR DISABLE // Possible values ENABLE or DISABLE
00217 #endif
00219
00220
00221
00222
00226
00227 #if USB_DEVICE_FEATURE == ENABLED
00228
00229 #define NB_ENDPOINTS 4 // Number of endpoints in the application including control endpoint
00230 #define EP_AUDIO_OUT 5
00231 #define EP_AUDIO_IN 6
00232 #define EP_KBD_IN 1
00233
00237
00238
00239 #define Usb_sof_action() usb_sof_action()
00240 #define Usb_wake_up_action()
00241 #define Usb_resume_action()
00242 #define Usb_suspend_action()
00243 #define Usb_reset_action()
00244 #define Usb_vbus_on_action()
00245 #define Usb_vbus_off_action()
00246 #define Usb_set_configuration_action() Usb_enable_sof_interrupt()
00248
00249 extern void usb_sof_action(void);
00250 extern void usb_suspend_action(void);
00251
00252 #endif // USB_DEVICE_FEATURE == ENABLED
00253
00255
00256
00258 #define USB_INT_LEVEL AVR32_INTC_INT0
00259
00261 #define LOG_STR(str) //print_dbg(str)
00262
00268
00271 #define USB_STREAM_BUFFER_SIZE 256 // Size in bytes.
00272
00274 #define USB_STREAM_BUFFER_NUMBER 16 // Unit is in number of buffers. Must be a 2-power number.
00275
00277 #define USB_STREAM_RESYNC_PPM_STEPS 10 // Unit is in PPM.
00278
00280 #define TIMER_USB_STREAM_MONITOR 700 // Unit is in ms.
00281
00285 #define USB_RESYNC_AUDIO_STREAM ENABLED
00286
00288
00290
00291 #endif // _CONF_USB_H_