📄 spid.lst
字号:
\ 00000020 0C30C0E5 STRB R3,[R0, #+12]
123
124 // Enable the SPI clock
125 WRITE_PMC(AT91C_BASE_PMC, PMC_PCER, (1 << pSpid->spiId));
\ 00000024 0130A0E3 MOV R3,#+1
\ 00000028 D4C0D0E1 LDRSB R12,[R0, #+4]
\ 0000002C 133CA0E1 LSL R3,R3,R12
\ 00000030 EFC0E0E3 MVN R12,#+239
\ 00000034 C0CFCCE3 BIC R12,R12,#0x300
\ 00000038 00308CE5 STR R3,[R12, #+0]
126
127 // Disable transmitter and receiver
128 WRITE_SPI(pSpiHw, SPI_PTCR, AT91C_PDC_RXTDIS | AT91C_PDC_TXTDIS);
\ 0000003C 0230A0E3 MOV R3,#+2
\ 00000040 803F83E3 ORR R3,R3,#0x200
\ 00000044 203182E5 STR R3,[R2, #+288]
129
130 // Write to the MR register
131 spiMr = READ_SPI(pSpiHw, SPI_MR);
\ 00000048 043092E5 LDR R3,[R2, #+4]
132 spiMr |= AT91C_SPI_PCS;
133 spiMr &= ~((1 << pCommand->spiCs) << 16);
134 WRITE_SPI(pSpiHw, SPI_MR, spiMr);
\ 0000004C F03A83E3 ORR R3,R3,#0xF0000
\ 00000050 01C0A0E3 MOV R12,#+1
\ 00000054 DEE0D1E1 LDRSB LR,[R1, #+14]
\ 00000058 1CCEA0E1 LSL R12,R12,LR
\ 0000005C 0CC8E0E1 MVN R12,R12, LSL #+16
\ 00000060 03300CE0 AND R3,R12,R3
\ 00000064 043082E5 STR R3,[R2, #+4]
135
136 // Initialize the two SPI PDC buffer
137 WRITE_SPI(pSpiHw, SPI_RPR, (int) pCommand->pCmd);
\ 00000068 003091E5 LDR R3,[R1, #+0]
\ 0000006C 003182E5 STR R3,[R2, #+256]
138 WRITE_SPI(pSpiHw, SPI_RCR, pCommand->cmdSize);
\ 00000070 0430D1E5 LDRB R3,[R1, #+4]
\ 00000074 043182E5 STR R3,[R2, #+260]
139 WRITE_SPI(pSpiHw, SPI_TPR, (int) pCommand->pCmd);
\ 00000078 003091E5 LDR R3,[R1, #+0]
\ 0000007C 083182E5 STR R3,[R2, #+264]
140 WRITE_SPI(pSpiHw, SPI_TCR, pCommand->cmdSize);
\ 00000080 0430D1E5 LDRB R3,[R1, #+4]
\ 00000084 0C3182E5 STR R3,[R2, #+268]
141
142 WRITE_SPI(pSpiHw, SPI_RNPR, (int) pCommand->pData);
\ 00000088 083091E5 LDR R3,[R1, #+8]
\ 0000008C 103182E5 STR R3,[R2, #+272]
143 WRITE_SPI(pSpiHw, SPI_RNCR, pCommand->dataSize);
\ 00000090 BC30D1E1 LDRH R3,[R1, #+12]
\ 00000094 143182E5 STR R3,[R2, #+276]
144 WRITE_SPI(pSpiHw, SPI_TNPR, (int) pCommand->pData);
\ 00000098 083091E5 LDR R3,[R1, #+8]
\ 0000009C 183182E5 STR R3,[R2, #+280]
145 WRITE_SPI(pSpiHw, SPI_TNCR, pCommand->dataSize);
\ 000000A0 BC30D1E1 LDRH R3,[R1, #+12]
\ 000000A4 1C3182E5 STR R3,[R2, #+284]
146
147 // Initialize the callback
148 pSpid->pCurrentCommand = pCommand;
\ 000000A8 081080E5 STR R1,[R0, #+8]
149
150 // Enable transmitter and receiver
151 WRITE_SPI(pSpiHw, SPI_PTCR, AT91C_PDC_RXTEN | AT91C_PDC_TXTEN);
\ 000000AC 0100A0E3 MOV R0,#+1
\ 000000B0 400F80E3 ORR R0,R0,#0x100
\ 000000B4 200182E5 STR R0,[R2, #+288]
152
153 // Enable buffer complete interrupt
154 WRITE_SPI(pSpiHw, SPI_IER, AT91C_SPI_RXBUFF);
\ 000000B8 4000A0E3 MOV R0,#+64
\ 000000BC 140082E5 STR R0,[R2, #+20]
155
156 return 0;
\ 000000C0 0000A0E3 MOV R0,#+0
\ ??SPID_SendCommand_0:
\ 000000C4 0050BDE8 POP {R12,LR}
\ 000000C8 1EFF2FE1 BX LR ;; return
157 }
158
159 //------------------------------------------------------------------------------
160 /// The SPI_Handler must be called by the SPI Interrupt Service Routine with the
161 /// corresponding Spi instance.
162 /// The SPI_Handler will unlock the Spi semaphore and invoke the upper application
163 /// callback.
164 /// \param pSpid Pointer to a Spid instance.
165 //------------------------------------------------------------------------------
\ In section .text, align 4, keep-with-next
166 void SPID_Handler(Spid *pSpid)
167 {
\ SPID_Handler:
\ 00000000 01402DE9 PUSH {R0,LR}
168 SpidCmd *pSpidCmd = pSpid->pCurrentCommand;
\ 00000004 082090E5 LDR R2,[R0, #+8]
169 AT91S_SPI *pSpiHw = pSpid->pSpiHw;
\ 00000008 001090E5 LDR R1,[R0, #+0]
170 volatile unsigned int spiSr;
171
172 // Read the status register
173 spiSr = READ_SPI(pSpiHw, SPI_SR);
\ 0000000C 103091E5 LDR R3,[R1, #+16]
\ 00000010 00308DE5 STR R3,[SP, #+0]
174 if (spiSr & AT91C_SPI_RXBUFF) {
\ 00000014 00309DE5 LDR R3,[SP, #+0]
\ 00000018 400013E3 TST R3,#0x40
\ 0000001C 1600000A BEQ ??SPID_Handler_0
175
176 // Disable transmitter and receiver
177 WRITE_SPI(pSpiHw, SPI_PTCR, AT91C_PDC_RXTDIS | AT91C_PDC_TXTDIS);
\ 00000020 0230A0E3 MOV R3,#+2
\ 00000024 803F83E3 ORR R3,R3,#0x200
\ 00000028 203181E5 STR R3,[R1, #+288]
178
179 // Disable the SPI clock
180 WRITE_PMC(AT91C_BASE_PMC, PMC_PCDR, (1 << pSpid->spiId));
\ 0000002C 0130A0E3 MOV R3,#+1
\ 00000030 D4C0D0E1 LDRSB R12,[R0, #+4]
\ 00000034 133CA0E1 LSL R3,R3,R12
\ 00000038 EBC0E0E3 MVN R12,#+235
\ 0000003C C0CFCCE3 BIC R12,R12,#0x300
\ 00000040 00308CE5 STR R3,[R12, #+0]
181
182 // Disable buffer complete interrupt
183 WRITE_SPI(pSpiHw, SPI_IDR, AT91C_SPI_RXBUFF);
\ 00000044 4030A0E3 MOV R3,#+64
\ 00000048 183081E5 STR R3,[R1, #+24]
184
185 // Release the dataflash semaphore
186 pSpid->semaphore++;
\ 0000004C 0C10D0E5 LDRB R1,[R0, #+12]
\ 00000050 011081E2 ADD R1,R1,#+1
\ 00000054 0C10C0E5 STRB R1,[R0, #+12]
187
188 // Invoke the callback associated with the current command
189 if (pSpidCmd && pSpidCmd->callback) {
\ 00000058 000052E3 CMP R2,#+0
\ 0000005C 10009215 LDRNE R0,[R2, #+16]
\ 00000060 00005013 CMPNE R0,#+0
\ 00000064 0400000A BEQ ??SPID_Handler_0
190
191 pSpidCmd->callback(0, pSpidCmd->pArgument);
\ 00000068 141092E5 LDR R1,[R2, #+20]
\ 0000006C 0000A0E3 MOV R0,#+0
\ 00000070 102092E5 LDR R2,[R2, #+16]
\ 00000074 0FE0A0E1 MOV LR,PC
\ 00000078 12FF2FE1 BX R2
192 }
193
194 // Nothing must be done after. A new DF operation may have been started
195 // in the callback function.
196 }
197 }
\ ??SPID_Handler_0:
\ 0000007C 0050BDE8 POP {R12,LR}
\ 00000080 1EFF2FE1 BX LR ;; return
198
199 //------------------------------------------------------------------------------
200 /// Returns 1 if the SPI driver is currently busy executing a command; otherwise
201 /// returns 0.
202 /// \param pSpid Pointer to a SPI driver instance.
203 //------------------------------------------------------------------------------
\ In section .text, align 4, keep-with-next
204 unsigned char SPID_IsBusy(const Spid *pSpid)
205 {
206 if (pSpid->semaphore == 0) {
\ SPID_IsBusy:
\ 00000000 0C00D0E5 LDRB R0,[R0, #+12]
\ 00000004 000050E3 CMP R0,#+0
\ 00000008 0000A013 MOVNE R0,#+0
207
208 return 1;
\ 0000000C 0100A003 MOVEQ R0,#+1
\ 00000010 1EFF2FE1 BX LR
209 }
210 else {
211
212 return 0;
213 }
214 }
215
Maximum stack usage in bytes:
Function .cstack
-------- -------
SPID_Configure 0
SPID_ConfigureCS 0
SPID_Handler 8
SPID_IsBusy 0
SPID_SendCommand 8
Section sizes:
Function/Label Bytes
-------------- -----
SPID_Configure 116
SPID_ConfigureCS 16
SPID_SendCommand 204
SPID_Handler 132
SPID_IsBusy 20
488 bytes in section .text
488 bytes of CODE memory
Errors: none
Warnings: none
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -