📄 pd6710.txt
字号:
;;;249
;;;250 Delay(10); //RESET should be Hi-Z for minimum 1ms
000294 e3a0000a MOV r0,#0xa
000298 ebfffffe BL Delay
;;;251 PD6710_Modify(INT_GENERAL_CTRL,(1<<6),0); //RESET=active(H)
00029c e3a02000 MOV r2,#0
0002a0 e3a01040 MOV r1,#0x40
0002a4 e3a00003 MOV r0,#3
0002a8 ebfffffe BL PD6710_Modify
;;;252 PD6710_Modify(POWER_CTRL,(1<<7),(1<<7)); //output2card_enable(RESET=Hi-Z -> output)
0002ac e3a02080 MOV r2,#0x80
0002b0 e3a01080 MOV r1,#0x80
0002b4 e3a00002 MOV r0,#2
0002b8 ebfffffe BL PD6710_Modify
;;;253 PD6710_Modify(INT_GENERAL_CTRL,(1<<6),0); //RESET=active(H)
0002bc e3a02000 MOV r2,#0
0002c0 e3a01040 MOV r1,#0x40
0002c4 e3a00003 MOV r0,#3
0002c8 ebfffffe BL PD6710_Modify
;;;254 Delay(1); //wait for minimum 10us
0002cc e3a00001 MOV r0,#1
0002d0 ebfffffe BL Delay
;;;255 PD6710_Modify(INT_GENERAL_CTRL,(1<<6),(1<<6)); //RESET=inactive(L)
0002d4 e3a02040 MOV r2,#0x40
0002d8 e3a01040 MOV r1,#0x40
0002dc e3a00003 MOV r0,#3
0002e0 ebfffffe BL PD6710_Modify
;;;256 Delay(200); //wait for 20ms
0002e4 e3a000c8 MOV r0,#0xc8
0002e8 ebfffffe BL Delay
;;;257 //READY pin isn't available in mem_io_card mode.
;;;258 //So, don't check READY pin on I/O card.
;;;259 //while(!(PD6710_Rd(INTERFACE_STATUS)&0x20)); //INTERFACE_STATUS[5]=READY_PIN_STATUS
;;;260 PD6710_Modify(INT_GENERAL_CTRL,(1<<5),(1<<5)); //mem_card -> mem_io_card
0002ec e3a02020 MOV r2,#0x20
0002f0 e3a01020 MOV r1,#0x20
0002f4 e3a00003 MOV r0,#3
0002f8 ebfffffe BL PD6710_Modify
;;;261
;;;262 Delay(5000);
0002fc e59f0034 LDR r0,|L1.824|
000300 ebfffffe BL Delay
;;;263 //If this delay isn't here, some CF card will not be identified.
;;;264 //In oder to remove this delay, I think, we have to check READY signal.
;;;265 }
000304 e8bd8008 LDMFD sp!,{r3,pc}
|L1.776|
000308 56302e35 DCB "5.0V"
00030c 72616320 DCB " car"
000310 73692064 DCB "d is"
000314 74656420 DCB " det"
000318 65746365 DCB "ecte"
00031c 000a2e64 DCB "d.\n\0"
|L1.800|
000320 56332e33 DCB "3.3V"
000324 72616320 DCB " car"
000328 73692064 DCB "d is"
00032c 74656420 DCB " det"
000330 65746365 DCB "ecte"
000334 000a2e64 DCB "d.\n\0"
|L1.824|
000338 00001388 DCD 0x00001388
ENDP
IsrPD6710Card PROC
;;;363 void __irq IsrPD6710Card(void) //nINT_P_DEV
;;;364 {
00033c e92d500f STMFD sp!,{r0-r3,r12,lr}
;;;365 rEINTPEND=(1<<8); //EINTPEND[8] is cleared.
000340 e3a00f40 MOV r0,#0x100
000344 e3a01456 MOV r1,#0x56000000
000348 e58100a8 STR r0,[r1,#0xa8]
;;;366 ClearPending(BIT_EINT8_23);
00034c e3a00020 MOV r0,#0x20
000350 e3a0144a MOV r1,#0x4a000000
000354 e5810000 STR r0,[r1,#0]
000358 e3a00020 MOV r0,#0x20
00035c e3a0144a MOV r1,#0x4a000000
000360 e5810010 STR r0,[r1,#0x10]
000364 e3a0044a MOV r0,#0x4a000000
000368 e5900010 LDR r0,[r0,#0x10]
;;;367 Uart_Printf("PC card interrupt is occurred.\n");
00036c e28f0008 ADR r0,|L1.892|
000370 ebfffffe BL Uart_Printf
;;;368 }
000374 e8bd500f LDMFD sp!,{r0-r3,r12,lr}
000378 e25ef004 SUBS pc,lr,#4
|L1.892|
00037c 63204350 DCB "PC c"
000380 20647261 DCB "ard "
000384 65746e69 DCB "inte"
000388 70757272 DCB "rrup"
00038c 73692074 DCB "t is"
000390 63636f20 DCB " occ"
000394 65727275 DCB "urre"
000398 000a2e64 DCB "d.\n\0"
ENDP
PD6710_Wr PROC
;;;268 void PD6710_Wr(U8 index, U8 data)
;;;269 {
00039c e3a02544 MOV r2,#0x11000000
;;;270
;;;271 rPD6710_INDEX=index;
0003a0 e5c203e0 STRB r0,[r2,#0x3e0]
;;;272 rPD6710_DATA=data;
0003a4 e3a02544 MOV r2,#0x11000000
0003a8 e5c213e1 STRB r1,[r2,#0x3e1]
;;;273
;;;274 }
0003ac e1a0f00e MOV pc,lr
ENDP
PD6710_Init PROC
;;;166 int PD6710_Init(void)
;;;167 {
0003b0 e92d4008 STMFD sp!,{r3,lr}
;;;168 //Initialize PD-6710
;;;169 PD6710_Wr(POWER_CTRL,(0<<7)|(1<<5)|(0<<4)|(0<<0));
0003b4 e3a01020 MOV r1,#0x20
0003b8 e3a00002 MOV r0,#2
0003bc ebfffffe BL PD6710_Wr
;;;170 //output2card_disable,AUTO_POWER,VCC_POWER_OFF,Vpp1=0V
;;;171
;;;172 PD6710_Wr(INT_GENERAL_CTRL,(1<<7)|(0<<5)|(1<<4)|(3<<0));
0003c0 e3a01093 MOV r1,#0x93
0003c4 e3a00003 MOV r0,#3
0003c8 ebfffffe BL PD6710_Wr
;;;173 //nSTSCHG=status change(not RI input),mem_card_interface,
;;;174 //manage_int=-INTR pin, nINT_P_DEV=IRQ3
;;;175
;;;176 PD6710_Wr(MANAGEMENT_INT_CONFIG,(1<<0)|(1<<3)|(3<<4));
0003cc e3a01039 MOV r1,#0x39
0003d0 e3a00005 MOV r0,#5
0003d4 ebfffffe BL PD6710_Wr
;;;177 //status_change_int_enable, card_detect_int_enable, IRQ disabled(IRQ_3)
;;;178 //Is nINTR pin used???
;;;179 PD6710_Wr(IO_WINDOW_CTRL,0|(0<<3));
0003d8 e3a01000 MOV r1,#0
0003dc e3a00007 MOV r0,#7
0003e0 ebfffffe BL PD6710_Wr
;;;180 //IO0=8bit,timing_set_0
;;;181
;;;182 // I/O windows must never include 3e0h and 3e1h
;;;183 // IO AREA=0x3f8~0x3ff(COM1) ->0x3f8~0x3ff
;;;184 PD6710_Wr(SYS_IO_MAP0_START_L,0xf8);
0003e4 e3a010f8 MOV r1,#0xf8
0003e8 e3a00008 MOV r0,#8
0003ec ebfffffe BL PD6710_Wr
;;;185 PD6710_Wr(SYS_IO_MAP0_START_H,0x3);
0003f0 e3a01003 MOV r1,#3
0003f4 e3a00009 MOV r0,#9
0003f8 ebfffffe BL PD6710_Wr
;;;186 PD6710_Wr(SYS_IO_MAP0_END_L,0xff);
0003fc e3a010ff MOV r1,#0xff
000400 e3a0000a MOV r0,#0xa
000404 ebfffffe BL PD6710_Wr
;;;187 PD6710_Wr(SYS_IO_MAP0_END_H,0x3);
000408 e3a01003 MOV r1,#3
00040c e3a0000b MOV r0,#0xb
000410 ebfffffe BL PD6710_Wr
;;;188 PD6710_Wr(CARD_IO_MAP0_OFFSET_L,0x0);
000414 e3a01000 MOV r1,#0
000418 e3a00036 MOV r0,#0x36
00041c ebfffffe BL PD6710_Wr
;;;189 PD6710_Wr(CARD_IO_MAP0_OFFSET_H,0x0);
000420 e3a01000 MOV r1,#0
000424 e3a00037 MOV r0,#0x37
000428 ebfffffe BL PD6710_Wr
;;;190
;;;191 //PD6710_Wr(SYS_MEM_MAP0_START_L,0x10);
;;;192 //If this is memory window, the lowest 64KB should be reserved.
;;;193 PD6710_Wr(SYS_MEM_MAP0_START_L,0x0); //MEM0=8bit data width
00042c e3a01000 MOV r1,#0
000430 e3a00010 MOV r0,#0x10
000434 ebfffffe BL PD6710_Wr
;;;194 //To access CIS, I have known that memory window bus width should be
;;;195 // 8-bit by experiment.
;;;196 //Originally, CIS uses 8-bit bus. But, Why not in 16-bit bus width?
;;;197 PD6710_Wr(SYS_MEM_MAP0_START_H,0x0);
000438 e3a01000 MOV r1,#0
00043c e3a00011 MOV r0,#0x11
000440 ebfffffe BL PD6710_Wr
;;;198 PD6710_Wr(SYS_MEM_MAP0_END_L,0x0f); //0x0 ~ 0xffff
000444 e3a0100f MOV r1,#0xf
000448 e3a00012 MOV r0,#0x12
00044c ebfffffe BL PD6710_Wr
;;;199 PD6710_Wr(SYS_MEM_MAP0_END_H,0x0|(0<<6)); //timing_set_0
000450 e3a01000 MOV r1,#0
000454 e3a00013 MOV r0,#0x13
000458 ebfffffe BL PD6710_Wr
;;;200 PD6710_Wr(CARD_MEM_MAP0_OFFSET_L,0x0);
00045c e3a01000 MOV r1,#0
000460 e3a00014 MOV r0,#0x14
000464 ebfffffe BL PD6710_Wr
;;;201 PD6710_Wr(CARD_MEM_MAP0_OFFSET_H,0x0|(1<<6)); //nREG=active
000468 e3a01040 MOV r1,#0x40
00046c e3a00015 MOV r0,#0x15
000470 ebfffffe BL PD6710_Wr
;;;202 //MEM AREA=0x0~0xFFFF ->0x0~0xFFFFFF
;;;203
;;;204 PD6710_Wr(MAPPING_ENABLE,1|(1<<6));
000474 e3a01041 MOV r1,#0x41
000478 e3a00006 MOV r0,#6
00047c ebfffffe BL PD6710_Wr
;;;205 //memory map 0 enabled, I/O map 0 enabled
;;;206
;;;207 PD6710_Wr(MISC_CTRL1,(0<<7)|(1<<4)|(1<<3)|(1<<2)|(1<<1));
000480 e3a0101e MOV r1,#0x1e
000484 e3a00016 MOV r0,#0x16
000488 ebfffffe BL PD6710_Wr
;;;208 //INPACK_ignored,speak_enable,edge_irq_intr,edge_management_intr,nVCC_3_enabled(temp)
;;;209 PD6710_Wr(MISC_CTRL2,1|(1<<1)|(1<<4));
00048c e3a01013 MOV r1,#0x13
000490 e3a0001e MOV r0,#0x1e
000494 ebfffffe BL PD6710_Wr
;;;210 //25Mhz_bypass,low_power_dynamic,IRQ12=drive_LED
;;;211
;;;212 PD6710_Wr(FIFO_CTRL,0x80); //Flush FIFO
000498 e3a01080 MOV r1,#0x80
00049c e3a00017 MOV r0,#0x17
0004a0 ebfffffe BL PD6710_Wr
;;;213 //before configuring timing register, FIFO should be cleared.
;;;214
;;;215 //default access time is 300ns
;;;216 PD6710_Wr(SETUP_TIMING0,0x2); //80ns(no spec)
0004a4 e3a01002 MOV r1,#2
0004a8 e3a0003a MOV r0,#0x3a
0004ac ebfffffe BL PD6710_Wr
;;;217 PD6710_Wr(CMD_TIMING0,0x8); //320ns(by spec,25Mhz clock)
0004b0 e3a01008 MOV r1,#8
0004b4 e3a0003b MOV r0,#0x3b
0004b8 ebfffffe BL PD6710_Wr
;;;218 PD6710_Wr(RECOVERY_TIMING0,0x2); //80ns(no spec)
0004bc e3a01002 MOV r1,#2
0004c0 e3a0003c MOV r0,#0x3c
0004c4 ebfffffe BL PD6710_Wr
;;;219
;;;220 PD6710_Wr(CHIP_INFO,0x0);
0004c8 e3a01000 MOV r1,#0
0004cc e3a0001f MOV r0,#0x1f
0004d0 ebfffffe BL PD6710_Wr
;;;221 if((PD6710_Rd(CHIP_INFO)&0xc0)!=0xc0 || (PD6710_Rd(CHIP_INFO)&0xc0)!=0x00 )
0004d4 e3a0001f MOV r0,#0x1f
0004d8 ebfffffe BL PD6710_Rd
0004dc e3a010c0 MOV r1,#0xc0
0004e0 e1d10000 BICS r0,r1,r0
0004e4 1a000003 BNE |L1.1272|
0004e8 e3a0001f MOV r0,#0x1f
0004ec ebfffffe BL PD6710_Rd
0004f0 e31000c0 TST r0,#0xc0
0004f4 0a000003 BEQ |L1.1288|
;;;222 {
;;;223 Uart_Printf("PD6710 hardware identification error!!!\n");
|L1.1272|
0004f8 e28f0010 ADR r0,|L1.1296|
0004fc ebfffffe BL Uart_Printf
;;;224 return 0;
000500 e3a00000 MOV r0,#0
;;;225 }
;;;226 return 1;
;;;227 }
|L1.1284|
000504 e8bd8008 LDMFD sp!,{r3,pc}
|L1.1288|
000508 e3a00001 MOV r0,#1 ;226
00050c eafffffc B |L1.1284| ;226
|L1.1296|
000510 37364450 DCB "PD67" ;226
000514 68203031 DCB "10 h" ;226
000518 77647261 DCB "ardw" ;226
00051c 20657261 DCB "are " ;226
000520 6e656469 DCB "iden" ;226
000524 69666974 DCB "tifi" ;226
000528 69746163 DCB "cati" ;226
00052c 65206e6f DCB "on e" ;226
000530 726f7272 DCB "rror" ;226
000534 0a212121 DCB "!!!\n" ;226
000538 00000000 DCB "\0\0\0\0" ;226
ENDP
IsrPD6710Management PROC
;;;331 void __irq IsrPD6710Management(void) //nINT_P_CON
;;;332 {
00053c e92d501f STMFD sp!,{r0-r4,r12,lr}
000540 e24dd004 SUB sp,sp,#4
;;;333 U8 cardStat;
;;;334 //ClearPending(BIT_EINT7);
;;;335 Uart_Printf("\nPD6710 interrupt is occurred.\n");
000544 e28f007c ADR r0,|L1.1480|
000548 ebfffffe BL Uart_Printf
;;;336
;;;337 Delay(2000);
00054c e3a00e7d MOV r0,#0x7d0
000550 ebfffffe BL Delay
;;;338 //For card contact stablization. This delay is needed for operation stability
;;;339 //If this delay isn't here, some CF card may not be identified.
;;;340
;;;341 cardStat=PD6710_Rd(CARD_STAT_CHANGE);
000554 e3a00004 MOV r0,#4
000558 ebfffffe BL PD6710_Rd
00055c e1a04000 MOV r4,r0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -