00001 /** 00002 * \file 00003 * 00004 * \brief Common User Interface for USB host MSC application 00005 * 00006 * Copyright (C) 2012-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 _UI_H_ 00048 #define _UI_H_ 00049 00050 #include "USBH.h" 00051 00052 //! \brief Initializes the user interface 00053 void ui_init(void); 00054 00055 /*! \brief Notify that the USB mode are switched automatically. 00056 * This is possible only when ID pin is available. 00057 * 00058 * \param b_host_mode true, if the host mode has been selected 00059 */ 00060 void ui_usb_mode_change(bool b_host_mode); 00061 00062 /*! \brief Notify that a Vbus are changed 00063 * Available only in USB hardware with Vbus monitoring. 00064 * 00065 * \param b_vbus_present true, if Vbus is high. 00066 */ 00067 void ui_usb_vbus_change(bool b_vbus_present); 00068 00069 /*! \brief Notify that a Vbus error has occurred 00070 * Available only in USB hardware with Vbus monitoring. 00071 */ 00072 void ui_usb_vbus_error(void); 00073 00074 /*! \brief Notify that a USB device has been connected or disconnected. 00075 * 00076 * \param dev Pointer on USB device information 00077 * \param b_present true, if the device has been connected 00078 */ 00079 void ui_usb_connection_event(USBH_device_t *dev, bool b_present); 00080 00081 //! \brief Notify that a USB device or the host has wake up the USB line. 00082 void ui_usb_wakeup_event(void); 00083 00084 //! \brief Notify that a SOF has been sent (each 1 ms) 00085 void ui_usb_sof_event(void); 00086 00087 //! \brief Resets the status flag of the test 00088 void ui_test_flag_reset(void); 00089 00090 /*! \brief Displays the result of the test 00091 * 00092 * \param b_success true, if the test is successfull 00093 */ 00094 void ui_test_finish(bool b_success); 00095 00096 /*! \brief Notify the end of a USB device enumeration 00097 * 00098 * \param dev Pointer on USB device information 00099 * \param status Status of the USB enumeration 00100 */ 00101 void ui_usb_enum_event(USBH_device_t *dev, USBH_enum_status_t status); 00102 00103 //! \name Callback to show the MSC read and write accesses 00104 //! Functions are already declared in conf_access.h. 00105 //! @{ 00106 //! @} 00107 00108 #endif // _UI_H_