⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stm32f10x_spi.lst

📁 编译环境是 iar EWARM ,STM32 下的UCOSII
💻 LST
📖 第 1 页 / 共 5 页
字号:
   \                                 In segment CODE, align 4, keep-with-next
    398          void SPI_I2S_ITConfig(SPI_TypeDef* SPIx, u8 SPI_I2S_IT, FunctionalState NewState)
    399          {
    400            u16 itpos = 0, itmask = 0 ;
    401          
    402            /* Check the parameters */
    403            assert_param(IS_SPI_ALL_PERIPH(SPIx));
    404            assert_param(IS_FUNCTIONAL_STATE(NewState));
    405            assert_param(IS_SPI_I2S_CONFIG_IT(SPI_I2S_IT));
    406          
    407            /* Get the SPI/I2S IT index */
    408            itpos = SPI_I2S_IT >> 4;
    409            /* Set the IT mask */
    410            itmask = (u16)((u16)1 << itpos);
   \                     SPI_I2S_ITConfig:
   \   00000000   0123               MOVS     R3,#+1
   \   00000002   0909               LSRS     R1,R1,#+4
   \   00000004   8B40               LSLS     R3,R3,R1
   \   00000006   9BB2               UXTH     R3,R3
    411          
    412            if (NewState != DISABLE)
   \   00000008   002A               CMP      R2,#+0
   \   0000000A   8188               LDRH     R1,[R0, #+4]
   \   0000000C   02D0               BEQ.N    ??SPI_I2S_ITConfig_0
    413            {
    414              /* Enable the selected SPI/I2S interrupt */
    415              SPIx->CR2 |= itmask;
   \   0000000E   0B43               ORRS     R3,R3,R1
   \   00000010   8380               STRH     R3,[R0, #+4]
   \   00000012   7047               BX       LR
    416            }
    417            else
    418            {
    419              /* Disable the selected SPI/I2S interrupt */
    420              SPIx->CR2 &= (u16)~itmask;
   \                     ??SPI_I2S_ITConfig_0:
   \   00000014   9943               BICS     R1,R1,R3
   \   00000016   8180               STRH     R1,[R0, #+4]
    421            }
    422          }
   \   00000018   7047               BX       LR               ;; return
    423          
    424          /*******************************************************************************
    425          * Function Name  : SPI_I2S_DMACmd
    426          * Description    : Enables or disables the SPIx/I2Sx DMA interface.
    427          * Input          : - SPIx: where x can be :
    428          *                         - 1, 2 or 3 in SPI mode 
    429          *                         - 2 or 3 in I2S mode
    430          *                  - SPI_I2S_DMAReq: specifies the SPI/I2S DMA transfer request 
    431          *                    to be enabled or disabled. 
    432          *                    This parameter can be any combination of the following values:
    433          *                       - SPI_I2S_DMAReq_Tx: Tx buffer DMA transfer request
    434          *                       - SPI_I2S_DMAReq_Rx: Rx buffer DMA transfer request
    435          *                  - NewState: new state of the selected SPI/I2S DMA transfer 
    436          *                    request.
    437          *                    This parameter can be: ENABLE or DISABLE.
    438          * Output         : None
    439          * Return         : None
    440          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    441          void SPI_I2S_DMACmd(SPI_TypeDef* SPIx, u16 SPI_I2S_DMAReq, FunctionalState NewState)
    442          {
    443            /* Check the parameters */
    444            assert_param(IS_SPI_ALL_PERIPH(SPIx));
    445            assert_param(IS_FUNCTIONAL_STATE(NewState));
    446            assert_param(IS_SPI_I2S_DMAREQ(SPI_I2S_DMAReq));
    447          
    448            if (NewState != DISABLE)
   \                     SPI_I2S_DMACmd:
   \   00000000   002A               CMP      R2,#+0
   \   00000002   8288               LDRH     R2,[R0, #+4]
   \   00000004   02D0               BEQ.N    ??SPI_I2S_DMACmd_0
    449            {
    450              /* Enable the selected SPI/I2S DMA requests */
    451              SPIx->CR2 |= SPI_I2S_DMAReq;
   \   00000006   1143               ORRS     R1,R1,R2
   \   00000008   8180               STRH     R1,[R0, #+4]
   \   0000000A   7047               BX       LR
    452            }
    453            else
    454            {
    455              /* Disable the selected SPI/I2S DMA requests */
    456              SPIx->CR2 &= (u16)~SPI_I2S_DMAReq;
   \                     ??SPI_I2S_DMACmd_0:
   \   0000000C   8A43               BICS     R2,R2,R1
   \   0000000E   8280               STRH     R2,[R0, #+4]
    457            }
    458          }
   \   00000010   7047               BX       LR               ;; return
    459          
    460          /*******************************************************************************
    461          * Function Name  : SPI_I2S_SendData
    462          * Description    : Transmits a Data through the SPIx/I2Sx peripheral.
    463          * Input          : - SPIx: where x can be :
    464          *                         - 1, 2 or 3 in SPI mode 
    465          *                         - 2 or 3 in I2S mode
    466          *                  - Data : Data to be transmitted..
    467          * Output         : None
    468          * Return         : None
    469          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    470          void SPI_I2S_SendData(SPI_TypeDef* SPIx, u16 Data)
    471          {
    472            /* Check the parameters */
    473            assert_param(IS_SPI_ALL_PERIPH(SPIx));
    474            
    475            /* Write in the DR register the data to be sent */
    476            SPIx->DR = Data;
   \                     SPI_I2S_SendData:
   \   00000000   8181               STRH     R1,[R0, #+12]
    477          }
   \   00000002   7047               BX       LR               ;; return
    478          
    479          /*******************************************************************************
    480          * Function Name  : SPI_I2S_ReceiveData
    481          * Description    : Returns the most recent received data by the SPIx/I2Sx peripheral. 
    482          * Input          : - SPIx: where x can be :
    483          *                         - 1, 2 or 3 in SPI mode 
    484          *                         - 2 or 3 in I2S mode
    485          * Output         : None
    486          * Return         : The value of the received data.
    487          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    488          u16 SPI_I2S_ReceiveData(SPI_TypeDef* SPIx)
    489          {
    490            /* Check the parameters */
    491            assert_param(IS_SPI_ALL_PERIPH(SPIx));
    492            
    493            /* Return the data in the DR register */
    494            return SPIx->DR;
   \                     SPI_I2S_ReceiveData:
   \   00000000   8089               LDRH     R0,[R0, #+12]
   \   00000002   7047               BX       LR               ;; return
    495          }
    496          
    497          /*******************************************************************************
    498          * Function Name  : SPI_NSSInternalSoftwareConfig
    499          * Description    : Configures internally by software the NSS pin for the selected 
    500          *                  SPI.
    501          * Input          : - SPIx: where x can be 1, 2 or 3 to select the SPI peripheral.
    502          *                  - SPI_NSSInternalSoft: specifies the SPI NSS internal state.
    503          *                    This parameter can be one of the following values:
    504          *                       - SPI_NSSInternalSoft_Set: Set NSS pin internally
    505          *                       - SPI_NSSInternalSoft_Reset: Reset NSS pin internally
    506          * Output         : None
    507          * Return         : None
    508          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    509          void SPI_NSSInternalSoftwareConfig(SPI_TypeDef* SPIx, u16 SPI_NSSInternalSoft)
    510          {
    511            /* Check the parameters */
    512            assert_param(IS_SPI_ALL_PERIPH(SPIx));
    513            assert_param(IS_SPI_NSS_INTERNAL(SPI_NSSInternalSoft));
    514          
    515            if (SPI_NSSInternalSoft != SPI_NSSInternalSoft_Reset)
   \                     SPI_NSSInternalSoftwareConfig:
   \   00000000   054A               LDR.N    R2,??SPI_NSSInternalSoftwareConfig_0  ;; 0xfeff
   \   00000002   9142               CMP      R1,R2
   \   00000004   0188               LDRH     R1,[R0, #+0]
   \   00000006   03D0               BEQ.N    ??SPI_NSSInternalSoftwareConfig_1
    516            {
    517              /* Set NSS pin internally by software */
    518              SPIx->CR1 |= SPI_NSSInternalSoft_Set;
   \   00000008   51F48071           ORRS     R1,R1,#0x100
   \   0000000C   0180               STRH     R1,[R0, #+0]
   \   0000000E   7047               BX       LR
    519            }
    520            else
    521            {
    522              /* Reset NSS pin internally by software */
    523              SPIx->CR1 &= SPI_NSSInternalSoft_Reset;
   \                     ??SPI_NSSInternalSoftwareConfig_1:
   \   00000010   0A40               ANDS     R2,R2,R1
   \   00000012   0280               STRH     R2,[R0, #+0]
    524            }
    525          }
   \   00000014   7047               BX       LR               ;; return
   \   00000016   00BF               Nop      
   \                     ??SPI_NSSInternalSoftwareConfig_0:
   \   00000018   FFFE0000           DC32     0xfeff
    526          
    527          /*******************************************************************************
    528          * Function Name  : SPI_SSOutputCmd
    529          * Description    : Enables or disables the SS output for the selected SPI.
    530          * Input          : - SPIx: where x can be 1, 2 or 3 to select the SPI peripheral.
    531          *                  - NewState: new state of the SPIx SS output. 
    532          *                    This parameter can be: ENABLE or DISABLE.
    533          * Output         : None
    534          * Return         : None
    535          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    536          void SPI_SSOutputCmd(SPI_TypeDef* SPIx, FunctionalState NewState)
    537          {
    538            /* Check the parameters */
    539            assert_param(IS_SPI_ALL_PERIPH(SPIx));
    540            assert_param(IS_FUNCTIONAL_STATE(NewState));
    541          
    542            if (NewState != DISABLE)
   \                     SPI_SSOutputCmd:
   \   00000000   0029               CMP      R1,#+0
   \   00000002   8188               LDRH     R1,[R0, #+4]
   \   00000004   03D0               BEQ.N    ??SPI_SSOutputCmd_0
    543            {
    544              /* Enable the selected SPI SS output */
    545              SPIx->CR2 |= CR2_SSOE_Set;
   \   00000006   51F00401           ORRS     R1,R1,#0x4
   \   0000000A   8180               STRH     R1,[R0, #+4]
   \   0000000C   7047               BX       LR
    546            }
    547            else
    548            {
    549              /* Disable the selected SPI SS output */
    550              SPIx->CR2 &= CR2_SSOE_Reset;
   \                     ??SPI_SSOutputCmd_0:
   \   0000000E   024A               LDR.N    R2,??SPI_SSOutputCmd_1  ;; 0xfffb
   \   00000010   0A40               ANDS     R2,R2,R1
   \   00000012   8280               STRH     R2,[R0, #+4]
    551            }
    552          }
   \   00000014   7047               BX       LR               ;; return
   \   00000016   00BF               Nop      
   \                     ??SPI_SSOutputCmd_1:
   \   00000018   FBFF0000           DC32     0xfffb

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -