📄 xllp_ak2440.cod
字号:
; Listing generated by Microsoft (R) Optimizing Compiler Version 13.10.4345
TTL F:\wm520\PLATFORM\intel_dbpxa27x\Public\CSP\ARM\INTEL\PXA27X\XLLP\SOURCE\.\xllp_ak2440.c
CODE32
00000 AREA |.drectve|, DRECTVE
DCB "-defaultlib:coredll.lib "
DCB "-defaultlib:corelibc.lib "
EXPORT |XllpAKCodecWrite|
; File f:\wm520\platform\intel_dbpxa27x\public\csp\arm\intel\pxa27x\xllp\source\xllp_ak2440.c
00000 AREA |.text| { |XllpAKCodecWrite| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$XllpAKCodecWrite|, PDATA, SELECTION=5, ASSOC=|.text| { |XllpAKCodecWrite| } ; comdat associative
|$T1306| DCD |$L1305|
DCD 0x40003701
; Function compile flags: /Ogsy
00000 AREA |.text| { |XllpAKCodecWrite| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |XllpAKCodecWrite| PROC
; 38 : {
00000 |$L1305|
00000 e92d4030 stmdb sp!, {r4, r5, lr}
00004 |$M1303|
00004 e1a04002 mov r4, r2
; 39 : // P_XLLP_I2C_T pCtrlReg = (pDeviceContext->pAcodecReg)->pCtrlReg;
; 40 : XLLP_UINT16_T timer=0;
; 41 :
; 42 :
; 43 :
; 44 : (pDeviceContext->pCtrlReg)->ISAR = 0x0;
00008 e590300c ldr r3, [r0, #0xC]
0000c e3a02000 mov r2, #0
; 45 : (pDeviceContext->pCtrlReg)->ICR = 0;
; 46 :
; 47 :
; 48 : // STEP 1: Send the Sensor Address.
; 49 : (pDeviceContext->pCtrlReg)->ICR |= (XLLP_ICR_UIE | XLLP_ICR_SCLEA);
; 50 : (pDeviceContext->pCtrlReg)->IDBR = 0x9e; // AK2440_SLAVE_ADDRESS;
00010 e3a0509e mov r5, #0x9E
00014 e5832020 str r2, [r3, #0x20]
00018 e590300c ldr r3, [r0, #0xC]
0001c e5832010 str r2, [r3, #0x10]
00020 e590e00c ldr lr, [r0, #0xC]
00024 e59e3010 ldr r3, [lr, #0x10]
00028 e3833060 orr r3, r3, #0x60
0002c e58e3010 str r3, [lr, #0x10]
00030 e590300c ldr r3, [r0, #0xC]
00034 e5835008 str r5, [r3, #8]
; 51 :
; 52 : (pDeviceContext->pCtrlReg)->ICR |= (XLLP_ICR_UIE | XLLP_ICR_SCLEA | XLLP_ICR_START | XLLP_ICR_TB);
00038 e590e00c ldr lr, [r0, #0xC]
0003c e59e3010 ldr r3, [lr, #0x10]
00040 e3833069 orr r3, r3, #0x69
00044 e58e3010 str r3, [lr, #0x10]
00048 e590200c ldr r2, [r0, #0xC]
0004c |$L1146|
; 53 :
; 54 : while(!((pDeviceContext->pCtrlReg)->ISR & XLLP_ISR_ITE))
0004c e5923018 ldr r3, [r2, #0x18]
00050 e3130040 tst r3, #0x40
00054 0afffffc beq |$L1146|
; 55 : {
; 56 : // timer++;
; 57 : // if(timer == 65536)
; 58 : // {
; 59 : // EdbgOutputDebugString ( "XllpACodecWrite,STEP1 %x \r\n",pCtrlReg->ISR);
; 60 : // return (XLLP_ACODEC_CONTROLLER_INTERFACE_TIMEOUT);
; 61 : // }
; 62 :
; 63 : }
; 64 : timer = 0;
; 65 :
; 66 : (pDeviceContext->pCtrlReg)->ISR |= XLLP_ISR_ITE;
00058 e590200c ldr r2, [r0, #0xC]
; 67 :
; 68 : // STEP 2: Send the register address
; 69 : (pDeviceContext->pCtrlReg)->IDBR = regAddr;
; 70 : (pDeviceContext->pCtrlReg)->ICR = (XLLP_ICR_UIE | XLLP_ICR_SCLEA | XLLP_ICR_TB);
0005c e3a0e068 mov lr, #0x68
00060 e5923018 ldr r3, [r2, #0x18]
00064 e3833040 orr r3, r3, #0x40
00068 e5823018 str r3, [r2, #0x18]
0006c e590300c ldr r3, [r0, #0xC]
00070 e5831008 str r1, [r3, #8]
00074 e590300c ldr r3, [r0, #0xC]
00078 e583e010 str lr, [r3, #0x10]
0007c e590200c ldr r2, [r0, #0xC]
00080 |$L1149|
; 71 :
; 72 : while(!((pDeviceContext->pCtrlReg)->ISR & XLLP_ISR_ITE))
00080 e5923018 ldr r3, [r2, #0x18]
00084 e3130040 tst r3, #0x40
00088 0afffffc beq |$L1149|
; 73 : {
; 74 : // timer++;
; 75 : // if(timer == 65536)
; 76 : // {
; 77 : // EdbgOutputDebugString ( "XllpACodecWrite,STEP1 %x \r\n",pCtrlReg->ISR);
; 78 : // return (XLLP_ACODEC_CONTROLLER_INTERFACE_TIMEOUT);
; 79 : // }
; 80 :
; 81 : }
; 82 : timer = 0;
; 83 :
; 84 : (pDeviceContext->pCtrlReg)->ISR |= XLLP_ISR_ITE;
0008c e590200c ldr r2, [r0, #0xC]
; 85 :
; 86 : // STEP 3: Now the register data
; 87 : (pDeviceContext->pCtrlReg)->IDBR = regVaule;
; 88 : (pDeviceContext->pCtrlReg)->ICR = (XLLP_ICR_UIE | XLLP_ICR_SCLEA | XLLP_ICR_TB |XLLP_ICR_STOP);
00090 e3a0106a mov r1, #0x6A
00094 e5923018 ldr r3, [r2, #0x18]
00098 e3833040 orr r3, r3, #0x40
0009c e5823018 str r3, [r2, #0x18]
000a0 e590300c ldr r3, [r0, #0xC]
000a4 e5834008 str r4, [r3, #8]
000a8 e590300c ldr r3, [r0, #0xC]
000ac e5831010 str r1, [r3, #0x10]
000b0 e590200c ldr r2, [r0, #0xC]
000b4 |$L1152|
; 89 :
; 90 : while(!((pDeviceContext->pCtrlReg)->ISR & XLLP_ISR_ITE));
000b4 e5923018 ldr r3, [r2, #0x18]
000b8 e3130040 tst r3, #0x40
000bc 0afffffc beq |$L1152|
; 91 :
; 92 : (pDeviceContext->pCtrlReg)->ISR |= XLLP_ISR_ITE; //clear ITE
000c0 e590200c ldr r2, [r0, #0xC]
; 93 :
; 94 :
; 95 : return XLLP_ACODEC_SUCCESS;
000c4 e3a00000 mov r0, #0
000c8 e5923018 ldr r3, [r2, #0x18]
000cc e3833040 orr r3, r3, #0x40
000d0 e5823018 str r3, [r2, #0x18]
; 96 : }
000d4 e8bd4030 ldmia sp!, {r4, r5, lr}
000d8 e12fff1e bx lr
000dc |$M1304|
ENDP ; |XllpAKCodecWrite|
EXPORT |XllpAKCodecRead|
IMPORT |XllpOstDelayMicroSeconds|
00000 AREA |.text| { |XllpAKCodecRead| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$XllpAKCodecRead|, PDATA, SELECTION=5, ASSOC=|.text| { |XllpAKCodecRead| } ; comdat associative
|$T1327| DCD |$L1326|
DCD 0x40006c01
; Function compile flags: /Ogsy
00000 AREA |.text| { |XllpAKCodecRead| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |XllpAKCodecRead| PROC
; 100 : {
00000 |$L1326|
00000 e92d41f0 stmdb sp!, {r4 - r8, lr}
00004 |$M1324|
00004 e1a06002 mov r6, r2
00008 e1a05001 mov r5, r1
0000c e1a04000 mov r4, r0
; 101 : XLLP_UINT32_T temp;
; 102 : XLLP_UINT16_T timer = 0;
; 103 : //EdbgOutputDebugString ( "Enter XllpACodecRead\r\n");
; 104 :
; 105 :
; 106 : (pDeviceContext->pClockReg)->cken |= XLLP_CLKEN_I2C;
00010 e594e010 ldr lr, [r4, #0x10]
; 107 : (pDeviceContext->pCtrlReg)->ICR = XLLP_ICR_UR;
00014 e3a02901 mov r2, #1, 18
; 108 : XllpOstDelayMicroSeconds( pDeviceContext->pOSTRegs,1);
00018 e3a01001 mov r1, #1
0001c e59e3004 ldr r3, [lr, #4]
00020 e3833901 orr r3, r3, #1, 18
00024 e58e3004 str r3, [lr, #4]
00028 e594300c ldr r3, [r4, #0xC]
0002c e5832010 str r2, [r3, #0x10]
00030 e5940024 ldr r0, [r4, #0x24]
00034 eb000000 bl XllpOstDelayMicroSeconds
; 109 : (pDeviceContext->pCtrlReg)->ICR = 0;
00038 e594300c ldr r3, [r4, #0xC]
0003c e3a08000 mov r8, #0
; 110 :
; 111 : //P_XLLP_I2C_T pCtrlReg = (pDeviceContext->pAcodecReg)->pCtrlReg;
; 112 : (pDeviceContext->pCtrlReg)->ISAR = 0x0;
; 113 : //(pDeviceContext->pCtrlReg)->ICR = 0;
; 114 : (pDeviceContext->pCtrlReg)->ICR = (XLLP_ICR_UIE|XLLP_ICR_SCLEA);
00040 e3a07060 mov r7, #0x60
00044 e5838010 str r8, [r3, #0x10]
00048 e594300c ldr r3, [r4, #0xC]
; 115 : XllpOstDelayMicroSeconds( pDeviceContext->pOSTRegs,100);
0004c e3a01064 mov r1, #0x64
00050 e5838020 str r8, [r3, #0x20]
00054 e594300c ldr r3, [r4, #0xC]
00058 e5837010 str r7, [r3, #0x10]
0005c e5940024 ldr r0, [r4, #0x24]
00060 eb000000 bl XllpOstDelayMicroSeconds
; 116 : //EdbgOutputDebugString ( "after setting ISAR\r\n");
; 117 : // STEP 1: Send the akm2440 address, Master Transmit mode -AKM manual P60 -- first do dummy write
; 118 : (pDeviceContext->pCtrlReg)->ICR = (XLLP_ICR_UIE | XLLP_ICR_SCLEA);
00064 e594300c ldr r3, [r4, #0xC]
; 119 : (pDeviceContext->pCtrlReg)->IDBR = 0x9e; //AK2440_SLAVE_ADDRESS;
00068 e3a0209e mov r2, #0x9E
; 120 :
; 121 : (pDeviceContext->pCtrlReg)->ICR = (XLLP_ICR_UIE | XLLP_ICR_SCLEA | XLLP_ICR_START | XLLP_ICR_TB);
0006c e3a00069 mov r0, #0x69
00070 e5837010 str r7, [r3, #0x10]
00074 e594300c ldr r3, [r4, #0xC]
00078 e5832008 str r2, [r3, #8]
0007c e594300c ldr r3, [r4, #0xC]
00080 e5830010 str r0, [r3, #0x10]
00084 e594200c ldr r2, [r4, #0xC]
00088 |$L1164|
; 122 : // EdbgOutputDebugString ( "after setting ICR\r\n");
; 123 : while(!((pDeviceContext->pCtrlReg)->ISR & XLLP_ISR_ITE))
00088 e5923018 ldr r3, [r2, #0x18]
0008c e3130040 tst r3, #0x40
00090 0afffffc beq |$L1164|
; 124 : {
; 125 : //timer++;
; 126 :
; 127 : //if(timer == 65536)
; 128 : // {
; 129 : // EdbgOutputDebugString ( "XllpACodecWrite,STEP1 %x \r\n",(pDeviceContext->pCtrlReg)->ISR);
; 130 : // return (XLLP_ACODEC_CONTROLLER_INTERFACE_TIMEOUT);
; 131 : // }
; 132 :
; 133 :
; 134 : }
; 135 : timer = 0;
; 136 :
; 137 : (pDeviceContext->pCtrlReg)->ISR |= XLLP_ISR_ITE;
00094 e594200c ldr r2, [r4, #0xC]
; 138 :
; 139 : //EdbgOutputDebugString ( "step1 : pI2CReg->ISR %x \r\n",(pDeviceContext->pCtrlReg)->ISR);
; 140 :
; 141 : // STEP 2: Send register address down to the AKM card
; 142 : (pDeviceContext->pCtrlReg)->IDBR = regAddr;
; 143 : // EdbgOutputDebugString ( "step2 : pI2CReg->IDBR %x \r\n",(pDeviceContext->pCtrlReg)->IDBR);
; 144 : (pDeviceContext->pCtrlReg)->ICR = (XLLP_ICR_UIE |XLLP_ICR_SCLEA | XLLP_ICR_TB);
00098 e3a01068 mov r1, #0x68
0009c e5923018 ldr r3, [r2, #0x18]
000a0 e3833040 orr r3, r3, #0x40
000a4 e5823018 str r3, [r2, #0x18]
000a8 e594300c ldr r3, [r4, #0xC]
000ac e5835008 str r5, [r3, #8]
000b0 e594300c ldr r3, [r4, #0xC]
000b4 e5831010 str r1, [r3, #0x10]
000b8 e594200c ldr r2, [r4, #0xC]
000bc |$L1167|
; 145 :
; 146 : while(!((pDeviceContext->pCtrlReg)->ISR & XLLP_ISR_ITE));
000bc e5923018 ldr r3, [r2, #0x18]
000c0 e3130040 tst r3, #0x40
000c4 0afffffc beq |$L1167|
; 147 : {
; 148 : // timer++;
; 149 :
; 150 : // if(timer == 1000)
; 151 : // {
; 152 : //EdbgOutputDebugString ( "XllpACodecWrite,STEP1 %x \r\n",pCtrlReg->ISR);
; 153 : // return (XLLP_ACODEC_CONTROLLER_INTERFACE_TIMEOUT);
; 154 : // }
; 155 :
; 156 : }
; 157 : timer = 0;
; 158 :
; 159 : (pDeviceContext->pCtrlReg)->ISR |= XLLP_ISR_ITE;
000c8 e594200c ldr r2, [r4, #0xC]
; 160 : // EdbgOutputDebugString ( "step2 : (pDeviceContextp->CtrlReg)->ISR %x \r\n",(pDeviceContext->pCtrlReg)->ISR);
; 161 : // STEP 3: Master reissue the start condition, slave address and slave address with the R/W bit set to 1.
; 162 : (pDeviceContext->pCtrlReg)->IDBR = 0x9f; //(AK2440_SLAVE_ADDRESS|0x1); //0x1 -- means READ operation
000cc e3a0109f mov r1, #0x9F
000d0 e5923018 ldr r3, [r2, #0x18]
000d4 e3833040 orr r3, r3, #0x40
000d8 e5823018 str r3, [r2, #0x18]
000dc e594300c ldr r3, [r4, #0xC]
000e0 e5831008 str r1, [r3, #8]
; 163 : (pDeviceContext->pCtrlReg)->ICR = (XLLP_ICR_UIE | XLLP_ICR_SCLEA | XLLP_ICR_START | XLLP_ICR_TB );
000e4 e594300c ldr r3, [r4, #0xC]
000e8 e5830010 str r0, [r3, #0x10]
; 164 :
; 165 : while(!((pDeviceContext->pCtrlReg)->ISR & XLLP_ISR_ITE))
000ec e594100c ldr r1, [r4, #0xC]
000f0 e5913018 ldr r3, [r1, #0x18]
000f4 e3130040 tst r3, #0x40
000f8 1a000008 bne |$L1171|
; 166 : {
; 167 : timer++;
000fc e3a02000 mov r2, #0
00100 |$L1170|
00100 e2823001 add r3, r2, #1
00104 e1a02803 mov r2, r3, lsl #16
00108 e1a02822 mov r2, r2, lsr #16
; 168 :
; 169 : if(timer == 65536)
0010c e3520801 cmp r2, #1, 16
00110 0a000023 beq |$L1315|
00114 e5913018 ldr r3, [r1, #0x18]
00118 e3130040 tst r3, #0x40
0011c 0afffff7 beq |$L1170|
00120 |$L1171|
; 170 : {
; 171 : //EdbgOutputDebugString ( "XllpACodecWrite,STEP1 %x \r\n",pCtrlReg->ISR);
; 172 : return (XLLP_ACODEC_CONTROLLER_INTERFACE_TIMEOUT);
; 173 : }
; 174 :
; 175 : }
; 176 :
; 177 : timer = 0;
; 178 :
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -