📄 pio_it.lst
字号:
290 #endif
291 #endif
292
293 #if defined(AT91C_ID_PIOABCDE)
294 // Treat PIOABCDE interrupts
295 #if !defined(AT91C_ID_PIOA) \
296 && !defined(AT91C_ID_PIOB) \
297 && !defined(AT91C_ID_PIOC) \
298 && !defined(AT91C_ID_PIOD) \
299 && !defined(AT91C_ID_PIOE)
300
301 TRACE_DEBUG("PIO_Initialize: Configuring PIOABCDE\n\r");
302 AT91C_BASE_PMC->PMC_PCER = 1 << AT91C_ID_PIOABCDE;
303 AT91C_BASE_PIOA->PIO_ISR;
304 AT91C_BASE_PIOA->PIO_IDR = 0xFFFFFFFF;
305 AIC_ConfigureIT(AT91C_ID_PIOABCDE, priority, InterruptHandler);
306 AIC_EnableIT(AT91C_ID_PIOABCDE);
307 #endif
308 #endif
309
310 #if defined(AT91C_ID_PIOCDE)
311 // Treat PIOCDE interrupts
312 #if !defined(AT91C_ID_PIOC) \
313 && !defined(AT91C_ID_PIOD) \
314 && !defined(AT91C_ID_PIOE)
315
316 TRACE_DEBUG("PIO_Initialize: Configuring PIOC\n\r");
317 AT91C_BASE_PMC->PMC_PCER = 1 << AT91C_ID_PIOCDE;
318 AT91C_BASE_PIOC->PIO_ISR;
319 AT91C_BASE_PIOC->PIO_IDR = 0xFFFFFFFF;
320 AIC_ConfigureIT(AT91C_ID_PIOCDE, priority, InterruptHandler);
321 AIC_EnableIT(AT91C_ID_PIOCDE);
322 #endif
323 #endif
324 }
325
326 //------------------------------------------------------------------------------
327 /// Configures a PIO or a group of PIO to generate an interrupt on status
328 /// change. The provided interrupt handler will be called with the triggering
329 /// pin as its parameter (enabling different pin instances to share the same
330 /// handler).
331 /// \param pPin Pointer to a Pin instance.
332 /// \param handler Interrupt handler function pointer.
333 //------------------------------------------------------------------------------
\ In section .text, align 4, keep-with-next
334 void PIO_ConfigureIt(const Pin *pPin, void (*handler)(const Pin *))
335 {
336 InterruptSource *pSource;
337
338 TRACE_DEBUG("PIO_ConfigureIt()\n\r");
339
340 SANITY_CHECK(pPin);
\ PIO_ConfigureIt:
\ 00000000 000050E3 CMP R0,#+0
\ 00000004 0000001A BNE ??PIO_ConfigureIt_0
\ ??PIO_ConfigureIt_1:
\ 00000008 FEFFFFEA B ??PIO_ConfigureIt_1
341 ASSERT(numSources < MAX_INTERRUPT_SOURCES,
342 "-F- PIO_ConfigureIt: Increase MAX_INTERRUPT_SOURCES\n\r");
\ ??PIO_ConfigureIt_0:
\ 0000000C ........ LDR R2,??DataTable10 ;; numSources
\ 00000010 002092E5 LDR R2,[R2, #+0]
\ 00000014 070052E3 CMP R2,#+7
\ 00000018 0000003A BCC ??PIO_ConfigureIt_2
\ ??PIO_ConfigureIt_3:
\ 0000001C FEFFFFEA B ??PIO_ConfigureIt_3
343
344 // Define new source
345 TRACE_DEBUG("PIO_ConfigureIt: Defining new source #%d.\n\r", numSources);
346
347 pSource = &(pSources[numSources]);
\ ??PIO_ConfigureIt_2:
\ 00000020 ........ LDR R2,??DataTable10 ;; numSources
\ 00000024 002092E5 LDR R2,[R2, #+0]
\ 00000028 ........ LDR R3,??DataTable9 ;; pSources
\ 0000002C 822183E0 ADD R2,R3,R2, LSL #+3
348 pSource->pPin = pPin;
\ 00000030 000082E5 STR R0,[R2, #+0]
349 pSource->handler = handler;
\ 00000034 041082E5 STR R1,[R2, #+4]
350 numSources++;
\ 00000038 ........ LDR R0,??DataTable10 ;; numSources
\ 0000003C 000090E5 LDR R0,[R0, #+0]
\ 00000040 010080E2 ADD R0,R0,#+1
\ 00000044 ........ LDR R1,??DataTable10 ;; numSources
\ 00000048 000081E5 STR R0,[R1, #+0]
351 }
\ 0000004C 1EFF2FE1 BX LR ;; return
352
353 //------------------------------------------------------------------------------
354 /// Enables the given interrupt source if it has been configured. The status
355 /// register of the corresponding PIO controller is cleared prior to enabling
356 /// the interrupt.
357 /// \param pPin Interrupt source to enable.
358 //------------------------------------------------------------------------------
\ In section .text, align 4, keep-with-next
359 void PIO_EnableIt(const Pin *pPin)
360 {
361 TRACE_DEBUG("PIO_EnableIt()\n\r");
362
363 SANITY_CHECK(pPin);
\ PIO_EnableIt:
\ 00000000 000050E3 CMP R0,#+0
\ 00000004 0000001A BNE ??PIO_EnableIt_0
\ ??PIO_EnableIt_1:
\ 00000008 FEFFFFEA B ??PIO_EnableIt_1
364
365 #ifndef NOASSERT
366 unsigned int i = 0;
\ ??PIO_EnableIt_0:
\ 0000000C 0010A0E3 MOV R1,#+0
367 unsigned char found = 0;
\ 00000010 0020A0E3 MOV R2,#+0
\ 00000014 ........ LDR R3,??DataTable10 ;; numSources
\ 00000018 003093E5 LDR R3,[R3, #+0]
\ 0000001C 000053E3 CMP R3,#+0
\ 00000020 0D00000A BEQ ??PIO_EnableIt_2
\ 00000024 ........ LDR R3,??DataTable9 ;; pSources
368 while ((i < numSources) && !found) {
369
370 if (pSources[i].pPin == pPin) {
\ ??PIO_EnableIt_3:
\ 00000028 00C093E5 LDR R12,[R3, #+0]
\ 0000002C 00005CE1 CMP R12,R0
371
372 found = 1;
\ 00000030 0120A003 MOVEQ R2,#+1
373 }
374 i++;
\ 00000034 011081E2 ADD R1,R1,#+1
\ 00000038 083083E2 ADD R3,R3,#+8
375 }
\ 0000003C ........ LDR R12,??DataTable10 ;; numSources
\ 00000040 00C09CE5 LDR R12,[R12, #+0]
\ 00000044 0C0051E1 CMP R1,R12
\ 00000048 0100002A BCS ??PIO_EnableIt_4
\ 0000004C 02C0B0E1 MOVS R12,R2
\ 00000050 F4FFFF0A BEQ ??PIO_EnableIt_3
376 ASSERT(found, "-F- PIO_EnableIt: Interrupt source has not been configured\n\r");
\ ??PIO_EnableIt_4:
\ 00000054 000052E3 CMP R2,#+0
\ 00000058 0000001A BNE ??PIO_EnableIt_5
\ ??PIO_EnableIt_2:
\ 0000005C FEFFFFEA B ??PIO_EnableIt_2
377 #endif
378
379 pPin->pio->PIO_ISR;
\ ??PIO_EnableIt_5:
\ 00000060 041090E5 LDR R1,[R0, #+4]
\ 00000064 4C1091E5 LDR R1,[R1, #+76]
380 pPin->pio->PIO_IER = pPin->mask;
\ 00000068 041090E5 LDR R1,[R0, #+4]
\ 0000006C 000090E5 LDR R0,[R0, #+0]
\ 00000070 400081E5 STR R0,[R1, #+64]
381 }
\ 00000074 1EFF2FE1 BX LR ;; return
382
383 //------------------------------------------------------------------------------
384 /// Disables a given interrupt source, with no added side effects.
385 /// \param pPin Interrupt source to disable.
386 //------------------------------------------------------------------------------
\ In section .text, align 4, keep-with-next
387 void PIO_DisableIt(const Pin *pPin)
388 {
389 SANITY_CHECK(pPin);
\ PIO_DisableIt:
\ 00000000 000050E3 CMP R0,#+0
\ 00000004 0000001A BNE ??PIO_DisableIt_0
\ ??PIO_DisableIt_1:
\ 00000008 FEFFFFEA B ??PIO_DisableIt_1
390
391 TRACE_DEBUG("PIO_DisableIt()\n\r");
392
393 pPin->pio->PIO_IDR = pPin->mask;
\ ??PIO_DisableIt_0:
\ 0000000C 041090E5 LDR R1,[R0, #+4]
\ 00000010 000090E5 LDR R0,[R0, #+0]
\ 00000014 440081E5 STR R0,[R1, #+68]
394 }
\ 00000018 1EFF2FE1 BX LR ;; return
\ In section .text, align 4, keep-with-next
\ ??DataTable9:
\ 00000000 ........ DC32 pSources
\ In section .text, align 4, keep-with-next
\ ??DataTable10:
\ 00000000 ........ DC32 numSources
395
Maximum stack usage in bytes:
Function .cstack
-------- -------
InterruptHandler 0
PIO_ConfigureIt 0
PIO_DisableIt 0
PIO_EnableIt 0
PIO_InitializeInterrupts 0
PioInterruptHandler 0
Section sizes:
Function/Label Bytes
-------------- -----
pSources 56
numSources 4
PioInterruptHandler 136
InterruptHandler 40
PIO_InitializeInterrupts 176
PIO_ConfigureIt 80
PIO_EnableIt 120
PIO_DisableIt 28
??DataTable9 4
??DataTable10 4
60 bytes in section .bss
588 bytes in section .text
588 bytes of CODE memory
60 bytes of DATA memory
Errors: none
Warnings: none
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -