www.pudn.com > h2410系列usb驱动.zip > usbmain.c
/****************************************************************
NAME: usbmain.c
DESC: endpoint interrupt handler
USB init jobs
HISTORY:
Mar.25.2002:purnnamu: ported for S3C2410X.
Mar.27.2002:purnnamu: DMA is enabled.
****************************************************************/
#include
#include
#include "option.h"
#include "2410addr.h"
#include "2410lib.h"
#include "def.h"
#include "2410usb.h"
#include "usbmain.h"
#include "usblib.h"
#include "usbsetup.h"
#include "usbout.h"
#include "usbin.h"
/**************************
Some PrepareEp1Fifo() should be deleted
**************************/
void UsbdMain(void)
{
int i;
U8 tmp1;
U8 oldTmp1=0xff;
//ChangeUPllValue(0x48,0x3,0x2); //UCLK=48Mhz
//ChangeUPllValue(40,1,2); //UCLK=48Mhz setting in init.s
InitDescriptorTable();
//ResetUsbd();
ConfigUsbd();
//DetectVbus(); //not used in S3C2400X
PrepareEp1Fifo();
#if 0
while(1)
{
if(DbgPrintfLoop())continue;
Delay(5000);
if((i++%2)==0)Led_Display(0x8);
else Led_Display(0x0);
}
#endif
}
void __irq IsrUsbd(void)
{
U8 usbdIntpnd,epIntpnd;
U8 saveIndexReg=rINDEX_REG;
usbdIntpnd=rUSB_INT_REG;
epIntpnd=rEP_INT_REG;
//DbgPrintf( "[INT:EP_I=%x,USBI=%x]",epIntpnd,usbIntpnd );
if(usbdIntpnd&SUSPEND_INT)
{
rUSB_INT_REG=SUSPEND_INT;
DbgPrintf( "