SAMV71 Xplained Ultra Software Package 1.5

conf_usb_host.h

Go to the documentation of this file.
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 "compiler.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_HID_MOUSE
00050 
00051 //! Maximum current allowed on Vbus (mA)
00052 #define USB_HOST_POWER_MAX  500
00053 
00054 
00055 
00056 /**
00057  * USB Host callbacks
00058  * @{
00059  */
00060 
00061 //! To notify that the USB mode are switched automatically.
00062 //! This is possible only when ID pin is available.
00063 #define UHC_MODE_CHANGE(b_host_mode)        ui_usb_mode_change(b_host_mode)
00064 
00065 //! To notify that the Vbus level has changed
00066 //! Available only in USB hardware with Vbus monitoring.
00067 #define UHC_VBUS_CHANGE(b_present)          ui_usb_vbus_change(b_present)
00068 
00069 //! To notify that a Vbus error has occurred
00070 //! Available only in USB hardware with Vbus monitoring.
00071 #define UHC_VBUS_ERROR()                    ui_usb_vbus_error()
00072 
00073 //! To notify that a device has been connected or disconnected.
00074 #define UHC_CONNECTION_EVENT(dev,b_present) ui_usb_connection_event(dev,b_present)
00075 
00076 //! Called when a USB device or the host have wake up the USB line.
00077 #define UHC_WAKEUP_EVENT()                  ui_usb_wakeup_event()
00078 
00079 //! Called for each received SOF each 1 ms
00080 //! Note: Available in High and Full speed mode
00081 #define UHC_SOF_EVENT()                     ui_usb_sof_event()
00082 
00083 //! Called when a USB device configuration must be chosen.
00084 //! Thus, the application can choose either a configuration number for this device
00085 //! or a configuration number 0 to reject it.
00086 //! If callback not defined the configuration 1 is chosen.
00087 //#define UHC_DEVICE_CONF(dev)                uint8_t usb_device_conf(dev)
00088 
00089 //! Called when a USB device enumeration is completed.
00090 #define UHC_ENUM_EVENT(dev,b_status)        ui_usb_enum_event(dev,b_status)
00091 
00092 
00093 //@}
00094 
00095 
00096 
00097 /**
00098  * USB Interface Configuration
00099  * @{
00100  */
00101 /**
00102  * Configuration of HID Mouse interface
00103  * @{
00104  */
00105 #define UHI_HID_MOUSE_CHANGE(dev,b_plug)
00106 #define UHI_HID_MOUSE_EVENT_BTN_LEFT(b_state)    ui_uhi_hid_mouse_btn_left(b_state)
00107 #define UHI_HID_MOUSE_EVENT_BTN_RIGHT(b_state)   ui_uhi_hid_mouse_btn_right(b_state)
00108 #define UHI_HID_MOUSE_EVENT_BTN_MIDDLE(b_state)  ui_uhi_hid_mouse_btn_middle(b_state)
00109 #define UHI_HID_MOUSE_EVENT_MOUVE(x,y,scroll)    ui_uhi_hid_mouse_move(x,y,scroll)
00110 //@}
00111 //@}
00112 
00113 //@}
00114 
00115 #include "uhi_hid_mouse.h"
00116 #include "ui.h"
00117 
00118 #endif // _CONF_USB_HOST_H_
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines