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