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