- 先unlockdeive : *(0x7C) = 0xAA37; 由suspend mode喚醒,對任何register 動作前要對 unlock register寫入AA37。
- testmodereg 寫入0x10 : *(0x84) = 0x10 ; FORCEFS - force Full Speed.
- mode register, clear SOFTCT (soft-connect) ,也就是將D+ pullup 移除(變成full speed)。
- 對interrupt register 寫入0xFFFFFF,將所有interrupt source 清除。 *(0x18) = 0xFFFFFFFF.
interrupt register register 代表目前產生interrupt的原因,對該bit寫入1可以將該source clear。
- 對scratch register寫入0xAA55,讀出確認OK。
- Interrupt Config (0x10)
- Interrupt mast L.H (x014, 0x16)
- Interrupt register L.H (0x18, 0x1A)
- DMA config (0x38)
- DMA counter L.H (0x34,0x36)
- Current Frame Number (0x74)
- Mode (0x0C)
- Address (0x00)
Read Chip ID 0x70.74.76
開始connect USB:
Address Enable : *(0x00) = 0x80;Config Endpoint
Mode : *(0x0C) = 0x08 | 0x01 | 0x80 | 0x200; GLINTENA, SOFTCT, CLKAON, 0x200
Test : *(0x84) = 0x00; exit test mode
IntConfig: (0x10) = 0x40 | 0x10 | 0x04; cdbgmod_as,ddbgmodin_a, ddbgmodout_asy,
control interrupt : on ack,stall
in interrupt : ack only
out interrupt : ack and stall
IntEnableLow :*(0x14) = 0x0001 | 0x0008 | 0x0010 | 0x0020 | 0x0100 | 0x0080
0x0400 | 0x0800 | 0x1000 | 0x2000 | 0x4000 | 0x8000 ;
butreset,susp,resume,hs_state,ep0set,
vbus,ep0rx, ep0tx, ep1rx, ep1tx,
ep2rx, ep2tx.
IntEnableHi : *(0x16) = 0x00;
先將7個endpoint的tx,rx type 都設為0
1 則留言:
Sorry, don't speak Chinese
張貼留言