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 /* 00036 * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> 00037 */ 00038 00039 #ifndef _CONF_USB_HOST_H_ 00040 #define _CONF_USB_HOST_H_ 00041 00042 #include "compiler.h" 00043 00044 /** 00045 * USB Host Configuration 00046 * @{ 00047 */ 00048 00049 //! Array of UHI APIs Define the list of UHI supported by USB host. 00050 #define USB_HOST_UHI UHI_MSC, UHI_HID_MOUSE 00051 00052 //! Maximum current allowed on Vbus (mA) 00053 #define USB_HOST_POWER_MAX 500 00054 00055 //! Authorize the USB HUB support 00056 // #define USB_HOST_HUB_SUPPORT 00057 00058 //! Authorize the USB host to run in High Speed 00059 00060 # define USB_HOST_HS_SUPPORT 00061 00062 /** 00063 * USB Host callbacks 00064 * @{ 00065 */ 00066 00067 //! To notify that the USB mode are switched automatically. 00068 //! This is possible only when ID pin is available. 00069 #define UHC_MODE_CHANGE(b_host_mode) ui_usb_mode_change(b_host_mode) 00070 00071 //! To notify that the Vbus level has changed 00072 //! Available only in USB hardware with Vbus monitoring. 00073 #define UHC_VBUS_CHANGE(b_present) ui_usb_vbus_change(b_present) 00074 00075 //! To notify that a Vbus error has occurred 00076 //! Available only in USB hardware with Vbus monitoring. 00077 #define UHC_VBUS_ERROR() ui_usb_vbus_error() 00078 00079 //! To notify that a device has been connected or disconnected. 00080 #define UHC_CONNECTION_EVENT(dev,b_present) main_usb_connection_event(dev,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() main_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 device 00091 //! 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 * USB Interface Configuration 00104 * @{ 00105 */ 00106 /** 00107 * Configuration of HID Mouse interface 00108 * @{ 00109 */ 00110 #define UHI_HID_MOUSE_CHANGE(dev,b_plug) 00111 #define UHI_HID_MOUSE_EVENT_BTN_LEFT(b_state) ui_uhi_hid_mouse_btn_left(b_state) 00112 #define UHI_HID_MOUSE_EVENT_BTN_RIGHT(b_state) ui_uhi_hid_mouse_btn_right(b_state) 00113 #define UHI_HID_MOUSE_EVENT_BTN_MIDDLE(b_state) ui_uhi_hid_mouse_btn_middle(b_state) 00114 #define UHI_HID_MOUSE_EVENT_MOUVE(x,y,scroll) ui_uhi_hid_mouse_move(x,y,scroll) 00115 //@} 00116 //@} 00117 00118 /** 00119 * USB Interface Configuration 00120 * @{ 00121 */ 00122 /** 00123 * Configuration of MSC interface 00124 * @{ 00125 */ 00126 #define UHI_MSC_CHANGE(dev,b_plug) 00127 //@} 00128 //@} 00129 00130 //@} 00131 00132 #include "uhi_msc.h" 00133 #include "uhi_hid_mouse.h" 00134 #include "uhi_msc_mem.h" 00135 #include "ui.h" 00136 #include "main.h" 00137 00138 #endif // _CONF_USB_HOST_H_