📄 stm32f10x_spi.lst
字号:
426 void SPI_Cmd(SPI_TypeDef* SPIx, FunctionalState NewState)
427 {
428 /* Check the parameters */
429 assert_param(IS_SPI_ALL_PERIPH(SPIx));
430 assert_param(IS_FUNCTIONAL_STATE(NewState));
431 if (NewState != DISABLE)
\ SPI_Cmd:
\ 00000000 C9B2 UXTB R1,R1 ;; ZeroExt R1,R1,#+24,#+24
\ 00000002 0029 CMP R1,#+0
\ 00000004 04D0 BEQ.N ??SPI_Cmd_0
432 {
433 /* Enable the selected SPI peripheral */
434 SPIx->CR1 |= CR1_SPE_Set;
\ 00000006 0288 LDRH R2,[R0, #+0]
\ 00000008 52F04002 ORRS R2,R2,#0x40
\ 0000000C 0280 STRH R2,[R0, #+0]
\ 0000000E 04E0 B.N ??SPI_Cmd_1
435 }
436 else
437 {
438 /* Disable the selected SPI peripheral */
439 SPIx->CR1 &= CR1_SPE_Reset;
\ ??SPI_Cmd_0:
\ 00000010 0288 LDRH R2,[R0, #+0]
\ 00000012 4FF6BF73 MOVW R3,#+65471
\ 00000016 1A40 ANDS R2,R3,R2
\ 00000018 0280 STRH R2,[R0, #+0]
440 }
441 }
\ ??SPI_Cmd_1:
\ 0000001A 7047 BX LR ;; return
442
443 /**
444 * @brief Enables or disables the specified SPI peripheral (in I2S mode).
445 * @param SPIx: where x can be 2 or 3 to select the SPI peripheral.
446 * @param NewState: new state of the SPIx peripheral.
447 * This parameter can be: ENABLE or DISABLE.
448 * @retval None
449 */
\ In section .text, align 2, keep-with-next
450 void I2S_Cmd(SPI_TypeDef* SPIx, FunctionalState NewState)
451 {
452 /* Check the parameters */
453 assert_param(IS_SPI_23_PERIPH(SPIx));
454 assert_param(IS_FUNCTIONAL_STATE(NewState));
455 if (NewState != DISABLE)
\ I2S_Cmd:
\ 00000000 C9B2 UXTB R1,R1 ;; ZeroExt R1,R1,#+24,#+24
\ 00000002 0029 CMP R1,#+0
\ 00000004 04D0 BEQ.N ??I2S_Cmd_0
456 {
457 /* Enable the selected SPI peripheral (in I2S mode) */
458 SPIx->I2SCFGR |= I2SCFGR_I2SE_Set;
\ 00000006 828B LDRH R2,[R0, #+28]
\ 00000008 52F48062 ORRS R2,R2,#0x400
\ 0000000C 8283 STRH R2,[R0, #+28]
\ 0000000E 04E0 B.N ??I2S_Cmd_1
459 }
460 else
461 {
462 /* Disable the selected SPI peripheral (in I2S mode) */
463 SPIx->I2SCFGR &= I2SCFGR_I2SE_Reset;
\ ??I2S_Cmd_0:
\ 00000010 828B LDRH R2,[R0, #+28]
\ 00000012 4FF6FF33 MOVW R3,#+64511
\ 00000016 1A40 ANDS R2,R3,R2
\ 00000018 8283 STRH R2,[R0, #+28]
464 }
465 }
\ ??I2S_Cmd_1:
\ 0000001A 7047 BX LR ;; return
466
467 /**
468 * @brief Enables or disables the specified SPI/I2S interrupts.
469 * @param SPIx: where x can be
470 * - 1, 2 or 3 in SPI mode
471 * - 2 or 3 in I2S mode
472 * @param SPI_I2S_IT: specifies the SPI/I2S interrupt source to be enabled or disabled.
473 * This parameter can be one of the following values:
474 * @arg SPI_I2S_IT_TXE: Tx buffer empty interrupt mask
475 * @arg SPI_I2S_IT_RXNE: Rx buffer not empty interrupt mask
476 * @arg SPI_I2S_IT_ERR: Error interrupt mask
477 * @param NewState: new state of the specified SPI/I2S interrupt.
478 * This parameter can be: ENABLE or DISABLE.
479 * @retval None
480 */
\ In section .text, align 2, keep-with-next
481 void SPI_I2S_ITConfig(SPI_TypeDef* SPIx, uint8_t SPI_I2S_IT, FunctionalState NewState)
482 {
\ SPI_I2S_ITConfig:
\ 00000000 30B4 PUSH {R4,R5}
483 uint16_t itpos = 0, itmask = 0 ;
\ 00000002 0023 MOVS R3,#+0
\ 00000004 0024 MOVS R4,#+0
484 /* Check the parameters */
485 assert_param(IS_SPI_ALL_PERIPH(SPIx));
486 assert_param(IS_FUNCTIONAL_STATE(NewState));
487 assert_param(IS_SPI_I2S_CONFIG_IT(SPI_I2S_IT));
488
489 /* Get the SPI/I2S IT index */
490 itpos = SPI_I2S_IT >> 4;
\ 00000006 C9B2 UXTB R1,R1 ;; ZeroExt R1,R1,#+24,#+24
\ 00000008 0D09 LSRS R5,R1,#+4
\ 0000000A EDB2 UXTB R5,R5 ;; ZeroExt R5,R5,#+24,#+24
\ 0000000C 2B00 MOVS R3,R5
491
492 /* Set the IT mask */
493 itmask = (uint16_t)1 << (uint16_t)itpos;
\ 0000000E 0125 MOVS R5,#+1
\ 00000010 9D40 LSLS R5,R5,R3
\ 00000012 2C00 MOVS R4,R5
494
495 if (NewState != DISABLE)
\ 00000014 D2B2 UXTB R2,R2 ;; ZeroExt R2,R2,#+24,#+24
\ 00000016 002A CMP R2,#+0
\ 00000018 03D0 BEQ.N ??SPI_I2S_ITConfig_0
496 {
497 /* Enable the selected SPI/I2S interrupt */
498 SPIx->CR2 |= itmask;
\ 0000001A 8588 LDRH R5,[R0, #+4]
\ 0000001C 2543 ORRS R5,R4,R5
\ 0000001E 8580 STRH R5,[R0, #+4]
\ 00000020 02E0 B.N ??SPI_I2S_ITConfig_1
499 }
500 else
501 {
502 /* Disable the selected SPI/I2S interrupt */
503 SPIx->CR2 &= (uint16_t)~itmask;
\ ??SPI_I2S_ITConfig_0:
\ 00000022 8588 LDRH R5,[R0, #+4]
\ 00000024 A543 BICS R5,R5,R4
\ 00000026 8580 STRH R5,[R0, #+4]
504 }
505 }
\ ??SPI_I2S_ITConfig_1:
\ 00000028 30BC POP {R4,R5}
\ 0000002A 7047 BX LR ;; return
506
507 /**
508 * @brief Enables or disables the SPIx/I2Sx DMA interface.
509 * @param SPIx: where x can be
510 * - 1, 2 or 3 in SPI mode
511 * - 2 or 3 in I2S mode
512 * @param SPI_I2S_DMAReq: specifies the SPI/I2S DMA transfer request to be enabled or disabled.
513 * This parameter can be any combination of the following values:
514 * @arg SPI_I2S_DMAReq_Tx: Tx buffer DMA transfer request
515 * @arg SPI_I2S_DMAReq_Rx: Rx buffer DMA transfer request
516 * @param NewState: new state of the selected SPI/I2S DMA transfer request.
517 * This parameter can be: ENABLE or DISABLE.
518 * @retval None
519 */
\ In section .text, align 2, keep-with-next
520 void SPI_I2S_DMACmd(SPI_TypeDef* SPIx, uint16_t SPI_I2S_DMAReq, FunctionalState NewState)
521 {
522 /* Check the parameters */
523 assert_param(IS_SPI_ALL_PERIPH(SPIx));
524 assert_param(IS_FUNCTIONAL_STATE(NewState));
525 assert_param(IS_SPI_I2S_DMAREQ(SPI_I2S_DMAReq));
526 if (NewState != DISABLE)
\ SPI_I2S_DMACmd:
\ 00000000 D2B2 UXTB R2,R2 ;; ZeroExt R2,R2,#+24,#+24
\ 00000002 002A CMP R2,#+0
\ 00000004 03D0 BEQ.N ??SPI_I2S_DMACmd_0
527 {
528 /* Enable the selected SPI/I2S DMA requests */
529 SPIx->CR2 |= SPI_I2S_DMAReq;
\ 00000006 8388 LDRH R3,[R0, #+4]
\ 00000008 0B43 ORRS R3,R1,R3
\ 0000000A 8380 STRH R3,[R0, #+4]
\ 0000000C 02E0 B.N ??SPI_I2S_DMACmd_1
530 }
531 else
532 {
533 /* Disable the selected SPI/I2S DMA requests */
534 SPIx->CR2 &= (uint16_t)~SPI_I2S_DMAReq;
\ ??SPI_I2S_DMACmd_0:
\ 0000000E 8388 LDRH R3,[R0, #+4]
\ 00000010 8B43 BICS R3,R3,R1
\ 00000012 8380 STRH R3,[R0, #+4]
535 }
536 }
\ ??SPI_I2S_DMACmd_1:
\ 00000014 7047 BX LR ;; return
537
538 /**
539 * @brief Transmits a Data through the SPIx/I2Sx peripheral.
540 * @param SPIx: where x can be
541 * - 1, 2 or 3 in SPI mode
542 * - 2 or 3 in I2S mode
543 * @param Data : Data to be transmitted.
544 * @retval None
545 */
\ In section .text, align 2, keep-with-next
546 void SPI_I2S_SendData(SPI_TypeDef* SPIx, uint16_t Data)
547 {
548 /* Check the parameters */
549 assert_param(IS_SPI_ALL_PERIPH(SPIx));
550
551 /* Write in the DR register the data to be sent */
552 SPIx->DR = Data;
\ SPI_I2S_SendData:
\ 00000000 8181 STRH R1,[R0, #+12]
553 }
\ 00000002 7047 BX LR ;; return
554
555 /**
556 * @brief Returns the most recent received data by the SPIx/I2Sx peripheral.
557 * @param SPIx: where x can be
558 * - 1, 2 or 3 in SPI mode
559 * - 2 or 3 in I2S mode
560 * @retval The value of the received data.
561 */
\ In section .text, align 2, keep-with-next
562 uint16_t SPI_I2S_ReceiveData(SPI_TypeDef* SPIx)
563 {
564 /* Check the parameters */
565 assert_param(IS_SPI_ALL_PERIPH(SPIx));
566
567 /* Return the data in the DR register */
568 return SPIx->DR;
\ SPI_I2S_ReceiveData:
\ 00000000 8089 LDRH R0,[R0, #+12]
\ 00000002 7047 BX LR ;; return
569 }
570
571 /**
572 * @brief Configures internally by software the NSS pin for the selected SPI.
573 * @param SPIx: where x can be 1, 2 or 3 to select the SPI peripheral.
574 * @param SPI_NSSInternalSoft: specifies the SPI NSS internal state.
575 * This parameter can be one of the following values:
576 * @arg SPI_NSSInternalSoft_Set: Set NSS pin internally
577 * @arg SPI_NSSInternalSoft_Reset: Reset NSS pin internally
578 * @retval None
579 */
\ In section .text, align 2, keep-with-next
580 void SPI_NSSInternalSoftwareConfig(SPI_TypeDef* SPIx, uint16_t SPI_NSSInternalSoft)
581 {
582 /* Check the parameters */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -