conf_usb.h

Go to the documentation of this file.
00001 /*This file is prepared for Doxygen automatic documentation generation.*/
00013 
00014 /* Copyright (c) 2009 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  * 4. This software may only be redistributed and used in connection with an Atmel
00030  * AVR product.
00031  *
00032  * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
00033  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
00034  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE EXPRESSLY AND
00035  * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT,
00036  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00037  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00038  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00039  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00040  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
00041  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00042  */
00043 #ifndef _CONF_USB_H_
00044 #define _CONF_USB_H_
00045 
00046 
00047 #include "modules/usb/usb_commun.h"
00048 #include "modules/usb/usb_commun_cdc.h"
00049 
00053 
00054 
00055    // _________________ USB MODE CONFIGURATION ____________________________
00056    //
00061 
00065       #define USB_HOST_FEATURE            ENABLED
00066 
00070       #define USB_DEVICE_FEATURE          DISABLED
00071 
00073 
00074    // _________________ USB REGULATOR CONFIGURATION _______________________
00075    //
00078 
00083 #ifndef USE_USB_PADS_REGULATOR
00084    #define USE_USB_PADS_REGULATOR   ENABLE      // Possible values ENABLE or DISABLE
00085 #endif
00087 
00088    // _________________ HOST MODE CONFIGURATION ____________________________
00089    //
00093 
00094    #define CDC_GLOB_CLASS     0x02
00095    #define CDC_COMM_CLASS     0x02
00096    #define CDC_DATA_CLASS     0x0A
00097    #define CDC_GLOB_SUBCLASS  0x00
00098    #define CDC_COMM_SUBCLASS  0x02
00099    #define CDC_DATA_SUBCLASS  0x00
00100    #define CDC_GLOB_PROTOCOL  0x00
00101    #define CDC_COMM_PROTOCOL  0x01
00102    #define CDC_DATA_PROTOCOL  0x00
00103 
00104 
00105 #define PIPE_CDC_COMM      pipe_cdc_comm_int
00106 #define PIPE_CDC_DATA_IN   pipe_cdc_data_bulkin
00107 #define PIPE_CDC_DATA_OUT  pipe_cdc_data_bulkout
00108 
00109 extern U8  pipe_cdc_comm_int;
00110 extern U8  pipe_cdc_data_bulkin;
00111 extern U8  pipe_cdc_data_bulkout;
00112 
00113 
00114 
00123    #define VID_PID_TABLE            {VID_ATMEL, 1, PID_MegaCDC}
00124 
00135 #ifdef   CDC_USE_MANAGEMENT_INTERFACE
00136 # ifdef CDC_USE_SPECIFIC_VENDOR_INTERFACE         // Force specific vendor interface like CDC Device
00137 #  define CLASS_SUBCLASS_PROTOCOL     {\
00138                                        0xEF, 0x01, 0x01, \
00139                                        CDC_COMM_CLASS, CDC_COMM_SUBCLASS, CDC_COMM_PROTOCOL, \
00140                                        CDC_DATA_CLASS, CDC_DATA_SUBCLASS, CDC_DATA_PROTOCOL, \
00141                                        0xFF, 0x00, 0x00 \
00142                                        }
00143 # else
00144 #  define CLASS_SUBCLASS_PROTOCOL     {\
00145                                        0xEF, 0x01, 0x01, \
00146                                        CDC_COMM_CLASS, CDC_COMM_SUBCLASS, CDC_COMM_PROTOCOL, \
00147                                        CDC_DATA_CLASS, CDC_DATA_SUBCLASS, CDC_DATA_PROTOCOL \
00148                                        }
00149 # endif
00150 #else
00151 # ifdef CDC_USE_SPECIFIC_VENDOR_INTERFACE         // Force specific vendor interface like CDC Device
00152 #  define CLASS_SUBCLASS_PROTOCOL     {\
00153                                        CDC_COMM_CLASS, CDC_COMM_SUBCLASS, CDC_COMM_PROTOCOL, \
00154                                        CDC_DATA_CLASS, CDC_DATA_SUBCLASS, CDC_DATA_PROTOCOL, \
00155                                        0xFF, 0x00, 0x00 \
00156                                        }
00157 # else
00158 #  define CLASS_SUBCLASS_PROTOCOL     {\
00159                                        CDC_COMM_CLASS, CDC_COMM_SUBCLASS, CDC_COMM_PROTOCOL, \
00160                                        CDC_DATA_CLASS, CDC_DATA_SUBCLASS, CDC_DATA_PROTOCOL \
00161                                        }
00162 # endif
00163 #endif
00164 
00166    #define SIZEOF_DATA_STAGE        250
00167 
00169    #define DEVICE_BASE_ADDRESS      0x05
00170 
00172    #define MAX_EP_PER_INTERFACE     3
00173 
00175    #define MAX_INTERFACE_FOR_DEVICE 3
00176 
00178    #define MAX_DEVICE_IN_USB_TREE   1
00179 
00180 #define SAVE_INTERRUPT_PIPE_FOR_DMS_INTERFACE   ENABLE
00181 
00183 #if (MAX_DEVICE_IN_USB_TREE>1)
00184    #define USB_HUB_SUPPORT          ENABLE
00185    #define USB_MAX_HUB_NUMBER       4
00186    #define HUB_MAX_NB_PORT          4
00187 #else
00188    #define USB_HUB_SUPPORT          DISABLE
00189 #endif
00190 
00194    #define HOST_STRICT_VID_PID_TABLE      DISABLE
00195 
00197    #define HOST_AUTO_CFG_ENDPOINT         ENABLE
00198 
00200    #define HOST_CONTINUOUS_SOF_INTERRUPT  DISABLE
00201 
00203    #define HOST_ERROR_RESTART             ENABLE
00204 
00206    #define USB_HOST_PIPE_INTERRUPT_TRANSFER  ENABLE
00207 
00209    #define ID_PIN_CHANGE_GENERATE_RESET   ENABLE
00210 
00212    #define TIMEOUT_DELAY_ENABLE           ENABLE
00213 
00215    #define TIMEOUT_DELAY               10
00216 
00218    #define NAK_TIMEOUT_ENABLE          DISABLE
00219 
00221    #define NAK_SEND_TIMEOUT            0x0FFF
00222 
00224    #define NAK_RECEIVE_TIMEOUT         0x0FFF
00225 
00227    #define SOFTWARE_VBUS_CTRL          ENABLE
00228 
00229    #if (HOST_AUTO_CFG_ENDPOINT==FALSE)
00231       #define        User_configure_endpoint()
00232    #endif
00233 
00237    // write here the action to associate to each USB host event
00238    // be carefull not to waste time in order not disturbing the functions
00239    #define Usb_id_transition_action()
00240    #define Host_device_disconnection_action()
00241    #define Host_device_connection_action()
00242    #define Host_sof_action()                          sof_action()
00243    #define Host_suspend_action()
00244    #define Host_hwup_action()
00245    #define Host_device_not_supported_action()
00246    #define Host_device_class_not_supported_action()
00247    #define Host_device_supported_action()
00248    #define Host_device_error_action()
00249 
00250 extern void sof_action(void);
00252 
00254 
00255 
00256 // _________________ DEVICE MODE CONFIGURATION __________________________
00257 
00261 
00262 #define USB_DEVICE_SN_USE          DISABLE            // DISABLE
00263 #define USE_DEVICE_SN_UNIQUE       DISABLE            // ignore if USB_DEVICE_SN_USE = DISABLE
00264 
00265 
00266 #define Usb_unicode(a)         ((U16)(a))
00267 
00271    // write here the action to associate to each USB event
00272    // be carefull not to waste time in order not disturbing the functions
00273 #define Usb_sof_action()
00274 #define Usb_wake_up_action()
00275 #define Usb_resume_action()
00276 #define Usb_suspend_action()
00277 #define Usb_reset_action()
00278 #define Usb_vbus_on_action()
00279 #define Usb_vbus_off_action()
00280 #define Usb_set_configuration_action()
00282 
00284 
00285 
00287 
00288 #endif // _CONF_USB_H_

Generated on Wed Sep 23 09:41:07 2009 for ATMEL by  doxygen 1.5.3