/** * @file usb_reset_seq.h * @brief Reset Sequence for USB Reset. * @note * * ------------------------------------------------------------------ Copyright (c) 2023 by Lattice Semiconductor Corporation ALL RIGHTS RESERVED ------------------------------------------------------------------ DISCLAIMER: LATTICE MAKES NO WARRANTIES ON THIS FILE OR ITS CONTENTS, WHETHER EXPRESSED, IMPLIED, STATUTORY, OR IN ANY PROVISION OF THE LATTICE PROPEL LICENSE AGREEMENT OR COMMUNICATION WITH LICENSEE, AND LATTICE SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. LATTICE DOES NOT WARRANT THAT THE FUNCTIONS CONTAINED HEREIN WILL MEET LICENSEE 'S REQUIREMENTS, OR THAT LICENSEE' S OPERATION OF ANY DEVICE, SOFTWARE OR SYSTEM USING THIS FILE OR ITS CONTENTS WILL BE UNINTERRUPTED OR ERROR FREE, OR THAT DEFECTS HEREIN WILL BE CORRECTED. LICENSEE ASSUMES RESPONSIBILITY FOR SELECTION OF MATERIALS TO ACHIEVE ITS INTENDED RESULTS, AND FOR THE PROPER INSTALLATION, USE, AND RESULTS OBTAINED THEREFROM. LICENSEE ASSUMES THE ENTIRE RISK OF THE FILE AND ITS CONTENTS PROVING DEFECTIVE OR FAILING TO PERFORM PROPERLY AND IN SUCH EVENT, LICENSEE SHALL ASSUME THE ENTIRE COST AND RISK OF ANY REPAIR, SERVICE, CORRECTION, OR ANY OTHER LIABILITIES OR DAMAGES CAUSED BY OR ASSOCIATED WITH THE SOFTWARE. IN NO EVENT SHALL LATTICE BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS FILE OR ITS CONTENTS, EVEN IF LATTICE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. LATTICE 'S SOLE LIABILITY, AND LICENSEE' S SOLE REMEDY, IS SET FORTH ABOVE. LATTICE DOES NOT WARRANT OR REPRESENT THAT THIS FILE, ITS CONTENTS OR USE THEREOF DOES NOT INFRINGE ON THIRD PARTIES' INTELLECTUAL PROPERTY RIGHTS, INCLUDING ANY PATENT. IT IS THE USER' S RESPONSIBILITY TO VERIFY THE USER SOFTWARE DESIGN FOR CONSISTENCY AND FUNCTIONALITY THROUGH THE USE OF FORMAL SOFTWARE VALIDATION METHODS. ------------------------------------------------------------------ */ #ifndef SRC_USB_RESET_SEQ_H_ #define SRC_USB_RESET_SEQ_H_ #include "ltcusb.h" #include "GenMac.h" #include "rv_delay.h" #include /** * @brief Reset the USB * @return 0 when success, a negative value when failed. * @retval -1 GUSB2PHYCFG0 register write failed. * @retval -2 GUSB3PIPECTL0 register write failed. * @retval -3 u2phy_misc_ctrl2_reset_status write failed. * @retval -4 u2phy_misc_ctrl1_reg write failed. * @retval -5 u3phy_pma_debug_sel_misc_reg write failed. * @retval -6 Register at offset (0x000100C8) write failed. * @retval -7 Register at offset (0x0001008C) write failed. * @retval -8 Register at offset (0x00010090) write failed. * @retval -9 Register at offset (0x00010094) write failed. * @retval -10 Register at offset (0x00010040) write failed when EXT_CLK_EN * is enabled. * @retval -11 Register at offset (0x00010040) write failed when EXT_CLK_EN * is disabled. * @retval -12 GUSB2PHYCFG0 register write failed while reset. * @retval -13 GUSB3PIPECTL0 register write failed while reset. */ extern int usb_reset_seq(void); #endif /* SRC_USB_RESET_SEQ_H_ */