//****************FIQ部分的程序**************************** extern void Pulses(void);
void FIQ_Exception(void) { Pulses(); // change it to your code 这一句替换为自己的代码 }
/*********************************************************/
下面是Pluses部分的程序 ;-------------Pulses()------------------------------------ AREA AsmFunc, CODE, READONLY EXPORT Pulses IMPORT send_data Pulses STMFD SP!, {R0-R10, LR} ;入栈 LDR R10,=send_data LDR R0, [R10] MOV R2, #0x10 ;LR数据长度 MOV R3, #0x200 ;P0.9 MCK MOV R1, #0x10 ;P0.4 DIN LDR R9, =0xE0004000 LDR R8, =0xFFFFF030 MOV R7, #0 LDR R4, =0x3FFFC01C ;FIO0CLR0 LDR R5, =0x3FFFC018 ;FIO0SET0 MOV R6, #0x80 ;P0.7 WS ;WS=0 16位循环 LOOP STR R3, [R4] ;MCK=0 STR R6, [R4] ;WS=0 LOOP3 STR R3, [R4] ;MCK=0 TST R0, #0x80000000 BNE LOOP1 STR R1, [R4] ;DOUT=0 B LOOP2 LOOP1
STR R1, [R5] ;DOUT=1 LOOP2 MOV R7, R0,LSL #1 MOV R0, R7 STR R3, [R5] ;MCK=1 SUBS R2, R2,#1 BHI LOOP3 MOV R2, #0x10 LDR R0, [R10] MOV R10,R0,LSL #16 MOV R0, R10 ;WS=1 16位循环 LOOP_SMALL STR R3, [R4] ;MCK=0 STR R6, [R5] ;WS=1 LOOP_SMALL3 STR R3, [R4] ;MCK=0 TST R0, #0x80000000 BNE LOOP_SMALL1 STR R1, [R4] ;DOUT=0 B LOOP_SMALL2 LOOP_SMALL1 STR R1, [R5] ;DOUT=1 LOOP_SMALL2 MOV R7, R0,LSL #1 MOV R0, R7 STR R3, [R5] ;MCK=1 SUBS R2, R2,#1 ;CMP R2, #0 BHI LOOP_SMALL3 ;循环结束 MOV R7, #0x01 STR R7, [R9] MOV R6, #0x00 STR R6, [R8] LDMFD SP!, {R0-R10, LR} ;返回 END ;-------------------------------------------------------- |