SAMV71 Xplained Ultra Software Package 1.4

conf_usb_host.h

Go to the documentation of this file.
00001 /**
00002  * \file
00003  *
00004  * \brief USB host configuration file
00005  *
00006  * Copyright (C) 2014-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 "compiler.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_MSC, UHI_HID_MOUSE
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) main_usb_connection_event(dev,b_present)
00089 
00090 //! Called when a USB device or the host have wake up the USB line.
00091 #define UHC_WAKEUP_EVENT()                  ui_usb_wakeup_event()
00092 
00093 //! Called for each received SOF each 1 ms
00094 //! Note: Available in High and Full speed mode
00095 #define UHC_SOF_EVENT()                     main_usb_sof_event()
00096 
00097 //! Called when a USB device configuration must be chosen.
00098 //! Thus, the application can choose either a configuration number for this device
00099 //! or a configuration number 0 to reject it.
00100 //! If callback not defined the configuration 1 is chosen.
00101 //#define UHC_DEVICE_CONF(dev)                uint8_t usb_device_conf(dev)
00102 
00103 //! Called when a USB device enumeration is completed.
00104 #define UHC_ENUM_EVENT(dev,b_status)        ui_usb_enum_event(dev,b_status)
00105 
00106 
00107 //@}
00108 
00109 
00110 /**
00111  * USB Interface Configuration
00112  * @{
00113  */
00114 /**
00115  * Configuration of HID Mouse interface
00116  * @{
00117  */
00118 #define UHI_HID_MOUSE_CHANGE(dev,b_plug)
00119 #define UHI_HID_MOUSE_EVENT_BTN_LEFT(b_state)    ui_uhi_hid_mouse_btn_left(b_state)
00120 #define UHI_HID_MOUSE_EVENT_BTN_RIGHT(b_state)   ui_uhi_hid_mouse_btn_right(b_state)
00121 #define UHI_HID_MOUSE_EVENT_BTN_MIDDLE(b_state)  ui_uhi_hid_mouse_btn_middle(b_state)
00122 #define UHI_HID_MOUSE_EVENT_MOUVE(x,y,scroll)    ui_uhi_hid_mouse_move(x,y,scroll)
00123 //@}
00124 //@}
00125 
00126 /**
00127  * USB Interface Configuration
00128  * @{
00129  */
00130 /**
00131  * Configuration of MSC interface
00132  * @{
00133  */
00134 #define UHI_MSC_CHANGE(dev,b_plug)
00135 //@}
00136 //@}
00137 
00138 //@}
00139 
00140 #include "uhi_msc.h"
00141 #include "uhi_hid_mouse.h"
00142 #include "uhi_msc_mem.h"
00143 #include "ui.h"
00144 #include "main.h"
00145 
00146 #endif // _CONF_USB_HOST_H_
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines