📄 stm32f10x_spi.lst
字号:
563 * Input : - SPIx: where x can be 1 or 2 to select the SPI peripheral.
564 * - SPI_IT: specifies the SPI interrupt source to check.
565 * This parameter can be one of the following values:
566 * - SPI_IT_OVR: Overrun interrupt.
567 * - SPI_IT_MODF: Mode Fault interrupt.
568 * - SPI_IT_CRCERR: CRC Error interrupt.
569 * - SPI_IT_TXE: Transmit buffer empty interrupt.
570 * - SPI_IT_RXNE: Receive buffer not empty interrupt.
571 * Output : None
572 * Return : The new state of SPI_IT (SET or RESET).
573 *******************************************************************************/
\ In section .XML, align 4, keep-with-next
574 ITStatus SPI_GetITStatus(SPI_TypeDef* SPIx, u8 SPI_IT)
575 {
\ SPI_GetITStatus:
\ 00000000 F1B5 PUSH {R0,R4-R7,LR}
\ 00000002 0300 MOVS R3,R0
576 ITStatus bitstatus = RESET;
\ 00000004 0022 MOVS R2,#+0
\ 00000006 1000 MOVS R0,R2
577 u16 itpos = 0, itmask = 0, enablestatus = 0;
\ 00000008 0022 MOVS R2,#+0
\ 0000000A 1400 MOVS R4,R2
\ 0000000C 0022 MOVS R2,#+0
\ 0000000E 1500 MOVS R5,R2
\ 00000010 0022 MOVS R2,#+0
\ 00000012 1600 MOVS R6,R2
578
579 /* Check the parameters */
580 assert_param(IS_SPI_GET_IT(SPI_IT));
581
582 /* Get the SPI IT index */
583 itpos = (u16)((u16)0x01 << (SPI_IT & (u8)0x0F));
\ 00000014 0122 MOVS R2,#+1
\ 00000016 0F07 LSLS R7,R1,#+28 ;; ZeroExtS R7,R1,#+28,#+28
\ 00000018 3F0F LSRS R7,R7,#+28
\ 0000001A BA40 LSLS R2,R2,R7
\ 0000001C 1400 MOVS R4,R2
584
585 /* Get the SPI IT index */
586 itmask = SPI_IT >> 4;
\ 0000001E C9B2 UXTB R1,R1 ;; ZeroExtS R1,R1,#+24,#+24
\ 00000020 0A09 LSRS R2,R1,#+4
\ 00000022 D2B2 UXTB R2,R2 ;; ZeroExtS R2,R2,#+24,#+24
\ 00000024 1500 MOVS R5,R2
587 /* Set the IT mask */
588 itmask = (u16)((u16)0x01 << itmask);
\ 00000026 0127 MOVS R7,#+1
\ 00000028 2A00 MOVS R2,R5
\ 0000002A 3D00 MOVS R5,R7
\ 0000002C 9540 LSLS R5,R5,R2
589 /* Get the SPI_IT enable bit status */
590 enablestatus = (SPIx->CR2 & itmask) ;
\ 0000002E 9A88 LDRH R2,[R3, #+4]
\ 00000030 2A40 ANDS R2,R2,R5
\ 00000032 1600 MOVS R6,R2
591
592 /* Check the status of the specified SPI interrupt */
593 if (((SPIx->SR & itpos) != (u16)RESET) && enablestatus)
\ 00000034 1A89 LDRH R2,[R3, #+8]
\ 00000036 2242 TST R2,R4
\ 00000038 06D0 BEQ.N ??SPI_GetITStatus_0
\ 0000003A 3000 MOVS R0,R6
\ 0000003C 80B2 UXTH R0,R0 ;; ZeroExtS R0,R0,#+16,#+16
\ 0000003E 401E SUBS R0,R0,#+1
\ 00000040 8041 SBCS R0,R0,R0
\ 00000042 C043 MVNS R0,R0
\ 00000044 C00F LSRS R0,R0,#+31
\ 00000046 01E0 B.N ??SPI_GetITStatus_1
594 {
595 /* SPI_IT is set */
596 bitstatus = SET;
597 }
598 else
599 {
600 /* SPI_IT is reset */
601 bitstatus = RESET;
\ ??SPI_GetITStatus_0:
\ 00000048 0022 MOVS R2,#+0
\ 0000004A 1000 MOVS R0,R2
602 }
603 /* Return the SPI_IT status */
604 return bitstatus;
\ ??SPI_GetITStatus_1:
\ 0000004C C0B2 UXTB R0,R0 ;; ZeroExtS R0,R0,#+24,#+24
\ 0000004E 01B0 ADD SP,SP,#+4
\ 00000050 F0BD POP {R4-R7,PC} ;; return
605 }
606
607 /*******************************************************************************
608 * Function Name : SPI_ClearITPendingBit
609 * Description : Clears the SPIx抯 interrupt pending bits.
610 * Input : - SPIx: where x can be 1 or 2 to select the SPI peripheral.
611 * - SPI_IT: specifies the SPI interrupt pending bit to clear.
612 * This parameter can be one of the following values:
613 * - SPI_IT_OVR: Overrun interrupt.
614 * - SPI_IT_MODF: Mode Fault interrupt.
615 * - SPI_IT_CRCERR: CRC Error interrupt.
616 * Output : None
617 * Return : None
618 *******************************************************************************/
\ In section .XML, align 4, keep-with-next
619 void SPI_ClearITPendingBit(SPI_TypeDef* SPIx, u8 SPI_IT)
620 {
\ SPI_ClearITPendingBit:
\ 00000000 11B4 PUSH {R0,R4}
621 u16 itpos = 0;
\ 00000002 0023 MOVS R3,#+0
\ 00000004 1A00 MOVS R2,R3
622
623 /* Check the parameters */
624 assert_param(IS_SPI_CLEAR_IT(SPI_IT));
625
626 /* SPI_IT_MODF pending bit clear */
627 if(SPI_IT == SPI_IT_MODF)
\ 00000006 C9B2 UXTB R1,R1 ;; ZeroExtS R1,R1,#+24,#+24
\ 00000008 5529 CMP R1,#+85
\ 0000000A 05D1 BNE.N ??SPI_ClearITPendingBit_0
628 {
629 /* Read SR register */
630 (void)SPIx->SR;
\ 0000000C 0389 LDRH R3,[R0, #+8]
631 /* Write on CR1 register */
632 SPIx->CR1 |= CR1_SPE_Set;
\ 0000000E 0488 LDRH R4,[R0, #+0]
\ 00000010 54F04004 ORRS R4,R4,#0x40
\ 00000014 0480 STRH R4,[R0, #+0]
\ 00000016 0CE0 B.N ??SPI_ClearITPendingBit_1
633 }
634 else if(SPI_IT == SPI_IT_OVR) /* SPI_IT_OVR pending bit clear */
\ ??SPI_ClearITPendingBit_0:
\ 00000018 C9B2 UXTB R1,R1 ;; ZeroExtS R1,R1,#+24,#+24
\ 0000001A 5629 CMP R1,#+86
\ 0000001C 01D1 BNE.N ??SPI_ClearITPendingBit_2
635 {
636 /* Read SR register */
637 (void)(SPIx->SR);
\ 0000001E 0389 LDRH R3,[R0, #+8]
\ 00000020 07E0 B.N ??SPI_ClearITPendingBit_1
638 }
639 else /* SPI_IT_CRCERR pending bit clear */
640 {
641 /* Get the SPI IT index */
642 itpos = (u16)((u16)0x01 << (SPI_IT & (u8)0x0F));
\ ??SPI_ClearITPendingBit_2:
\ 00000022 0123 MOVS R3,#+1
\ 00000024 0C07 LSLS R4,R1,#+28 ;; ZeroExtS R4,R1,#+28,#+28
\ 00000026 240F LSRS R4,R4,#+28
\ 00000028 A340 LSLS R3,R3,R4
\ 0000002A 1A00 MOVS R2,R3
643 /* Clear the selected SPI interrupt pending bits */
644 SPIx->SR &= (u16)~itpos;
\ 0000002C 0389 LDRH R3,[R0, #+8]
\ 0000002E 9343 BICS R3,R3,R2
\ 00000030 0381 STRH R3,[R0, #+8]
645 }
646 }
\ ??SPI_ClearITPendingBit_1:
\ 00000032 01B0 ADD SP,SP,#+4
\ 00000034 10BC POP {R4}
\ 00000036 7047 BX LR ;; return
647
648 /******************* (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 8
SPI_Cmd 0
SPI_DMACmd 0
SPI_DataSizeConfig 0
SPI_DeInit 8
SPI_GetCRC 0
SPI_GetCRCPolynomial 0
SPI_GetFlagStatus 8
SPI_GetITStatus 24
SPI_ITConfig 8
SPI_Init 8
SPI_NSSInternalSoftwareConfig 0
SPI_ReceiveData 0
SPI_SSOutputCmd 0
SPI_SendData 0
SPI_StructInit 0
SPI_TransmitCRC 0
Section sizes:
Function/Label Bytes
-------------- -----
SPI_DeInit 68
SPI_Init 58
SPI_StructInit 38
SPI_Cmd 32
SPI_ITConfig 48
SPI_DMACmd 22
SPI_SendData 4
SPI_ReceiveData 4
SPI_NSSInternalSoftwareConfig 32
SPI_SSOutputCmd 32
SPI_DataSizeConfig 20
SPI_TransmitCRC 10
SPI_CalculateCRC 32
SPI_GetCRC 26
SPI_GetCRCPolynomial 4
SPI_BiDirectionalLineConfig 36
SPI_GetFlagStatus 34
SPI_ClearFlag 36
SPI_GetITStatus 82
SPI_ClearITPendingBit 56
674 bytes in section .XML
674 bytes of CODE memory
Errors: none
Warnings: none
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -