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

📄 stm32f10x_spi.lst

📁 编译环境是 iar EWARM ,STM32 下的UCOSII
💻 LST
📖 第 1 页 / 共 5 页
字号:
   \   00000098   2184               STRH     R1,[R4, #+32]
    248           
    249            /* Configure the I2S with the SPI_InitStruct values */
    250            tmpreg |= (u16)(I2S_Mode_Select | I2S_InitStruct->I2S_Mode | \
    251                            I2S_InitStruct->I2S_Standard | I2S_InitStruct->I2S_DataFormat | \
    252                            I2S_InitStruct->I2S_CPOL);
    253           
    254            /* Write to SPIx I2SCFGR */  
    255            SPIx->I2SCFGR = tmpreg;                                    
   \   0000009A   2888               LDRH     R0,[R5, #+0]
   \   0000009C   3043               ORRS     R0,R0,R6
   \   0000009E   6988               LDRH     R1,[R5, #+2]
   \   000000A0   0143               ORRS     R1,R1,R0
   \   000000A2   A888               LDRH     R0,[R5, #+4]
   \   000000A4   0843               ORRS     R0,R0,R1
   \   000000A6   6989               LDRH     R1,[R5, #+10]
   \   000000A8   0143               ORRS     R1,R1,R0
   \   000000AA   51F40060           ORRS     R0,R1,#0x800
   \   000000AE   A083               STRH     R0,[R4, #+28]
    256          }
   \   000000B0   05B0               ADD      SP,SP,#+20
   \   000000B2   BDE8F083           POP      {R4-R9,PC}       ;; return
   \   000000B6   00BF               Nop      
   \                     ??I2S_Init_0:
   \   000000B8   40F00000           DC32     0xf040
    257          
    258          /*******************************************************************************
    259          * Function Name  : SPI_StructInit
    260          * Description    : Fills each SPI_InitStruct member with its default value.
    261          * Input          : - SPI_InitStruct : pointer to a SPI_InitTypeDef structure
    262          *                    which will be initialized.
    263          * Output         : None
    264          * Return         : None
    265          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    266          void SPI_StructInit(SPI_InitTypeDef* SPI_InitStruct)
    267          {
    268          /*--------------- Reset SPI init structure parameters values -----------------*/
    269            /* Initialize the SPI_Direction member */
    270            SPI_InitStruct->SPI_Direction = SPI_Direction_2Lines_FullDuplex;
   \                     SPI_StructInit:
   \   00000000   0021               MOVS     R1,#+0
   \   00000002   0180               STRH     R1,[R0, #+0]
    271          
    272            /* initialize the SPI_Mode member */
    273            SPI_InitStruct->SPI_Mode = SPI_Mode_Slave;
   \   00000004   4180               STRH     R1,[R0, #+2]
    274          
    275            /* initialize the SPI_DataSize member */
    276            SPI_InitStruct->SPI_DataSize = SPI_DataSize_8b;
   \   00000006   8180               STRH     R1,[R0, #+4]
    277          
    278            /* Initialize the SPI_CPOL member */
    279            SPI_InitStruct->SPI_CPOL = SPI_CPOL_Low;
   \   00000008   C180               STRH     R1,[R0, #+6]
    280          
    281            /* Initialize the SPI_CPHA member */
    282            SPI_InitStruct->SPI_CPHA = SPI_CPHA_1Edge;
   \   0000000A   0181               STRH     R1,[R0, #+8]
    283          
    284            /* Initialize the SPI_NSS member */
    285            SPI_InitStruct->SPI_NSS = SPI_NSS_Hard;
   \   0000000C   4181               STRH     R1,[R0, #+10]
    286          
    287            /* Initialize the SPI_BaudRatePrescaler member */
    288            SPI_InitStruct->SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_2;
   \   0000000E   8181               STRH     R1,[R0, #+12]
    289          
    290            /* Initialize the SPI_FirstBit member */
    291            SPI_InitStruct->SPI_FirstBit = SPI_FirstBit_MSB;
   \   00000010   C181               STRH     R1,[R0, #+14]
    292          
    293            /* Initialize the SPI_CRCPolynomial member */
    294            SPI_InitStruct->SPI_CRCPolynomial = 7;
   \   00000012   0721               MOVS     R1,#+7
   \   00000014   0182               STRH     R1,[R0, #+16]
    295          }
   \   00000016   7047               BX       LR               ;; return
    296          
    297          /*******************************************************************************
    298          * Function Name  : I2S_StructInit
    299          * Description    : Fills each I2S_InitStruct member with its default value.
    300          * Input          : - I2S_InitStruct : pointer to a I2S_InitTypeDef structure
    301          *                    which will be initialized.
    302          * Output         : None
    303          * Return         : None
    304          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    305          void I2S_StructInit(I2S_InitTypeDef* I2S_InitStruct)
    306          {
    307          /*--------------- Reset I2S init structure parameters values -----------------*/
    308            /* Initialize the I2S_Mode member */
    309            I2S_InitStruct->I2S_Mode = I2S_Mode_SlaveTx;
   \                     I2S_StructInit:
   \   00000000   0021               MOVS     R1,#+0
   \   00000002   0180               STRH     R1,[R0, #+0]
    310            
    311            /* Initialize the I2S_Standard member */
    312            I2S_InitStruct->I2S_Standard = I2S_Standard_Phillips;
   \   00000004   4180               STRH     R1,[R0, #+2]
    313            
    314            /* Initialize the I2S_DataFormat member */
    315            I2S_InitStruct->I2S_DataFormat = I2S_DataFormat_16b;
   \   00000006   8180               STRH     R1,[R0, #+4]
    316            
    317            /* Initialize the I2S_MCLKOutput member */
    318            I2S_InitStruct->I2S_MCLKOutput = I2S_MCLKOutput_Disable;
   \   00000008   C180               STRH     R1,[R0, #+6]
    319            
    320            /* Initialize the I2S_AudioFreq member */
    321            I2S_InitStruct->I2S_AudioFreq = I2S_AudioFreq_Default;
   \   0000000A   0222               MOVS     R2,#+2
   \   0000000C   0281               STRH     R2,[R0, #+8]
    322            
    323            /* Initialize the I2S_CPOL member */
    324            I2S_InitStruct->I2S_CPOL = I2S_CPOL_Low;
   \   0000000E   4181               STRH     R1,[R0, #+10]
    325          }
   \   00000010   7047               BX       LR               ;; return
    326          
    327          /*******************************************************************************
    328          * Function Name  : SPI_Cmd
    329          * Description    : Enables or disables the specified SPI peripheral.
    330          * Input          : - SPIx: where x can be 1, 2 or 3 to select the SPI peripheral.
    331          *                  - NewState: new state of the SPIx peripheral. 
    332          *                    This parameter can be: ENABLE or DISABLE.
    333          * Output         : None
    334          * Return         : None
    335          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    336          void SPI_Cmd(SPI_TypeDef* SPIx, FunctionalState NewState)
    337          {
    338            /* Check the parameters */
    339            assert_param(IS_SPI_ALL_PERIPH(SPIx));
    340            assert_param(IS_FUNCTIONAL_STATE(NewState));
    341          
    342            if (NewState != DISABLE)
   \                     SPI_Cmd:
   \   00000000   0029               CMP      R1,#+0
   \   00000002   0188               LDRH     R1,[R0, #+0]
   \   00000004   03D0               BEQ.N    ??SPI_Cmd_0
    343            {
    344              /* Enable the selected SPI peripheral */
    345              SPIx->CR1 |= CR1_SPE_Set;
   \   00000006   51F04001           ORRS     R1,R1,#0x40
   \   0000000A   0180               STRH     R1,[R0, #+0]
   \   0000000C   7047               BX       LR
    346            }
    347            else
    348            {
    349              /* Disable the selected SPI peripheral */
    350              SPIx->CR1 &= CR1_SPE_Reset;
   \                     ??SPI_Cmd_0:
   \   0000000E   024A               LDR.N    R2,??SPI_Cmd_1   ;; 0xffbf
   \   00000010   0A40               ANDS     R2,R2,R1
   \   00000012   0280               STRH     R2,[R0, #+0]
    351            }
    352          }
   \   00000014   7047               BX       LR               ;; return
   \   00000016   00BF               Nop      
   \                     ??SPI_Cmd_1:
   \   00000018   BFFF0000           DC32     0xffbf
    353          
    354          /*******************************************************************************
    355          * Function Name  : I2S_Cmd
    356          * Description    : Enables or disables the specified SPI peripheral (in I2S mode).
    357          * Input          : - SPIx: where x can be 2 or 3 to select the SPI peripheral.
    358          *                  - NewState: new state of the SPIx peripheral. 
    359          *                    This parameter can be: ENABLE or DISABLE.
    360          * Output         : None
    361          * Return         : None
    362          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    363          void I2S_Cmd(SPI_TypeDef* SPIx, FunctionalState NewState)
    364          {
    365            /* Check the parameters */
    366            assert_param(IS_SPI_23_PERIPH(SPIx));
    367            assert_param(IS_FUNCTIONAL_STATE(NewState));
    368          
    369            if (NewState != DISABLE)
   \                     I2S_Cmd:
   \   00000000   0029               CMP      R1,#+0
   \   00000002   818B               LDRH     R1,[R0, #+28]
   \   00000004   03D0               BEQ.N    ??I2S_Cmd_0
    370            {
    371              /* Enable the selected SPI peripheral (in I2S mode) */
    372              SPIx->I2SCFGR |= I2SCFGR_I2SE_Set;
   \   00000006   51F48061           ORRS     R1,R1,#0x400
   \   0000000A   8183               STRH     R1,[R0, #+28]
   \   0000000C   7047               BX       LR
    373            }
    374            else
    375            {
    376              /* Disable the selected SPI peripheral (in I2S mode) */
    377              SPIx->I2SCFGR &= I2SCFGR_I2SE_Reset;
   \                     ??I2S_Cmd_0:
   \   0000000E   024A               LDR.N    R2,??I2S_Cmd_1   ;; 0xfbff
   \   00000010   0A40               ANDS     R2,R2,R1
   \   00000012   8283               STRH     R2,[R0, #+28]
    378            }
    379          }
   \   00000014   7047               BX       LR               ;; return
   \   00000016   00BF               Nop      
   \                     ??I2S_Cmd_1:
   \   00000018   FFFB0000           DC32     0xfbff
    380          
    381          /*******************************************************************************
    382          * Function Name  : SPI_I2S_ITConfig
    383          * Description    : Enables or disables the specified SPI/I2S interrupts.
    384          * Input          : - SPIx: where x can be :
    385          *                         - 1, 2 or 3 in SPI mode 
    386          *                         - 2 or 3 in I2S mode
    387          *                  - SPI_I2S_IT: specifies the SPI/I2S interrupt source to be 
    388          *                    enabled or disabled. 
    389          *                    This parameter can be one of the following values:
    390          *                       - SPI_I2S_IT_TXE: Tx buffer empty interrupt mask
    391          *                       - SPI_I2S_IT_RXNE: Rx buffer not empty interrupt mask
    392          *                       - SPI_I2S_IT_ERR: Error interrupt mask
    393          *                  - NewState: new state of the specified SPI/I2S interrupt.
    394          *                    This parameter can be: ENABLE or DISABLE.
    395          * Output         : None
    396          * Return         : None
    397          *******************************************************************************/

⌨️ 快捷键说明

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