?? main.lst
字號:
258 // Wait for transfer to finish
259 while (AT45_IsBusy(pAt45));
\ ??AT45_GetJedecId_3:
\ 00000068 0400A0E1 MOV R0,R4
\ 0000006C ........ BL AT45_IsBusy
\ 00000070 000050E3 CMP R0,#+0
\ 00000074 FBFFFF1A BNE ??AT45_GetJedecId_3
260
261 return id;
\ 00000078 00009DE5 LDR R0,[SP, #+0]
\ 0000007C 1C40BDE8 POP {R2-R4,LR}
\ 00000080 1EFF2FE1 BX LR ;; return
\ ??AT45_GetJedecId_1:
\ 00000084 ........ DC32 `?<Constant "-F- AT45_GetJedecId: ...">`
\ 00000088 ........ DC32 `?<Constant "-F- AT45_GetJedecId: ...">_1`
262 }
263
264 //------------------------------------------------------------------------------
265 /// Reads data from the At45 inside the provided buffer. Since a continuous
266 /// read command is used, there is no restriction on the buffer size and read
267 /// address.
268 /// \param pAt45 Pointer to a At45 driver instance.
269 /// \param pBuffer Data buffer.
270 /// \param size Number of bytes to read.
271 /// \param address Address at which data shall be read.
272 //------------------------------------------------------------------------------
\ In section .text, align 4, keep-with-next
273 static void AT45_Read(
274 At45 *pAt45,
275 unsigned char *pBuffer,
276 unsigned int size,
277 unsigned int address)
278 {
\ AT45_Read:
\ 00000000 10402DE9 PUSH {R4,LR}
\ 00000004 0040A0E1 MOV R4,R0
\ 00000008 01C0A0E1 MOV R12,R1
279 unsigned char error;
280
281 // Sanity checks
282 ASSERT(pAt45, "-F- AT45_Read: pAt45 is null\n\r");
\ 0000000C 000054E3 CMP R4,#+0
\ 00000010 0400001A BNE ??AT45_Read_0
\ 00000014 ........ LDR R0,??DataTable12 ;; `?<Constant "-F- ASSERT: ">`
\ 00000018 ........ BL printf
\ 0000001C 84009FE5 LDR R0,??AT45_Read_1 ;; `?<Constant "-F- AT45_Read: pAt45 ...">`
\ 00000020 ........ BL printf
\ ??AT45_Read_2:
\ 00000024 FEFFFFEA B ??AT45_Read_2
283 ASSERT(pBuffer, "-F- AT45_Read: pBuffer is null\n\r");
\ ??AT45_Read_0:
\ 00000028 00005CE3 CMP R12,#+0
\ 0000002C 0400001A BNE ??AT45_Read_3
\ 00000030 ........ LDR R0,??DataTable12 ;; `?<Constant "-F- ASSERT: ">`
\ 00000034 ........ BL printf
\ 00000038 6C009FE5 LDR R0,??AT45_Read_1+0x4 ;; `?<Constant "-F- AT45_Read: pBuffe...">`
\ 0000003C ........ BL printf
\ ??AT45_Read_4:
\ 00000040 FEFFFFEA B ??AT45_Read_4
284
285 // Issue a continuous read array command
286 error = AT45_SendCommand(pAt45, AT45_CONTINUOUS_READ_LEG, 8, pBuffer, size, address, 0, 0);
\ ??AT45_Read_3:
\ 00000044 0010A0E3 MOV R1,#+0
\ 00000048 0000A0E3 MOV R0,#+0
\ 0000004C 03002DE9 PUSH {R0,R1}
\ 00000050 0310A0E1 MOV R1,R3
\ 00000054 0200A0E1 MOV R0,R2
\ 00000058 03002DE9 PUSH {R0,R1}
\ 0000005C 0C30A0E1 MOV R3,R12
\ 00000060 0820A0E3 MOV R2,#+8
\ 00000064 E810A0E3 MOV R1,#+232
\ 00000068 0400A0E1 MOV R0,R4
\ 0000006C ........ BL AT45_SendCommand
\ 00000070 10D08DE2 ADD SP,SP,#+16 ;; stack cleaning
287 ASSERT(!error, "-F- AT45_Read: Failed to issue command\n\r");
\ 00000074 000050E3 CMP R0,#+0
\ 00000078 0400000A BEQ ??AT45_Read_5
\ 0000007C ........ LDR R0,??DataTable12 ;; `?<Constant "-F- ASSERT: ">`
\ 00000080 ........ BL printf
\ 00000084 24009FE5 LDR R0,??AT45_Read_1+0x8 ;; `?<Constant "-F- AT45_Read: Failed...">`
\ 00000088 ........ BL printf
\ ??AT45_Read_6:
\ 0000008C FEFFFFEA B ??AT45_Read_6
288
289 // Wait for the read command to execute
290 while (AT45_IsBusy(pAt45));
\ ??AT45_Read_5:
\ 00000090 0400A0E1 MOV R0,R4
\ 00000094 ........ BL AT45_IsBusy
\ 00000098 000050E3 CMP R0,#+0
\ 0000009C FBFFFF1A BNE ??AT45_Read_5
291 }
\ 000000A0 1040BDE8 POP {R4,LR}
\ 000000A4 1EFF2FE1 BX LR ;; return
\ ??AT45_Read_1:
\ 000000A8 ........ DC32 `?<Constant "-F- AT45_Read: pAt45 ...">`
\ 000000AC ........ DC32 `?<Constant "-F- AT45_Read: pBuffe...">`
\ 000000B0 ........ DC32 `?<Constant "-F- AT45_Read: Failed...">`
292
293 //------------------------------------------------------------------------------
294 /// Writes data on the At45 at the specified address. Only one page of
295 /// data is written that way; if the address is not at the beginning of the
296 /// page, the data is written starting from this address and wraps around to
297 /// the beginning of the page.
298 /// \param pAt45 Pointer to a At45 driver instance.
299 /// \param pBuffer Buffer containing the data to write.
300 /// \param size Number of bytes to write.
301 /// \param address Destination address on the At45.
302 //------------------------------------------------------------------------------
\ In section .text, align 4, keep-with-next
303 static void AT45_Write(
304 At45 *pAt45,
305 unsigned char *pBuffer,
306 unsigned int size,
307 unsigned int address)
308 {
\ AT45_Write:
\ 00000000 10402DE9 PUSH {R4,LR}
\ 00000004 0040A0E1 MOV R4,R0
\ 00000008 01C0A0E1 MOV R12,R1
309 unsigned char error;
310
311 // Sanity checks
312 ASSERT(pAt45, "-F- AT45_Write: pAt45 is null.\n\r");
\ 0000000C 000054E3 CMP R4,#+0
\ 00000010 0400001A BNE ??AT45_Write_0
\ 00000014 ........ LDR R0,??DataTable12 ;; `?<Constant "-F- ASSERT: ">`
\ 00000018 ........ BL printf
\ 0000001C AC009FE5 LDR R0,??AT45_Write_1 ;; `?<Constant "-F- AT45_Write: pAt45...">`
\ 00000020 ........ BL printf
\ ??AT45_Write_2:
\ 00000024 FEFFFFEA B ??AT45_Write_2
313 ASSERT(pBuffer, "-F- AT45_Write: pBuffer is null.\n\r");
\ ??AT45_Write_0:
\ 00000028 00005CE3 CMP R12,#+0
\ 0000002C 0400001A BNE ??AT45_Write_3
\ 00000030 ........ LDR R0,??DataTable12 ;; `?<Constant "-F- ASSERT: ">`
\ 00000034 ........ BL printf
\ 00000038 94009FE5 LDR R0,??AT45_Write_1+0x4 ;; `?<Constant "-F- AT45_Write: pBuff...">`
\ 0000003C ........ BL printf
\ ??AT45_Write_4:
\ 00000040 FEFFFFEA B ??AT45_Write_4
314 ASSERT(size <= pAt45->pDesc->pageSize, "-F- AT45_Write: Size too big\n\r");
\ ??AT45_Write_3:
\ 00000044 1C0094E5 LDR R0,[R4, #+28]
\ 00000048 080090E5 LDR R0,[R0, #+8]
\ 0000004C 020050E1 CMP R0,R2
\ 00000050 0400002A BCS ??AT45_Write_5
\ 00000054 ........ LDR R0,??DataTable12 ;; `?<Constant "-F- ASSERT: ">`
\ 00000058 ........ BL printf
\ 0000005C 74009FE5 LDR R0,??AT45_Write_1+0x8 ;; `?<Constant "-F- AT45_Write: Size ...">`
\ 00000060 ........ BL printf
\ ??AT45_Write_6:
\ 00000064 FEFFFFEA B ??AT45_Write_6
315
316 // Issue a page write through buffer 1 command
317 error = AT45_SendCommand(pAt45, AT45_PAGE_WRITE_BUF1, 4, pBuffer, size, address, 0, 0);
\ ??AT45_Write_5:
\ 00000068 0010A0E3 MOV R1,#+0
\ 0000006C 0000A0E3 MOV R0,#+0
\ 00000070 03002DE9 PUSH {R0,R1}
\ 00000074 0310A0E1 MOV R1,R3
\ 00000078 0200A0E1 MOV R0,R2
\ 0000007C 03002DE9 PUSH {R0,R1}
\ 00000080 0C30A0E1 MOV R3,R12
\ 00000084 0420A0E3 MOV R2,#+4
\ 00000088 8210A0E3 MOV R1,#+130
\ 0000008C 0400A0E1 MOV R0,R4
\ 00000090 ........ BL AT45_SendCommand
\ 00000094 10D08DE2 ADD SP,SP,#+16 ;; stack cleaning
318 ASSERT(!error, "-F- AT45_Write: Could not issue command.\n\r");
\ 00000098 000050E3 CMP R0,#+0
\ 0000009C 0400000A BEQ ??AT45_Write_7
\ 000000A0 ........ LDR R0,??DataTable12 ;; `?<Constant "-F- ASSERT: ">`
\ 000000A4 ........ BL printf
\ 000000A8 2C009FE5 LDR R0,??AT45_Write_1+0xC ;; `?<Constant "-F- AT45_Write: Could...">`
\ 000000AC ........ BL printf
\ ??AT45_Write_8:
\ 000000B0 FEFFFFEA B ??AT45_Write_8
319
320 // Wait until the command is sent
321 while (AT45_IsBusy(pAt45));
\ ??AT45_Write_7:
\ 000000B4 0400A0E1 MOV R0,R4
\ 000000B8 ........ BL AT45_IsBusy
\ 000000BC 000050E3 CMP R0,#+0
\ 000000C0 FBFFFF1A BNE ??AT45_Write_7
322
323 // Wait until the At45 becomes ready again
324 AT45_WaitReady(pAt45);
\ 000000C4 0400A0E1 MOV R0,R4
325 }
\ 000000C8 1040BDE8 POP {R4,LR}
\ 000000CC ........ B AT45_WaitReady ;; tailcall
\ ??AT45_Write_1:
\ 000000D0 ........ DC32 `?<Constant "-F- AT45_Write: pAt45...">`
\ 000000D4 ........ DC32 `?<Constant "-F- AT45_Write: pBuff...">`
\ 000000D8 ........ DC32 `?<Constant "-F- AT45_Write: Size ...">`
\ 000000DC ........ DC32 `?<Constant "-F- AT45_Write: Could...">`
326
327 //------------------------------------------------------------------------------
328 /// Erases a page of data at the given address in the At45.
329 /// \param pAt45 Pointer to a At45 driver instance.
330 /// \param address Address of page to erase.
331 //------------------------------------------------------------------------------
332 static void AT45_Erase(At45 *pAt45, unsigned int address)
333 {
335
336 // Sanity checks
337 ASSERT(pAt45, "-F- AT45_Erase: pAt45 is null\n\r");
338
339 // Issue a page erase command.
340 error = AT45_SendCommand(pAt45, AT45_PAGE_ERASE, 4, 0, 0, address, 0, 0);
341 ASSERT(!error, "-F- AT45_Erase: Could not issue command.\n\r");
342
343 // Wait for end of transfer
344 while (AT45_IsBusy(pAt45));
345
346 // Poll until the At45 has completed the erase operation
347 AT45_WaitReady(pAt45);
348 }
349
350 //------------------------------------------------------------------------------
351 // Exported functions
352 //------------------------------------------------------------------------------
353 //my functions ****************************************************************
354 /*
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -