📄 stm32f10x_spi.lst
字号:
583 assert_param(IS_SPI_ALL_PERIPH(SPIx));
584 assert_param(IS_SPI_NSS_INTERNAL(SPI_NSSInternalSoft));
585 if (SPI_NSSInternalSoft != SPI_NSSInternalSoft_Reset)
\ SPI_NSSInternalSoftwareConfig:
\ 00000000 4FF6FF62 MOVW R2,#+65279
\ 00000004 89B2 UXTH R1,R1 ;; ZeroExt R1,R1,#+16,#+16
\ 00000006 9142 CMP R1,R2
\ 00000008 05D0 BEQ.N ??SPI_NSSInternalSoftwareConfig_0
586 {
587 /* Set NSS pin internally by software */
588 SPIx->CR1 |= SPI_NSSInternalSoft_Set;
\ 0000000A 0288 LDRH R2,[R0, #+0]
\ 0000000C 4FF48073 MOV R3,#+256
\ 00000010 1A43 ORRS R2,R3,R2
\ 00000012 0280 STRH R2,[R0, #+0]
\ 00000014 04E0 B.N ??SPI_NSSInternalSoftwareConfig_1
589 }
590 else
591 {
592 /* Reset NSS pin internally by software */
593 SPIx->CR1 &= SPI_NSSInternalSoft_Reset;
\ ??SPI_NSSInternalSoftwareConfig_0:
\ 00000016 0288 LDRH R2,[R0, #+0]
\ 00000018 4FF6FF63 MOVW R3,#+65279
\ 0000001C 1A40 ANDS R2,R3,R2
\ 0000001E 0280 STRH R2,[R0, #+0]
594 }
595 }
\ ??SPI_NSSInternalSoftwareConfig_1:
\ 00000020 7047 BX LR ;; return
596
597 /**
598 * @brief Enables or disables the SS output for the selected SPI.
599 * @param SPIx: where x can be 1, 2 or 3 to select the SPI peripheral.
600 * @param NewState: new state of the SPIx SS output.
601 * This parameter can be: ENABLE or DISABLE.
602 * @retval None
603 */
\ In section .text, align 2, keep-with-next
604 void SPI_SSOutputCmd(SPI_TypeDef* SPIx, FunctionalState NewState)
605 {
606 /* Check the parameters */
607 assert_param(IS_SPI_ALL_PERIPH(SPIx));
608 assert_param(IS_FUNCTIONAL_STATE(NewState));
609 if (NewState != DISABLE)
\ SPI_SSOutputCmd:
\ 00000000 C9B2 UXTB R1,R1 ;; ZeroExt R1,R1,#+24,#+24
\ 00000002 0029 CMP R1,#+0
\ 00000004 04D0 BEQ.N ??SPI_SSOutputCmd_0
610 {
611 /* Enable the selected SPI SS output */
612 SPIx->CR2 |= CR2_SSOE_Set;
\ 00000006 8288 LDRH R2,[R0, #+4]
\ 00000008 52F00402 ORRS R2,R2,#0x4
\ 0000000C 8280 STRH R2,[R0, #+4]
\ 0000000E 04E0 B.N ??SPI_SSOutputCmd_1
613 }
614 else
615 {
616 /* Disable the selected SPI SS output */
617 SPIx->CR2 &= CR2_SSOE_Reset;
\ ??SPI_SSOutputCmd_0:
\ 00000010 8288 LDRH R2,[R0, #+4]
\ 00000012 4FF6FB73 MOVW R3,#+65531
\ 00000016 1A40 ANDS R2,R3,R2
\ 00000018 8280 STRH R2,[R0, #+4]
618 }
619 }
\ ??SPI_SSOutputCmd_1:
\ 0000001A 7047 BX LR ;; return
620
621 /**
622 * @brief Configures the data size for the selected SPI.
623 * @param SPIx: where x can be 1, 2 or 3 to select the SPI peripheral.
624 * @param SPI_DataSize: specifies the SPI data size.
625 * This parameter can be one of the following values:
626 * @arg SPI_DataSize_16b: Set data frame format to 16bit
627 * @arg SPI_DataSize_8b: Set data frame format to 8bit
628 * @retval None
629 */
\ In section .text, align 2, keep-with-next
630 void SPI_DataSizeConfig(SPI_TypeDef* SPIx, uint16_t SPI_DataSize)
631 {
632 /* Check the parameters */
633 assert_param(IS_SPI_ALL_PERIPH(SPIx));
634 assert_param(IS_SPI_DATASIZE(SPI_DataSize));
635 /* Clear DFF bit */
636 SPIx->CR1 &= (uint16_t)~SPI_DataSize_16b;
\ SPI_DataSizeConfig:
\ 00000000 0288 LDRH R2,[R0, #+0]
\ 00000002 4FF2FF73 MOVW R3,#+63487
\ 00000006 1A40 ANDS R2,R3,R2
\ 00000008 0280 STRH R2,[R0, #+0]
637 /* Set new DFF bit value */
638 SPIx->CR1 |= SPI_DataSize;
\ 0000000A 0288 LDRH R2,[R0, #+0]
\ 0000000C 0A43 ORRS R2,R1,R2
\ 0000000E 0280 STRH R2,[R0, #+0]
639 }
\ 00000010 7047 BX LR ;; return
640
641 /**
642 * @brief Transmit the SPIx CRC value.
643 * @param SPIx: where x can be 1, 2 or 3 to select the SPI peripheral.
644 * @retval None
645 */
\ In section .text, align 2, keep-with-next
646 void SPI_TransmitCRC(SPI_TypeDef* SPIx)
647 {
648 /* Check the parameters */
649 assert_param(IS_SPI_ALL_PERIPH(SPIx));
650
651 /* Enable the selected SPI CRC transmission */
652 SPIx->CR1 |= CR1_CRCNext_Set;
\ SPI_TransmitCRC:
\ 00000000 0188 LDRH R1,[R0, #+0]
\ 00000002 51F48051 ORRS R1,R1,#0x1000
\ 00000006 0180 STRH R1,[R0, #+0]
653 }
\ 00000008 7047 BX LR ;; return
654
655 /**
656 * @brief Enables or disables the CRC value calculation of the transfered bytes.
657 * @param SPIx: where x can be 1, 2 or 3 to select the SPI peripheral.
658 * @param NewState: new state of the SPIx CRC value calculation.
659 * This parameter can be: ENABLE or DISABLE.
660 * @retval None
661 */
\ In section .text, align 2, keep-with-next
662 void SPI_CalculateCRC(SPI_TypeDef* SPIx, FunctionalState NewState)
663 {
664 /* Check the parameters */
665 assert_param(IS_SPI_ALL_PERIPH(SPIx));
666 assert_param(IS_FUNCTIONAL_STATE(NewState));
667 if (NewState != DISABLE)
\ SPI_CalculateCRC:
\ 00000000 C9B2 UXTB R1,R1 ;; ZeroExt R1,R1,#+24,#+24
\ 00000002 0029 CMP R1,#+0
\ 00000004 04D0 BEQ.N ??SPI_CalculateCRC_0
668 {
669 /* Enable the selected SPI CRC calculation */
670 SPIx->CR1 |= CR1_CRCEN_Set;
\ 00000006 0288 LDRH R2,[R0, #+0]
\ 00000008 52F40052 ORRS R2,R2,#0x2000
\ 0000000C 0280 STRH R2,[R0, #+0]
\ 0000000E 04E0 B.N ??SPI_CalculateCRC_1
671 }
672 else
673 {
674 /* Disable the selected SPI CRC calculation */
675 SPIx->CR1 &= CR1_CRCEN_Reset;
\ ??SPI_CalculateCRC_0:
\ 00000010 0288 LDRH R2,[R0, #+0]
\ 00000012 4DF6FF73 MOVW R3,#+57343
\ 00000016 1A40 ANDS R2,R3,R2
\ 00000018 0280 STRH R2,[R0, #+0]
676 }
677 }
\ ??SPI_CalculateCRC_1:
\ 0000001A 7047 BX LR ;; return
678
679 /**
680 * @brief Returns the transmit or the receive CRC register value for the specified SPI.
681 * @param SPIx: where x can be 1, 2 or 3 to select the SPI peripheral.
682 * @param SPI_CRC: specifies the CRC register to be read.
683 * This parameter can be one of the following values:
684 * @arg SPI_CRC_Tx: Selects Tx CRC register
685 * @arg SPI_CRC_Rx: Selects Rx CRC register
686 * @retval The selected CRC register value..
687 */
\ In section .text, align 2, keep-with-next
688 uint16_t SPI_GetCRC(SPI_TypeDef* SPIx, uint8_t SPI_CRC)
689 {
\ SPI_GetCRC:
\ 00000000 0200 MOVS R2,R0
690 uint16_t crcreg = 0;
\ 00000002 0020 MOVS R0,#+0
691 /* Check the parameters */
692 assert_param(IS_SPI_ALL_PERIPH(SPIx));
693 assert_param(IS_SPI_CRC(SPI_CRC));
694 if (SPI_CRC != SPI_CRC_Rx)
\ 00000004 C9B2 UXTB R1,R1 ;; ZeroExt R1,R1,#+24,#+24
\ 00000006 0129 CMP R1,#+1
\ 00000008 02D0 BEQ.N ??SPI_GetCRC_0
695 {
696 /* Get the Tx CRC register */
697 crcreg = SPIx->TXCRCR;
\ 0000000A 138B LDRH R3,[R2, #+24]
\ 0000000C 1800 MOVS R0,R3
\ 0000000E 01E0 B.N ??SPI_GetCRC_1
698 }
699 else
700 {
701 /* Get the Rx CRC register */
702 crcreg = SPIx->RXCRCR;
\ ??SPI_GetCRC_0:
\ 00000010 938A LDRH R3,[R2, #+20]
\ 00000012 1800 MOVS R0,R3
703 }
704 /* Return the selected CRC register */
705 return crcreg;
\ ??SPI_GetCRC_1:
\ 00000014 80B2 UXTH R0,R0 ;; ZeroExt R0,R0,#+16,#+16
\ 00000016 7047 BX LR ;; return
706 }
707
708 /**
709 * @brief Returns the CRC Polynomial register value for the specified SPI.
710 * @param SPIx: where x can be 1, 2 or 3 to select the SPI peripheral.
711 * @retval The CRC Polynomial register value.
712 */
\ In section .text, align 2, keep-with-next
713 uint16_t SPI_GetCRCPolynomial(SPI_TypeDef* SPIx)
714 {
715 /* Check the parameters */
716 assert_param(IS_SPI_ALL_PERIPH(SPIx));
717
718 /* Return the CRC polynomial register */
719 return SPIx->CRCPR;
\ SPI_GetCRCPolynomial:
\ 00000000 008A LDRH R0,[R0, #+16]
\ 00000002 7047 BX LR ;; return
720 }
721
722 /**
723 * @brief Selects the data transfer direction in bi-directional mode for the specified SPI.
724 * @param SPIx: where x can be 1, 2 or 3 to select the SPI peripheral.
725 * @param SPI_Direction: specifies the data transfer direction in bi-directional mode.
726 * This parameter can be one of the following values:
727 * @arg SPI_Direction_Tx: Selects Tx transmission direction
728 * @arg SPI_Direction_Rx: Selects Rx receive direction
729 * @retval None
730 */
\ In section .text, align 2, keep-with-next
731
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -