conf_usb.h

Go to the documentation of this file.
00001 /*This file has been prepared for Doxygen automatic documentation generation.*/
00013 
00014 /* Copyright (c) 2007, Atmel Corporation All rights reserved.
00015  *
00016  * Redistribution and use in source and binary forms, with or without
00017  * modification, are permitted provided that the following conditions are met:
00018  *
00019  * 1. Redistributions of source code must retain the above copyright notice,
00020  * this list of conditions and the following disclaimer.
00021  *
00022  * 2. Redistributions in binary form must reproduce the above copyright notice,
00023  * this list of conditions and the following disclaimer in the documentation
00024  * and/or other materials provided with the distribution.
00025  *
00026  * 3. The name of ATMEL may not be used to endorse or promote products derived
00027  * from this software without specific prior written permission.
00028  *
00029  * THIS SOFTWARE IS PROVIDED BY ATMEL ``AS IS'' AND ANY EXPRESS OR IMPLIED
00030  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
00031  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND
00032  * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT,
00033  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00034  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00035  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00036  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00037  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
00038  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00039  */
00040 #ifndef _CONF_USB_H_
00041 #define _CONF_USB_H_
00042 
00043 
00044 #include "modules/usb/usb_commun.h"
00045 
00049 
00050 
00051    // _________________ USB MODE CONFIGURATION ____________________________
00052    //
00057 
00061       #define USB_HOST_FEATURE            ENABLED
00062 
00066       #define USB_DEVICE_FEATURE          DISABLED
00067 
00069 
00070    // _________________ USB REGULATOR CONFIGURATION _______________________
00071    //
00074 
00079 #ifndef USE_USB_PADS_REGULATOR
00080    #define USE_USB_PADS_REGULATOR   ENABLE      // Possible values ENABLE or DISABLE
00081 #endif
00083 
00084    // _________________ HOST MODE CONFIGURATION ____________________________
00085    //
00089 
00090   #define   AUDIO_AC_INTERFACE_CLASS          0x01  // Audio Control Interface
00091   #define   AUDIO_AC_INTERFACE_SUB_CLASS      0x01
00092   #define   AUDIO_NO_PROTOCOL                 0x00
00093   #define   AUDIO_AS_INTERFACE_CLASS          0x01  // Audio Stream Interface
00094   #define   AUDIO_AS_INTERFACE_SUB_CLASS      0x02
00095   #define   AUDIO_NO_PROTOCOL                 0x00
00096 
00097 
00098 #define PIPE_AUDIO_IN      pipe_audio_in
00099 extern  U8  pipe_audio_in;
00100 
00101 
00110    #define VID_PID_TABLE            {VID_ATMEL, 1, PID_MegaAUDIO_IN}
00111 
00122    #define CLASS_SUBCLASS_PROTOCOL     { AUDIO_AS_INTERFACE_CLASS, AUDIO_AS_INTERFACE_SUB_CLASS, AUDIO_NO_PROTOCOL, \
00123                                          AUDIO_AC_INTERFACE_CLASS, AUDIO_AC_INTERFACE_SUB_CLASS, AUDIO_NO_PROTOCOL }
00124 
00126    #define SIZEOF_DATA_STAGE        250
00127 
00129    #define DEVICE_BASE_ADDRESS      0x05
00130 
00132    #define MAX_EP_PER_INTERFACE     3
00133 
00135    #define MAX_INTERFACE_FOR_DEVICE 3
00136 
00138    #define MAX_DEVICE_IN_USB_TREE   1
00139 
00140 #define SAVE_INTERRUPT_PIPE_FOR_DMS_INTERFACE   ENABLE
00141 
00143 #if (MAX_DEVICE_IN_USB_TREE>1)
00144    #define USB_HUB_SUPPORT          ENABLE
00145    #define USB_MAX_HUB_NUMBER       4
00146    #define HUB_MAX_NB_PORT          4
00147 #else
00148    #define USB_HUB_SUPPORT          DISABLE
00149 #endif
00150 
00154    #define HOST_STRICT_VID_PID_TABLE      DISABLE
00155 
00157    #define HOST_AUTO_CFG_ENDPOINT         ENABLE
00158 
00160    #define HOST_CONTINUOUS_SOF_INTERRUPT  DISABLE
00161 
00163    #define HOST_ERROR_RESTART             ENABLE
00164 
00166    #define USB_HOST_PIPE_INTERRUPT_TRANSFER  ENABLE
00167 
00169    #define ID_PIN_CHANGE_GENERATE_RESET   ENABLE
00170 
00172    #define TIMEOUT_DELAY_ENABLE           ENABLE
00173 
00175    #define TIMEOUT_DELAY               10
00176 
00178    #define NAK_TIMEOUT_ENABLE          DISABLE
00179 
00181    #define NAK_SEND_TIMEOUT            0x0FFF
00182 
00184    #define NAK_RECEIVE_TIMEOUT         0x0FFF
00185 
00187    #define SOFTWARE_VBUS_CTRL          ENABLE
00188 
00189    #if (HOST_AUTO_CFG_ENDPOINT==FALSE)
00191       #define        User_configure_endpoint()
00192    #endif
00193 
00197    // write here the action to associate to each USB host event
00198    // be carefull not to waste time in order not disturbing the functions
00199    #define Usb_id_transition_action()
00200    #define Host_device_disconnection_action()
00201    #define Host_device_connection_action()
00202    #define Host_sof_action()                          sof_action()
00203    #define Host_suspend_action()
00204    #define Host_hwup_action()
00205    #define Host_device_not_supported_action()
00206    #define Host_device_class_not_supported_action()
00207    #define Host_device_supported_action()
00208    #define Host_device_error_action()
00209 
00210 extern void sof_action(void);
00212 
00214 
00215 
00216 // _________________ DEVICE MODE CONFIGURATION __________________________
00217 
00221 
00222 #define USB_DEVICE_SN_USE          DISABLE            // DISABLE
00223 #define USE_DEVICE_SN_UNIQUE       DISABLE            // ignore if USB_DEVICE_SN_USE = DISABLE
00224 
00225 #define NB_ENDPOINTS          0  // number of endpoints in the application
00226 
00227 
00228 #define Usb_unicode(a)         ((U16)(a))
00229 
00233    // write here the action to associate to each USB event
00234    // be carefull not to waste time in order not disturbing the functions
00235 #define Usb_sof_action()
00236 #define Usb_wake_up_action()
00237 #define Usb_resume_action()
00238 #define Usb_suspend_action()
00239 #define Usb_reset_action()
00240 #define Usb_vbus_on_action()
00241 #define Usb_vbus_off_action()
00242 #define Usb_set_configuration_action()
00244 
00246 
00247 
00249 
00250 #endif // _CONF_USB_H_

Generated on Fri Oct 31 15:19:18 2008 for ATMEL by  doxygen 1.5.3