conf_usb.h

Go to the documentation of this file.
00001 /* This file has been prepared for Doxygen automatic documentation generation.*/
00002 /*! \file conf_usb.h **********************************************************
00003  *
00004  * \brief
00005  *      This file contains the possible external configuration of the USB.
00006  *
00007  * \addtogroup usbstick
00008  *
00009  * \author
00010  *      Atmel Corporation: http://www.atmel.com \n
00011  *      Support email: avr@atmel.com
00012  *
00013  ******************************************************************************/
00014 /* Copyright (c) 2008  ATMEL Corporation
00015    All rights reserved.
00016 
00017    Redistribution and use in source and binary forms, with or without
00018    modification, are permitted provided that the following conditions are met:
00019 
00020    * Redistributions of source code must retain the above copyright
00021      notice, this list of conditions and the following disclaimer.
00022    * Redistributions in binary form must reproduce the above copyright
00023      notice, this list of conditions and the following disclaimer in
00024      the documentation and/or other materials provided with the
00025      distribution.
00026    * Neither the name of the copyright holders nor the names of
00027      contributors may be used to endorse or promote products derived
00028      from this software without specific prior written permission.
00029 
00030   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00031   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00032   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00033   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
00034   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00035   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00036   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00037   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00038   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00039   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00040   POSSIBILITY OF SUCH DAMAGE.
00041 */
00042 
00043 #ifndef _CONF_USB_H_
00044 #define _CONF_USB_H_
00045 
00046 
00047 
00048 /**
00049    \ingroup usbstick
00050    \defgroup usbconf USB Configuration
00051    @{
00052 */
00053 
00054 
00055    // _________________ USB MODE CONFIGURATION ____________________________
00056    //! @ingroup usbconf
00057    //! @defgroup USB_op_mode USB operating modes configuration
00058    //! defines to enable device or host usb operating modes
00059    //! supported by the application
00060    //! @{
00061 
00062       //! @brief ENABLE to activate the host software library support
00063       //!
00064       //! Possible values ENABLE or DISABLE
00065       #define USB_HOST_FEATURE            DISABLED
00066 
00067       //! @brief ENABLE to activate the device software library support
00068       //!
00069       //! Possible values ENABLE or DISABLE
00070       #define USB_DEVICE_FEATURE          ENABLED
00071 
00072    //! @}
00073 
00074    // _________________ USB REGULATOR CONFIGURATION _______________________
00075    //! @ingroup usbconf
00076    //! @defgroup USB_reg_mode USB regulator configuration
00077    //! @{
00078 
00079    //! @brief Enable the internal regulator for USB pads
00080    //!
00081    //! When the application voltage is lower than 3.5V, to optimize power consumption
00082    //! the internal USB pads regulatr can be disabled.
00083 #ifndef USE_USB_PADS_REGULATOR
00084    #define USE_USB_PADS_REGULATOR   ENABLE      // Possible values ENABLE or DISABLE
00085 #endif
00086    //! @}
00087 
00088 // _________________ DEVICE MODE CONFIGURATION __________________________
00089 
00090    //! @ingroup usbconf
00091    //! @defgroup USB_device_mode_cfg USB device operating mode configuration
00092    //!
00093    //! @{
00094 
00095 /** USB RNDIS / Virtual com port setup **/
00096 
00097 #ifndef CDC_ECM_USES_INTERRUPT_ENDPOINT
00098 #define CDC_ECM_USES_INTERRUPT_ENDPOINT 0
00099 #endif
00100 
00101 #ifndef USB_ETH_EMULATE_WIFI
00102 #define USB_ETH_EMULATE_WIFI    0
00103 #endif
00104 
00105 #define NB_ENDPOINTS        7  //!  number of endpoints in the application including control endpoint
00106 #define VCP_RX_EP                       0x06
00107 #define VCP_TX_EP                       0x05
00108 #define VCP_INT_EP                      0x04
00109 #define TX_EP                           0x01
00110 #define RX_EP                           0x02
00111 #define INT_EP              0x03
00112 
00113 /** USB Mass Storage Setup **/
00114 
00115 #define NB_ENDPOINTS_MS     3 //!  number of endpoints in the application including control endpoint
00116 #define MS_IN_EP            0x01
00117 #define MS_OUT_EP           0x02
00118 
00119 #define USB_LOW_SPEED_DEVICE DISABLE
00120 
00121 
00122 #define Usb_unicode(a)                  ((U16)(a))
00123 
00124    //! @ingroup usbconf
00125    //! @defgroup device_cst_actions USB device custom actions
00126    //!
00127    //! @{
00128    // write here the action to associate to each USB event
00129    // be carefull not to waste time in order not disturbing the functions
00130 #define Usb_sof_action()         /* sof_action(); */
00131 #define Usb_wake_up_action()
00132 #define Usb_resume_action()
00133 #define Usb_suspend_action()     suspend_action();
00134 #define Usb_reset_action()
00135 #define Usb_vbus_on_action()
00136 #define Usb_vbus_off_action()
00137 #define Usb_set_configuration_action()
00138 
00139 
00140 // write here the action to associate to each SCSI event
00141 // be carefull not to waste time in order not disturbing the functions
00142 #define Scsi_start_read_action()    Led1_on()
00143 #define Scsi_stop_read_action()     Led1_off()
00144 #define Scsi_start_write_action()   Led2_on()
00145 #define Scsi_stop_write_action()    Led2_off()
00146 
00147    //! @}
00148 
00149 extern void sof_action(void);
00150 extern void suspend_action(void);
00151    //! @}
00152 
00153 
00154 /** @}  */
00155 
00156 #endif // _CONF_USB_H_

Generated on Mon Apr 11 14:23:36 2011 for Contiki 2.5 by  doxygen 1.6.1