00001 /** 00002 * \file 00003 * 00004 * \brief USB host configuration file 00005 * 00006 * Copyright (C) 2011-2015 Atmel Corporation. All rights reserved. 00007 * 00008 * \asf_license_start 00009 * 00010 * \page License 00011 * 00012 * Redistribution and use in source and binary forms, with or without 00013 * modification, are permitted provided that the following conditions are met: 00014 * 00015 * 1. Redistributions of source code must retain the above copyright notice, 00016 * this list of conditions and the following disclaimer. 00017 * 00018 * 2. Redistributions in binary form must reproduce the above copyright notice, 00019 * this list of conditions and the following disclaimer in the documentation 00020 * and/or other materials provided with the distribution. 00021 * 00022 * 3. The name of Atmel may not be used to endorse or promote products derived 00023 * from this software without specific prior written permission. 00024 * 00025 * 4. This software may only be redistributed and used in connection with an 00026 * Atmel microcontroller product. 00027 * 00028 * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 00029 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 00030 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 00031 * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 00032 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00033 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 00034 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00035 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 00036 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 00037 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00038 * POSSIBILITY OF SUCH DAMAGE. 00039 * 00040 * \asf_license_stop 00041 * 00042 */ 00043 /* 00044 * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> 00045 */ 00046 00047 #ifndef _CONF_USB_HOST_H_ 00048 #define _CONF_USB_HOST_H_ 00049 00050 #include "board.h" 00051 00052 /** 00053 * USB Host Configuration 00054 * @{ 00055 */ 00056 00057 /*! Array of UHI APIs Define the list of UHI supported by USB host. */ 00058 #define USB_HOST_UHI UHI_CDC 00059 00060 /*! Maximum current allowed on Vbus (mA) */ 00061 #define USB_HOST_POWER_MAX 500 00062 00063 /*! Authorize the USB HUB support */ 00064 //#define USB_HOST_HUB_SUPPORT 00065 00066 /*! Authorize the USB host to run in High Speed */ 00067 00068 # define USB_HOST_HS_SUPPORT 00069 00070 /** 00071 * USB Host callbacks 00072 * @{ 00073 */ 00074 00075 /*! To notify that the USB mode are switched automatically. 00076 This is possible only when ID pin is available. */ 00077 #define UHC_MODE_CHANGE(b_host_mode) ui_usb_mode_change(b_host_mode) 00078 00079 /*! To notify that the Vbus level has changed. 00080 Available only in USB hardware with Vbus monitoring. */ 00081 #define UHC_VBUS_CHANGE(b_present) ui_usb_vbus_change(b_present) 00082 00083 /*! To notify that a Vbus error has occurred. 00084 Available only in USB hardware with Vbus monitoring. */ 00085 #define UHC_VBUS_ERROR() ui_usb_vbus_error() 00086 00087 /*! To notify that a device has been connected or disconnected. */ 00088 #define UHC_CONNECTION_EVENT(dev, b_present) ui_usb_connection_event(dev, \ 00089 b_present) 00090 00091 /*! Called when a USB device or the host have wake up the USB line. */ 00092 #define UHC_WAKEUP_EVENT() ui_usb_wakeup_event() 00093 00094 /*! Called for each received SOF each 1 ms. 00095 Note: Available in High and Full speed mode */ 00096 #define UHC_SOF_EVENT() ui_usb_sof_event() 00097 00098 /*! Called when a USB device configuration must be chosen. 00099 Thus, the application can choose either a configuration number for this 00100 device or a configuration number 0 to reject it. 00101 If callback not defined the configuration 1 is chosen. */ 00102 //#define UHC_DEVICE_CONF(dev) uint8_t usb_device_conf(dev) 00103 00104 /*! Called when a USB device enumeration is completed. */ 00105 #define UHC_ENUM_EVENT(dev,b_status) ui_usb_enum_event(dev,b_status) 00106 00107 00108 /*@} */ 00109 00110 00111 00112 /** 00113 * USB Interface Configuration 00114 * @{ 00115 */ 00116 00117 /** 00118 * Configuration of CDC interface 00119 * @{ 00120 */ 00121 #define UHI_CDC_CHANGE(dev, b_plug) 00122 #define UHI_CDC_RX_NOTIFY() uart_rx_notify() 00123 //@} 00124 //@} 00125 00126 //@} 00127 #define PINS_USART PIN_USART2_TXD, PIN_USART2_RXD 00128 #define USART_ENABLE() 00129 #define USART_DISABLE() 00130 #define USART_BASE USART2 00131 #define USART_ID ID_USART2 00132 #define USART_HANDLER USART2_Handler 00133 #define USART_INT_IRQn USART2_IRQn 00134 #define USART_INT_LEVEL 3 00135 00136 #include "uhi_cdc.h" 00137 #include "usart_cdc.h" 00138 #include "ui.h" 00139 00140 #endif // _CONF_USB_HOST_H_