📄 xllp_wm8753.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_wm8753.c
CODE32
00000 AREA |.drectve|, DRECTVE
DCB "-defaultlib:coredll.lib "
DCB "-defaultlib:corelibc.lib "
EXPORT |XllpWm8753CodecWrite|
; File f:\wm520\platform\intel_dbpxa27x\public\csp\arm\intel\pxa27x\xllp\source\xllp_wm8753.c
00000 AREA |.text| { |XllpWm8753CodecWrite| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$XllpWm8753CodecWrite|, PDATA, SELECTION=5, ASSOC=|.text| { |XllpWm8753CodecWrite| } ; comdat associative
|$T1319| DCD |$L1318|
DCD 0x40005001
; Function compile flags: /Ogsy
00000 AREA |.text| { |XllpWm8753CodecWrite| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |XllpWm8753CodecWrite| PROC
; 33 : {
00000 |$L1318|
00000 e92d4070 stmdb sp!, {r4 - r6, lr}
00004 |$M1316|
; 34 : XLLP_UINT16_T timer=0;
; 35 : XLLP_UINT16_T temp=0;
; 36 :
; 37 : (pDeviceContext->pCtrlReg)->ISAR = 0x0;
00004 e590300c ldr r3, [r0, #0xC]
00008 e3a05000 mov r5, #0
; 38 : (pDeviceContext->pCtrlReg)->ICR = 0;
; 39 :
; 40 : temp = ( regOffset<<9 | regVal); //combine register address and content into 16 bit data
; 41 :
; 42 : // STEP 1: Send the Sensor Address.
; 43 : (pDeviceContext->pCtrlReg)->ICR |= (XLLP_ICR_UIE | XLLP_ICR_SCLEA);
; 44 : (pDeviceContext->pCtrlReg)->IDBR = 0x34; //0x34; // WOLFSON8753_SLAVE_ADDRESS;
0000c e3a06034 mov r6, #0x34
00010 e5835020 str r5, [r3, #0x20]
00014 e590e00c ldr lr, [r0, #0xC]
00018 e1823481 orr r3, r2, r1, lsl #9
0001c e1a04803 mov r4, r3, lsl #16
00020 e58e5010 str r5, [lr, #0x10]
00024 e590200c ldr r2, [r0, #0xC]
00028 e1a04824 mov r4, r4, lsr #16
0002c e5923010 ldr r3, [r2, #0x10]
00030 e3833060 orr r3, r3, #0x60
00034 e5823010 str r3, [r2, #0x10]
00038 e590300c ldr r3, [r0, #0xC]
0003c e5836008 str r6, [r3, #8]
; 45 :
; 46 : (pDeviceContext->pCtrlReg)->ICR |= (XLLP_ICR_UIE | XLLP_ICR_SCLEA | XLLP_ICR_START | XLLP_ICR_TB);
00040 e590200c ldr r2, [r0, #0xC]
00044 e5923010 ldr r3, [r2, #0x10]
00048 e3833069 orr r3, r3, #0x69
0004c e5823010 str r3, [r2, #0x10]
; 47 :
; 48 : while(!((pDeviceContext->pCtrlReg)->ISR & XLLP_ISR_ITE))
00050 e590100c ldr r1, [r0, #0xC]
00054 e5913018 ldr r3, [r1, #0x18]
00058 e3130040 tst r3, #0x40
0005c 1a000008 bne |$L1148|
; 49 : {
; 50 : timer++;
00060 e3a02000 mov r2, #0
00064 |$L1147|
00064 e2823001 add r3, r2, #1
00068 e1a02803 mov r2, r3, lsl #16
0006c e1a02822 mov r2, r2, lsr #16
; 51 : //NKDbgPrintfW (TEXT( "XllpACodecWrite,STEP1 %d \r\n"),timer );
; 52 : if(timer == 1000)
00070 e3520ffa cmp r2, #0xFA, 30
00074 0a00002e beq |$L1307|
00078 e5913018 ldr r3, [r1, #0x18]
0007c e3130040 tst r3, #0x40
00080 0afffff7 beq |$L1147|
00084 |$L1148|
; 53 : {
; 54 : //NKDbgPrintfW (TEXT( "XllpACodecWrite,STEP1 \r\n"));
; 55 : return (XLLP_ACODEC_CONTROLLER_INTERFACE_TIMEOUT);
; 56 : }
; 57 :
; 58 : }
; 59 : timer = 0;
; 60 :
; 61 : (pDeviceContext->pCtrlReg)->ISR |= XLLP_ISR_ITE;
00084 e590200c ldr r2, [r0, #0xC]
; 62 :
; 63 : // STEP 2: Send the MSB
; 64 : //EdbgOutputDebugString ( "Register Address %x \r\n",(temp & 0xff00)>>8);
; 65 : (pDeviceContext->pCtrlReg)->IDBR = (temp & 0xff00)>>8; //LSB
00088 e1a01424 mov r1, r4, lsr #8
; 66 : (pDeviceContext->pCtrlReg)->ICR = (XLLP_ICR_UIE | XLLP_ICR_SCLEA | XLLP_ICR_TB);
0008c e3a0e068 mov lr, #0x68
00090 e5923018 ldr r3, [r2, #0x18]
00094 e3833040 orr r3, r3, #0x40
00098 e5823018 str r3, [r2, #0x18]
0009c e590300c ldr r3, [r0, #0xC]
000a0 e5831008 str r1, [r3, #8]
000a4 e590300c ldr r3, [r0, #0xC]
000a8 e583e010 str lr, [r3, #0x10]
; 67 :
; 68 : while(!((pDeviceContext->pCtrlReg)->ISR & XLLP_ISR_ITE))
000ac e590100c ldr r1, [r0, #0xC]
000b0 e5913018 ldr r3, [r1, #0x18]
000b4 e3130040 tst r3, #0x40
000b8 1a000008 bne |$L1152|
; 69 : {
; 70 : timer++;
000bc e3a02000 mov r2, #0
000c0 |$L1151|
000c0 e2823001 add r3, r2, #1
000c4 e1a02803 mov r2, r3, lsl #16
000c8 e1a02822 mov r2, r2, lsr #16
; 71 : if(timer == 1000)
000cc e3520ffa cmp r2, #0xFA, 30
000d0 0a000017 beq |$L1307|
000d4 e5913018 ldr r3, [r1, #0x18]
000d8 e3130040 tst r3, #0x40
000dc 0afffff7 beq |$L1151|
000e0 |$L1152|
; 75 : }
; 76 :
; 77 : }
; 78 : timer = 0;
; 79 :
; 80 : (pDeviceContext->pCtrlReg)->ISR |= XLLP_ISR_ITE;
000e0 e590200c ldr r2, [r0, #0xC]
; 81 :
; 82 : //STEP3: Now sending LSB
; 83 : // EdbgOutputDebugString ( "Register Content %x \r\n",(temp &0x00ff));
; 84 : (pDeviceContext->pCtrlReg)->IDBR = (temp &0x00ff); //LSB
000e4 e20410ff and r1, r4, #0xFF
; 85 : (pDeviceContext->pCtrlReg)->ICR = (XLLP_ICR_UIE | XLLP_ICR_SCLEA | XLLP_ICR_TB |XLLP_ICR_STOP);
000e8 e3a0e06a mov lr, #0x6A
000ec e5923018 ldr r3, [r2, #0x18]
000f0 e3833040 orr r3, r3, #0x40
000f4 e5823018 str r3, [r2, #0x18]
000f8 e590300c ldr r3, [r0, #0xC]
000fc e5831008 str r1, [r3, #8]
00100 e590300c ldr r3, [r0, #0xC]
00104 e583e010 str lr, [r3, #0x10]
00108 e590200c ldr r2, [r0, #0xC]
0010c |$L1155|
; 86 :
; 87 : while(!((pDeviceContext->pCtrlReg)->ISR & XLLP_ISR_ITE));
0010c e5923018 ldr r3, [r2, #0x18]
00110 e3130040 tst r3, #0x40
00114 0afffffc beq |$L1155|
; 88 :
; 89 : (pDeviceContext->pCtrlReg)->ISR |= XLLP_ISR_ITE; //clear ITE
00118 e590200c ldr r2, [r0, #0xC]
; 90 :
; 91 :
; 92 : return XLLP_ACODEC_SUCCESS;
0011c e3a00000 mov r0, #0
00120 e5923018 ldr r3, [r2, #0x18]
00124 e3833040 orr r3, r3, #0x40
00128 e5823018 str r3, [r2, #0x18]
; 93 : }
0012c e8bd4070 ldmia sp!, {r4 - r6, lr}
00130 e12fff1e bx lr
00134 |$L1307|
; 72 : {
; 73 : // EdbgOutputDebugString ( "XllpACodecWrite,STEP2 %x \r\n",(pDeviceContext->pCtrlReg)->ISR);
; 74 : return (XLLP_ACODEC_CONTROLLER_INTERFACE_TIMEOUT);
00134 e3a00003 mov r0, #3
; 93 : }
00138 e8bd4070 ldmia sp!, {r4 - r6, lr}
0013c e12fff1e bx lr
00140 |$M1317|
ENDP ; |XllpWm8753CodecWrite|
EXPORT |XllpWm8753CodecRead|
IMPORT |XllpOstDelayMicroSeconds|
00000 AREA |.text| { |XllpWm8753CodecRead| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$XllpWm8753CodecRead|, PDATA, SELECTION=5, ASSOC=|.text| { |XllpWm8753CodecRead| } ; comdat associative
|$T1344| DCD |$L1343|
DCD 0x40008001
; Function compile flags: /Ogsy
00000 AREA |.text| { |XllpWm8753CodecRead| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |XllpWm8753CodecRead| PROC
; 96 : {
00000 |$L1343|
00000 e92d40f0 stmdb sp!, {r4 - r7, lr}
00004 |$M1341|
00004 e1a05002 mov r5, r2
00008 e1a06001 mov r6, r1
0000c e1a04000 mov r4, r0
; 97 : XLLP_UINT32_T temp;
; 98 : XLLP_UINT16_T timer = 0;
; 99 : //EdbgOutputDebugString ( "Enter XllpACodecRead\r\n");
; 100 :
; 101 :
; 102 : (pDeviceContext->pClockReg)->cken |= XLLP_CLKEN_I2C;
00010 e594e010 ldr lr, [r4, #0x10]
; 103 : (pDeviceContext->pCtrlReg)->ICR = XLLP_ICR_UR;
00014 e3a02901 mov r2, #1, 18
; 104 : 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
; 105 : (pDeviceContext->pCtrlReg)->ICR = 0;
00038 e594300c ldr r3, [r4, #0xC]
0003c e3a0e000 mov lr, #0
; 106 :
; 107 : //P_XLLP_I2C_T pCtrlReg = (pDeviceContext->pAcodecReg)->pCtrlReg;
; 108 : (pDeviceContext->pCtrlReg)->ISAR = 0x0;
; 109 : (pDeviceContext->pCtrlReg)->ICR = (XLLP_ICR_UIE|XLLP_ICR_SCLEA);
00040 e3a01060 mov r1, #0x60
00044 e583e010 str lr, [r3, #0x10]
00048 e594300c ldr r3, [r4, #0xC]
; 110 : //EdbgOutputDebugString ( "after setting ISAR\r\n");
; 111 : // STEP 1: Send the WOlfson8753 address, Master Transmit mode
; 112 : (pDeviceContext->pCtrlReg)->ICR = (XLLP_ICR_UIE | XLLP_ICR_SCLEA);
; 113 : (pDeviceContext->pCtrlReg)->IDBR = 0x35; //WOLFSON8753_SLAVE_ADDRESS;
0004c e3a02035 mov r2, #0x35
; 114 :
; 115 : (pDeviceContext->pCtrlReg)->ICR = (XLLP_ICR_UIE | XLLP_ICR_SCLEA | XLLP_ICR_START | XLLP_ICR_TB);
00050 e3a07069 mov r7, #0x69
00054 e583e020 str lr, [r3, #0x20]
00058 e594300c ldr r3, [r4, #0xC]
0005c e5831010 str r1, [r3, #0x10]
00060 e594300c ldr r3, [r4, #0xC]
00064 e5831010 str r1, [r3, #0x10]
00068 e594300c ldr r3, [r4, #0xC]
0006c e5832008 str r2, [r3, #8]
00070 e594300c ldr r3, [r4, #0xC]
00074 e5837010 str r7, [r3, #0x10]
00078 e594200c ldr r2, [r4, #0xC]
0007c |$L1167|
; 116 : // EdbgOutputDebugString ( "after setting ICR\r\n");
; 117 : while(!((pDeviceContext->pCtrlReg)->ISR & XLLP_ISR_ITE))
0007c e5923018 ldr r3, [r2, #0x18]
00080 e3130040 tst r3, #0x40
00084 0afffffc beq |$L1167|
; 118 : {
; 119 : //timer++;
; 120 :
; 121 : //if(timer == 65536)
; 122 : // {
; 123 : // EdbgOutputDebugString ( "XllpACodecWrite,STEP1 %x \r\n",(pDeviceContext->pCtrlReg)->ISR);
; 124 : // return (XLLP_ACODEC_CONTROLLER_INTERFACE_TIMEOUT);
; 125 : // }
; 126 :
; 127 :
; 128 : }
; 129 : timer = 0;
; 130 :
; 131 : (pDeviceContext->pCtrlReg)->ISR |= XLLP_ISR_ITE;
00088 e594200c ldr r2, [r4, #0xC]
; 132 :
; 133 : //EdbgOutputDebugString ( "step1 : pI2CReg->ISR %x \r\n",(pDeviceContext->pCtrlReg)->ISR);
; 134 :
; 135 : // STEP 2: Send register address down to the AKM card
; 136 : (pDeviceContext->pCtrlReg)->IDBR = regOffset;
; 137 : // EdbgOutputDebugString ( "step2 : pI2CReg->IDBR %x \r\n",(pDeviceContext->pCtrlReg)->IDBR);
; 138 : (pDeviceContext->pCtrlReg)->ICR = (XLLP_ICR_UIE |XLLP_ICR_SCLEA | XLLP_ICR_TB);
0008c e3a00068 mov r0, #0x68
00090 e5923018 ldr r3, [r2, #0x18]
00094 e3833040 orr r3, r3, #0x40
00098 e5823018 str r3, [r2, #0x18]
0009c e594300c ldr r3, [r4, #0xC]
000a0 e5836008 str r6, [r3, #8]
000a4 e594300c ldr r3, [r4, #0xC]
000a8 e5830010 str r0, [r3, #0x10]
000ac e594200c ldr r2, [r4, #0xC]
000b0 |$L1170|
; 139 :
; 140 : while(!((pDeviceContext->pCtrlReg)->ISR & XLLP_ISR_ITE));
000b0 e5923018 ldr r3, [r2, #0x18]
000b4 e3130040 tst r3, #0x40
000b8 0afffffc beq |$L1170|
; 141 : {
; 142 : // timer++;
; 143 :
; 144 : // if(timer == 1000)
; 145 : // {
; 146 : //EdbgOutputDebugString ( "XllpACodecWrite,STEP1 %x \r\n",pCtrlReg->ISR);
; 147 : // return (XLLP_ACODEC_CONTROLLER_INTERFACE_TIMEOUT);
; 148 : // }
; 149 :
; 150 : }
; 151 : timer = 0;
; 152 :
; 153 : (pDeviceContext->pCtrlReg)->ISR |= XLLP_ISR_ITE;
000bc e594200c ldr r2, [r4, #0xC]
; 154 : // EdbgOutputDebugString ( "step2 : (pDeviceContextp->CtrlReg)->ISR %x \r\n",(pDeviceContext->pCtrlReg)->ISR);
; 155 : // STEP 3: Master reissue the start condition, slave address and slave address with the R/W bit set to 1.
; 156 : (pDeviceContext->pCtrlReg)->IDBR = 0x33; //(WOLFSON8753_SLAVE_ADDRESS|0x1); //0x1 -- means READ operation
000c0 e3a01033 mov r1, #0x33
000c4 e5923018 ldr r3, [r2, #0x18]
000c8 e3833040 orr r3, r3, #0x40
000cc e5823018 str r3, [r2, #0x18]
000d0 e594300c ldr r3, [r4, #0xC]
000d4 e5831008 str r1, [r3, #8]
; 157 : (pDeviceContext->pCtrlReg)->ICR = (XLLP_ICR_UIE | XLLP_ICR_SCLEA | XLLP_ICR_START | XLLP_ICR_TB );
000d8 e594300c ldr r3, [r4, #0xC]
000dc e5837010 str r7, [r3, #0x10]
; 158 :
; 159 : while(!((pDeviceContext->pCtrlReg)->ISR & XLLP_ISR_ITE))
000e0 e594100c ldr r1, [r4, #0xC]
000e4 e5913018 ldr r3, [r1, #0x18]
000e8 e3130040 tst r3, #0x40
000ec 1a000008 bne |$L1174|
; 160 : {
; 161 : timer++;
000f0 e3a02000 mov r2, #0
000f4 |$L1173|
000f4 e2823001 add r3, r2, #1
000f8 e1a02803 mov r2, r3, lsl #16
000fc e1a02822 mov r2, r2, lsr #16
; 162 :
; 163 : if(timer == 65536)
00100 e3520801 cmp r2, #1, 16
00104 0a00003a beq |$L1330|
00108 e5913018 ldr r3, [r1, #0x18]
0010c e3130040 tst r3, #0x40
00110 0afffff7 beq |$L1173|
00114 |$L1174|
; 164 : {
; 165 : //EdbgOutputDebugString ( "XllpACodecWrite,STEP1 %x \r\n",pCtrlReg->ISR);
; 166 : return (XLLP_ACODEC_CONTROLLER_INTERFACE_TIMEOUT);
; 167 : }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -