📄 stm32f10x_usart.s79
字号:
ORRS R3,R3,R2
LDRH R2,[R1, #+4]
LDRH R1,[R1, #+6]
ORRS R2,R2,R3
B.N ??Subroutine0_0
Nop
DATA
??USART_ClockInit_0:
DC32 0xf0ff
CFI EndBlock cfiBlock3
// 281 }
// 282
// 283 /*******************************************************************************
// 284 * Function Name : USART_ClockStructInit
// 285 * Description : Fills each USART_ClockInitStruct member with its default value.
// 286 * Input : - USART_ClockInitStruct: pointer to a USART_ClockInitTypeDef
// 287 * structure which will be initialized.
// 288 * Output : None
// 289 * Return : None
// 290 *******************************************************************************/
RSEG CODE:CODE:NOROOT(2)
CFI Block cfiBlock4 Using cfiCommon0
CFI Function USART_ClockStructInit
THUMB
// 291 void USART_ClockStructInit(USART_ClockInitTypeDef* USART_ClockInitStruct)
// 292 {
// 293 /* USART_ClockInitStruct members default value */
// 294 USART_ClockInitStruct->USART_Clock = USART_Clock_Disable;
USART_ClockStructInit:
MOVS R1,#+0
STRH R1,[R0, #+0]
// 295 USART_ClockInitStruct->USART_CPOL = USART_CPOL_Low;
STRH R1,[R0, #+2]
// 296 USART_ClockInitStruct->USART_CPHA = USART_CPHA_1Edge;
STRH R1,[R0, #+4]
// 297 USART_ClockInitStruct->USART_LastBit = USART_LastBit_Disable;
STRH R1,[R0, #+6]
// 298 }
BX LR ;; return
CFI EndBlock cfiBlock4
// 299
// 300 /*******************************************************************************
// 301 * Function Name : USART_Cmd
// 302 * Description : Enables or disables the specified USART peripheral.
// 303 * Input : - USARTx: Select the USART or the UART peripheral.
// 304 * This parameter can be one of the following values:
// 305 * - USART1, USART2, USART3, UART4 or UART5.
// 306 * : - NewState: new state of the USARTx peripheral.
// 307 * This parameter can be: ENABLE or DISABLE.
// 308 * Output : None
// 309 * Return : None
// 310 *******************************************************************************/
RSEG CODE:CODE:NOROOT(2)
CFI Block cfiBlock5 Using cfiCommon0
CFI Function USART_Cmd
THUMB
// 311 void USART_Cmd(USART_TypeDef* USARTx, FunctionalState NewState)
// 312 {
// 313 /* Check the parameters */
// 314 assert_param(IS_USART_ALL_PERIPH(USARTx));
// 315 assert_param(IS_FUNCTIONAL_STATE(NewState));
// 316
// 317 if (NewState != DISABLE)
USART_Cmd:
CMP R1,#+0
LDRH R1,[R0, #+12]
BEQ.N ??USART_Cmd_0
// 318 {
// 319 /* Enable the selected USART by setting the UE bit in the CR1 register */
// 320 USARTx->CR1 |= CR1_UE_Set;
ORRS R1,R1,#0x2000
STRH R1,[R0, #+12]
BX LR
// 321 }
// 322 else
// 323 {
// 324 /* Disable the selected USART by clearing the UE bit in the CR1 register */
// 325 USARTx->CR1 &= CR1_UE_Reset;
??USART_Cmd_0:
LDR.N R2,??USART_Cmd_1 ;; 0xdfff
B.N ?Subroutine1
Nop
DATA
??USART_Cmd_1:
DC32 0xdfff
CFI EndBlock cfiBlock5
// 326 }
// 327 }
// 328
// 329 /*******************************************************************************
// 330 * Function Name : USART_ITConfig
// 331 * Description : Enables or disables the specified USART interrupts.
// 332 * Input : - USARTx: Select the USART or the UART peripheral.
// 333 * This parameter can be one of the following values:
// 334 * - USART1, USART2, USART3, UART4 or UART5.
// 335 * - USART_IT: specifies the USART interrupt sources to be
// 336 * enabled or disabled.
// 337 * This parameter can be one of the following values:
// 338 * - USART_IT_CTS: CTS change interrupt (not available for
// 339 * UART4 and UART5)
// 340 * - USART_IT_LBD: LIN Break detection interrupt
// 341 * - USART_IT_TXE: Tansmit Data Register empty interrupt
// 342 * - USART_IT_TC: Transmission complete interrupt
// 343 * - USART_IT_RXNE: Receive Data register not empty
// 344 * interrupt
// 345 * - USART_IT_IDLE: Idle line detection interrupt
// 346 * - USART_IT_PE: Parity Error interrupt
// 347 * - USART_IT_ERR: Error interrupt(Frame error, noise
// 348 * error, overrun error)
// 349 * - NewState: new state of the specified USARTx interrupts.
// 350 * This parameter can be: ENABLE or DISABLE.
// 351 * Output : None
// 352 * Return : None
// 353 *******************************************************************************/
RSEG CODE:CODE:NOROOT(2)
CFI Block cfiBlock6 Using cfiCommon0
CFI Function USART_ITConfig
THUMB
// 354 void USART_ITConfig(USART_TypeDef* USARTx, u16 USART_IT, FunctionalState NewState)
// 355 {
USART_ITConfig:
PUSH {R4,LR}
CFI ?RET Frame(CFA, -4)
CFI R4 Frame(CFA, -8)
CFI CFA R13+8
// 356 u32 usartreg = 0x00, itpos = 0x00, itmask = 0x00;
// 357 u32 usartxbase = 0x00;
// 358
// 359 /* Check the parameters */
// 360 assert_param(IS_USART_ALL_PERIPH(USARTx));
// 361 assert_param(IS_USART_CONFIG_IT(USART_IT));
// 362 assert_param(IS_USART_PERIPH_IT(USARTx, USART_IT)); /* The CTS interrupt is not available for UART4 and UART5 */
// 363 assert_param(IS_FUNCTIONAL_STATE(NewState));
// 364
// 365 usartxbase = (*(u32*)&(USARTx));
// 366
// 367 /* Get the USART register index */
// 368 usartreg = (((u8)USART_IT) >> 0x05);
LSLS R3,R1,#+24
LSRS R3,R3,#+29
// 369
// 370 /* Get the interrupt position */
// 371 itpos = USART_IT & IT_Mask;
// 372
// 373 itmask = (((u32)0x01) << itpos);
MOVS R4,#+1
LSLS R1,R1,#+27
LSRS R1,R1,#+27
LSLS R4,R4,R1
// 374
// 375 if (usartreg == 0x01) /* The IT is in CR1 register */
CMP R3,#+1
BNE.N ??USART_ITConfig_0
// 376 {
// 377 usartxbase += 0x0C;
ADDS R0,R0,#+12
B.N ??USART_ITConfig_1
// 378 }
// 379 else if (usartreg == 0x02) /* The IT is in CR2 register */
??USART_ITConfig_0:
CMP R3,#+2
ITE NE
ADDNE R0,R0,#+20
// 380 {
// 381 usartxbase += 0x10;
ADDEQ R0,R0,#+16
// 382 }
// 383 else /* The IT is in CR3 register */
// 384 {
// 385 usartxbase += 0x14;
// 386 }
// 387 if (NewState != DISABLE)
??USART_ITConfig_1:
LDR R1,[R0, #+0]
CMP R2,#+0
ITTT NE
// 388 {
// 389 *(vu32*)usartxbase |= itmask;
ORRNE R4,R4,R1
STRNE R4,[R0, #+0]
POPNE {R4,PC}
// 390 }
// 391 else
// 392 {
// 393 *(vu32*)usartxbase &= ~itmask;
BICS R1,R1,R4
STR R1,[R0, #+0]
// 394 }
// 395 }
POP {R4,PC} ;; return
CFI EndBlock cfiBlock6
// 396
// 397 /*******************************************************************************
// 398 * Function Name : USART_DMACmd
// 399 * Description : Enables or disables the USART抯 DMA interface.
// 400 * Input : - USARTx: Select the USART or the UART peripheral.
// 401 * This parameter can be one of the following values:
// 402 * - USART1, USART2, USART3 or UART4.
// 403 * Note: The DMA mode is not available for UART5.
// 404 * - USART_DMAReq: specifies the DMA request.
// 405 * This parameter can be any combination of the following values:
// 406 * - USART_DMAReq_Tx: USART DMA transmit request
// 407 * - USART_DMAReq_Rx: USART DMA receive request
// 408 * - NewState: new state of the DMA Request sources.
// 409 * This parameter can be: ENABLE or DISABLE.
// 410 * Output : None
// 411 * Return : None
// 412 *******************************************************************************/
RSEG CODE:CODE:NOROOT(2)
CFI Block cfiBlock7 Using cfiCommon0
CFI Function USART_DMACmd
THUMB
// 413 void USART_DMACmd(USART_TypeDef* USARTx, u16 USART_DMAReq, FunctionalState NewState)
// 414 {
// 415 /* Check the parameters */
// 416 assert_param(IS_USART_1234_PERIPH(USARTx));
// 417 assert_param(IS_USART_DMAREQ(USART_DMAReq));
// 418 assert_param(IS_FUNCTIONAL_STATE(NewState));
// 419
// 420 if (NewState != DISABLE)
USART_DMACmd:
CMP R2,#+0
LDRH R2,[R0, #+20]
ITTT NE
// 421 {
// 422 /* Enable the DMA transfer for selected requests by setting the DMAT and/or
// 423 DMAR bits in the USART CR3 register */
// 424 USARTx->CR3 |= USART_DMAReq;
ORRNE R1,R1,R2
STRHNE R1,[R0, #+20]
BXNE LR
// 425 }
// 426 else
// 427 {
// 428 /* Disable the DMA transfer for selected requests by clearing the DMAT and/or
// 429 DMAR bits in the USART CR3 register */
// 430 USARTx->CR3 &= (u16)~USART_DMAReq;
BICS R2,R2,R1
STRH R2,[R0, #+20]
// 431 }
// 432 }
BX LR ;; return
CFI EndBlock cfiBlock7
// 433
// 434 /*******************************************************************************
// 435 * Function Name : USART_SetAddress
// 436 * Description : Sets the address of the USART node.
// 437 * Input : - USARTx: Select the USART or the UART peripheral.
// 438 * This parameter can be one of the following values:
// 439 * - USART1, USART2, USART3, UART4 or UART5.
// 440 * - USART_Address: Indicates the address of the USART node.
// 441 * Output : None
// 442 * Return : None
// 443 *******************************************************************************/
RSEG CODE:CODE:NOROOT(2)
CFI Block cfiBlock8 Using cfiCommon0
CFI Function USART_SetAddress
THUMB
// 444 void USART_SetAddress(USART_TypeDef* USARTx, u8 USART_Address)
// 445 {
// 446 /* Check the parameters */
// 447 assert_param(IS_USART_ALL_PERIPH(USARTx));
// 448 assert_param(IS_USART_ADDRESS(USART_Address));
// 449
// 450 /* Clear the USART address */
// 451 USARTx->CR2 &= CR2_Address_Mask;
USART_SetAddress:
LDRH R2,[R0, #+16]
LDR.N R3,??USART_SetAddress_0 ;; 0xfff0
B.N ?Subroutine0
Nop
DATA
??USART_SetAddress_0:
DC32 0xfff0
CFI EndBlock cfiBlock8
// 452 /* Set the USART address node */
// 453 USARTx->CR2 |= USART_Address;
// 454 }
// 455
// 456 /*******************************************************************************
// 457 * Function Name : USART_WakeUpConfig
// 458 * Description : Selects the USART WakeUp method.
// 459 * Input : - USARTx: Select the USART or the UART peripheral.
// 460 * This parameter can be one of the following values:
// 461 * - USART1, USART2, USART3, UART4 or UART5.
// 462 * - USART_WakeUp: specifies the USART wakeup method.
// 463 * This parameter can be one of the following values:
// 464 * - USART_WakeUp_IdleLine: WakeUp by an idle line detection
// 465 * - USART_WakeUp_AddressMark: WakeUp by an address mark
// 466 * Output : None
// 467 * Return : None
// 468 *******************************************************************************/
RSEG CODE:CODE:NOROOT(2)
CFI Block cfiBlock9 Using cfiCommon0
CFI Function USART_WakeUpConfig
THUMB
// 469 void USART_WakeUpConfig(USART_TypeDef* USARTx, u16 USART_WakeUp)
// 470 {
// 471 /* Check the parameters */
// 472 assert_param(IS_USART_ALL_PERIPH(USARTx));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -