// -------------------------------------------------------------------- // Copyright (c) 2007 by Terasic Technologies Inc. // -------------------------------------------------------------------- // // Permission: // // Terasic grants permission to use and modify this code for use // in synthesis for all Terasic Development Boards and Altera Development // Kits made by Terasic. Other use of this code, including the selling // ,duplication, or modification of any portion is strictly prohibited. // // Disclaimer: // // This VHDL/Verilog or C/C++ source code is intended as a design reference // which illustrates how these types of functions can be implemented. // It is the user's responsibility to verify their design for // consistency and functionality through the use of formal // verification methods. Terasic provides no warranty regarding the use // or functionality of this code. // // -------------------------------------------------------------------- // // Terasic Technologies Inc // 356 Fu-Shin E. Rd Sec. 1. JhuBei City, // HsinChu County, Taiwan // 302 // // web: http://www.terasic.com/ // email: support@terasic.com // // -------------------------------------------------------------------- // Author: Richard Chang #ifndef HAL1761_HAL_NIOS2_H_ #define HAL1761_HAL_NIOS2_H_ #include "terasic_includes.h" #include "isp1761_config.h" #include //typedef int bool; //#define TRUE 1 //#define FALSE 0 #define msleep(x) usleep(x*1000) // register // EHCI capability register #define REG_CAP_LENGTH 0x000 #define REG_HCI_VERSION 0x002 #define REG_HC_SPARAMS 0x004 #define REG_HC_CPARAMS 0x008 // EHCI operation register #define REG_USBCMD 0x020 #define REG_PORTSC1 0x064 // Configuration registers #define REG_HW_CONTROL_MODE 0x300 #define REG_HC_CHIP_ID 0x304 #define REG_HC_SCRATCH 0x308 #define REG_SW_RESET 0x30C bool HAL1761_Init(void); void HAL1761_UnInit(void); void HAL1761_RegWrite32(alt_u32 Addr, alt_u32 data32); alt_u32 HAL1761_RegRead32(alt_u32 Addr); //void HAL1761_RegWrite16(alt_u32 Addr, alt_u16 data16); //alt_u16 HAL1761_RegRead16(alt_u32 Addr); void HAL1761_MemWrite(alt_u32 Addr, alt_u32 szData[], alt_u32 ByteLen); void HAL1761_MemRead(alt_u32 Addr, alt_u32 szData[], alt_u32 ByteLen); void OS_udelay(int us); void OS_mdelay(int ms); #endif /*HAL1761_HAL_NIOS2_H_*/