SAMV71 Xplained Ultra Software Package 1.3

uhi.h

Go to the documentation of this file.
00001 /**
00002  * \file
00003  *
00004  * \brief Common API for USB Host Interface
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 _UHI_H_
00048 #define _UHI_H_
00049 
00050 #include "USBH.h"
00051 
00052 #ifdef __cplusplus
00053 extern "C" {
00054 #endif
00055 
00056 /**
00057  * \ingroup usb_host_group
00058  * \defgroup uhi_group USB Host Interface (UHI)
00059  * The UHI provides a common API for all classes,
00060  * and this is used by UHC for the main control of USB host interface.
00061  * @{
00062  */
00063 
00064 /**
00065  * \brief UHI API.
00066  *
00067  * The callbacks within this structure are called only by
00068  * USB Host Controller (UHC)
00069  */
00070 typedef struct {
00071     /**
00072      * \brief Install interface
00073      * Allocate interface endpoints if supported.
00074      *
00075      * \param USBH_device_t    Device to request
00076      *
00077      * \return status of the install
00078      */
00079     USBH_enum_status_t (*install)(USBH_device_t*);
00080 
00081     /**
00082      * \brief Enable the interface.
00083      *
00084      * Enable a USB interface corresponding to UHI.
00085      *
00086      * \param USBH_device_t    Device to request
00087      */
00088     void (*enable)(USBH_device_t*);
00089 
00090     /**
00091      * \brief Uninstall the interface (if installed)
00092      *
00093      * \param USBH_device_t    Device to request
00094      */
00095     void (*uninstall)(USBH_device_t*);
00096 
00097     /**
00098      * \brief Signal that a SOF has occurred
00099      */
00100     void (*sof_notify)(bool b_micro);
00101 } uhi_api_t;
00102 
00103 //@}
00104 
00105 #ifdef __cplusplus
00106 }
00107 #endif
00108 #endif // _UHI_H_
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines