📄 stm32f10x_spi.lst
字号:
\ 0000000A 00BD POP {PC}
517 }
518 else
519 {
520 /* SPI_FLAG is reset */
521 bitstatus = RESET;
\ ??SPI_GetFlagStatus_0:
\ 0000000C 0020 MOVS R0,#+0
522 }
523 /* Return the SPI_FLAG status */
524 return bitstatus;
\ 0000000E 00BD POP {PC} ;; return
525 }
526
527 /*******************************************************************************
528 * Function Name : SPI_ClearFlag
529 * Description : Clears the SPIx's pending flags.
530 * Input : - SPIx: where x can be 1 or 2 to select the SPI peripheral.
531 * - SPI_FLAG: specifies the flag to clear.
532 * This parameter can be any combination of the following values:
533 * - SPI_FLAG_OVR: Overrun flag.
534 * - SPI_FLAG_MODF: Mode Fault flag.
535 * - SPI_FLAG_CRCERR: CRC Error flag.
536 * Output : None
537 * Return : None
538 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
539 void SPI_ClearFlag(SPI_TypeDef* SPIx, u16 SPI_FLAG)
540 {
541 /* Check the parameters */
542 assert(IS_SPI_CLEAR_FLAG(SPI_FLAG));
543
544 /* SPI_FLAG_MODF flag clear */
545 if(SPI_FLAG == SPI_FLAG_MODF)
\ SPI_ClearFlag:
\ 00000000 2029 CMP R1,#+32
\ 00000002 05D1 BNE.N ??SPI_ClearFlag_0
546 {
547 /* Read SR register */
548 (void)SPIx->SR;
\ 00000004 0189 LDRH R1,[R0, #+8]
549 /* Write on CR1 register */
550 SPIx->CR1 |= CR1_SPE_Set;
\ 00000006 0188 LDRH R1,[R0, #+0]
\ 00000008 51F04001 ORRS R1,R1,#0x40
\ 0000000C 0180 STRH R1,[R0, #+0]
\ 0000000E 7047 BX LR
551 }
552 /* SPI_FLAG_OVR flag clear */
553 else if(SPI_FLAG == SPI_FLAG_OVR)
\ ??SPI_ClearFlag_0:
\ 00000010 4029 CMP R1,#+64
\ 00000012 01D1 BNE.N ??SPI_ClearFlag_1
554 {
555 /* Read SR register */
556 (void)SPIx->SR;
\ 00000014 0089 LDRH R0,[R0, #+8]
\ 00000016 7047 BX LR
557 }
558 else /* SPI_FLAG_CRCERR flag clear */
559 {
560 /* Clear the selected SPI flag */
561 SPIx->SR &= (u16)~SPI_FLAG;
\ ??SPI_ClearFlag_1:
\ 00000018 0289 LDRH R2,[R0, #+8]
\ 0000001A 8A43 BICS R2,R2,R1
\ 0000001C 0281 STRH R2,[R0, #+8]
562 }
563 }
\ 0000001E 7047 BX LR ;; return
564
565 /*******************************************************************************
566 * Function Name : SPI_GetITStatus
567 * Description : Checks whether the specified SPI interrupt has occurred or not.
568 * Input : - SPIx: where x can be 1 or 2 to select the SPI peripheral.
569 * - SPI_IT: specifies the SPI interrupt source to check.
570 * This parameter can be one of the following values:
571 * - SPI_IT_OVR: Overrun interrupt.
572 * - SPI_IT_MODF: Mode Fault interrupt.
573 * - SPI_IT_CRCERR: CRC Error interrupt.
574 * - SPI_IT_TXE: Transmit buffer empty interrupt.
575 * - SPI_IT_RXNE: Receive buffer not empty interrupt.
576 * Output : None
577 * Return : The new state of SPI_IT (SET or RESET).
578 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
579 ITStatus SPI_GetITStatus(SPI_TypeDef* SPIx, u8 SPI_IT)
580 {
\ SPI_GetITStatus:
\ 00000000 10B5 PUSH {R4,LR}
581 ITStatus bitstatus = RESET;
582 u16 itpos = 0, itmask = 0, enablestatus = 0;
583
584 /* Check the parameters */
585 assert(IS_SPI_GET_IT(SPI_IT));
586
587 /* Get the SPI IT index */
588 itpos = (u16)((u16)0x01 << (SPI_IT & (u8)0x0F));
589
590 /* Get the SPI IT index */
591 itmask = SPI_IT >> 4;
592 /* Set the IT mask */
593 itmask = (u16)((u16)0x01 << itmask);
594 /* Get the SPI_IT enable bit status */
595 enablestatus = (SPIx->CR2 & itmask) ;
\ 00000002 8388 LDRH R3,[R0, #+4]
\ 00000004 0122 MOVS R2,#+1
\ 00000006 0C00 MOVS R4,R1
\ 00000008 2409 LSRS R4,R4,#+4
\ 0000000A A240 LSLS R2,R2,R4
\ 0000000C 1A40 ANDS R2,R2,R3
596
597 /* Check the status of the specified SPI interrupt */
598 if (((SPIx->SR & itpos) != (u16)RESET) && enablestatus)
\ 0000000E 0089 LDRH R0,[R0, #+8]
\ 00000010 0123 MOVS R3,#+1
\ 00000012 0907 LSLS R1,R1,#+28
\ 00000014 090F LSRS R1,R1,#+28
\ 00000016 8B40 LSLS R3,R3,R1
\ 00000018 1842 TST R0,R3
\ 0000001A 03D0 BEQ.N ??SPI_GetITStatus_0
\ 0000001C 002A CMP R2,#+0
\ 0000001E 01D0 BEQ.N ??SPI_GetITStatus_0
599 {
600 /* SPI_IT is set */
601 bitstatus = SET;
\ 00000020 0120 MOVS R0,#+1
\ 00000022 10BD POP {R4,PC}
602 }
603 else
604 {
605 /* SPI_IT is reset */
606 bitstatus = RESET;
\ ??SPI_GetITStatus_0:
\ 00000024 0020 MOVS R0,#+0
607 }
608 /* Return the SPI_IT status */
609 return bitstatus;
\ 00000026 10BD POP {R4,PC} ;; return
610 }
611
612 /*******************************************************************************
613 * Function Name : SPI_ClearITPendingBit
614 * Description : Clears the SPIx抯 interrupt pending bits.
615 * Input : - SPIx: where x can be 1 or 2 to select the SPI peripheral.
616 * - SPI_IT: specifies the SPI interrupt pending bit to clear.
617 * This parameter can be one of the following values:
618 * - SPI_IT_OVR: Overrun interrupt.
619 * - SPI_IT_MODF: Mode Fault interrupt.
620 * - SPI_IT_CRCERR: CRC Error interrupt.
621 * Output : None
622 * Return : None
623 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
624 void SPI_ClearITPendingBit(SPI_TypeDef* SPIx, u8 SPI_IT)
625 {
626 u16 itpos = 0;
627
628 /* Check the parameters */
629 assert(IS_SPI_CLEAR_IT(SPI_IT));
630
631 /* SPI_IT_MODF pending bit clear */
632 if(SPI_IT == SPI_IT_MODF)
\ SPI_ClearITPendingBit:
\ 00000000 5529 CMP R1,#+85
\ 00000002 05D1 BNE.N ??SPI_ClearITPendingBit_0
633 {
634 /* Read SR register */
635 (void)SPIx->SR;
\ 00000004 0189 LDRH R1,[R0, #+8]
636 /* Write on CR1 register */
637 SPIx->CR1 |= CR1_SPE_Set;
\ 00000006 0188 LDRH R1,[R0, #+0]
\ 00000008 51F04001 ORRS R1,R1,#0x40
\ 0000000C 0180 STRH R1,[R0, #+0]
\ 0000000E 7047 BX LR
638 }
639 else if(SPI_IT == SPI_IT_OVR) /* SPI_IT_OVR pending bit clear */
\ ??SPI_ClearITPendingBit_0:
\ 00000010 5629 CMP R1,#+86
\ 00000012 01D1 BNE.N ??SPI_ClearITPendingBit_1
640 {
641 /* Read SR register */
642 (void)(SPIx->SR);
\ 00000014 0089 LDRH R0,[R0, #+8]
\ 00000016 7047 BX LR
643 }
644 else /* SPI_IT_CRCERR pending bit clear */
645 {
646 /* Get the SPI IT index */
647 itpos = (u16)((u16)0x01 << (SPI_IT & (u8)0x0F));
648 /* Clear the selected SPI interrupt pending bits */
649 SPIx->SR &= (u16)~itpos;
\ ??SPI_ClearITPendingBit_1:
\ 00000018 0289 LDRH R2,[R0, #+8]
\ 0000001A 0123 MOVS R3,#+1
\ 0000001C 0907 LSLS R1,R1,#+28
\ 0000001E 090F LSRS R1,R1,#+28
\ 00000020 8B40 LSLS R3,R3,R1
\ 00000022 9A43 BICS R2,R2,R3
\ 00000024 0281 STRH R2,[R0, #+8]
650 }
651 }
\ 00000026 7047 BX LR ;; return
652
653 /******************* (C) COPYRIGHT 2007 STMicroelectronics *****END OF FILE****/
Maximum stack usage in bytes:
Function CSTACK
-------- ------
SPI_BiDirectionalLineConfig 0
SPI_CalculateCRC 0
SPI_ClearFlag 0
SPI_ClearITPendingBit 0
SPI_Cmd 0
SPI_DMACmd 0
SPI_DataSizeConfig 0
SPI_DeInit 4
SPI_GetCRC 0
SPI_GetCRCPolynomial 0
SPI_GetFlagStatus 4
SPI_GetITStatus 8
SPI_ITConfig 0
SPI_Init 0
SPI_NSSInternalSoftwareConfig 0
SPI_ReceiveData 0
SPI_SSOutputCmd 0
SPI_SendData 0
SPI_StructInit 0
SPI_TransmitCRC 0
Segment part sizes:
Function/Label Bytes
-------------- -----
SPI_DeInit 64
SPI_Init 46
SPI_StructInit 24
SPI_Cmd 28
SPI_ITConfig 26
SPI_DMACmd 18
SPI_SendData 4
SPI_ReceiveData 4
SPI_NSSInternalSoftwareConfig 28
SPI_SSOutputCmd 28
SPI_DataSizeConfig 20
SPI_TransmitCRC 10
SPI_CalculateCRC 28
SPI_GetCRC 12
SPI_GetCRCPolynomial 4
SPI_BiDirectionalLineConfig 32
SPI_GetFlagStatus 16
SPI_ClearFlag 32
SPI_GetITStatus 40
SPI_ClearITPendingBit 40
Others 16
520 bytes in segment CODE
504 bytes of CODE memory (+ 16 bytes shared)
Errors: none
Warnings: none
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -