📄 stm32f10x_gpio.txt
字号:
000022 4e11 LDR r6,|L9.104|
000024 6876 LDR r6,[r6,#4]
000026 f0266670 BIC r6,r6,#0xf000000
00002a 4f0f LDR r7,|L9.104|
00002c 607e STR r6,[r7,#4]
00002e e012 B |L9.86|
|L9.48|
;;;547 }
;;;548 else if ((GPIO_Remap & DBGAFR_NUMBITS_MASK) == DBGAFR_NUMBITS_MASK)
000030 f4001680 AND r6,r0,#0x100000
000034 f5b61f80 CMP r6,#0x100000
000038 d106 BNE |L9.72|
;;;549 {
;;;550 tmp1 = ((uint32_t)0x03) << tmpmask;
00003a 2603 MOVS r6,#3
00003c fa06f304 LSL r3,r6,r4
;;;551 tmpreg &= ~tmp1;
000040 439d BICS r5,r5,r3
;;;552 tmpreg |= ~DBGAFR_SWJCFG_MASK;
000042 f0456570 ORR r5,r5,#0xf000000
000046 e006 B |L9.86|
|L9.72|
;;;553 }
;;;554 else
;;;555 {
;;;556 tmpreg &= ~(tmp << ((GPIO_Remap >> 0x15)*0x10));
000048 0d46 LSRS r6,r0,#21
00004a 0136 LSLS r6,r6,#4
00004c fa02f606 LSL r6,r2,r6
000050 43b5 BICS r5,r5,r6
;;;557 tmpreg |= ~DBGAFR_SWJCFG_MASK;
000052 f0456570 ORR r5,r5,#0xf000000
|L9.86|
;;;558 }
;;;559
;;;560 if (NewState != DISABLE)
000056 b121 CBZ r1,|L9.98|
;;;561 {
;;;562 tmpreg |= (tmp << ((GPIO_Remap >> 0x15)*0x10));
000058 0d46 LSRS r6,r0,#21
00005a 0136 LSLS r6,r6,#4
00005c fa02f606 LSL r6,r2,r6
000060 4335 ORRS r5,r5,r6
|L9.98|
;;;563 }
;;;564
;;;565 AFIO->MAPR = tmpreg;
000062 4e01 LDR r6,|L9.104|
000064 6075 STR r5,[r6,#4]
;;;566 }
000066 bdf0 POP {r4-r7,pc}
;;;567
ENDP
|L9.104|
DCD 0x40010000
AREA ||i.GPIO_ReadInputData||, CODE, READONLY, ALIGN=1
GPIO_ReadInputData PROC
;;;303 */
;;;304 uint16_t GPIO_ReadInputData(GPIO_TypeDef* GPIOx)
000000 4601 MOV r1,r0
;;;305 {
;;;306 /* Check the parameters */
;;;307 assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
;;;308
;;;309 return ((uint16_t)GPIOx->IDR);
000002 6888 LDR r0,[r1,#8]
000004 b280 UXTH r0,r0
;;;310 }
000006 4770 BX lr
;;;311
ENDP
AREA ||i.GPIO_ReadInputDataBit||, CODE, READONLY, ALIGN=1
GPIO_ReadInputDataBit PROC
;;;279 */
;;;280 uint8_t GPIO_ReadInputDataBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
000000 4602 MOV r2,r0
;;;281 {
;;;282 uint8_t bitstatus = 0x00;
000002 2000 MOVS r0,#0
;;;283
;;;284 /* Check the parameters */
;;;285 assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
;;;286 assert_param(IS_GET_GPIO_PIN(GPIO_Pin));
;;;287
;;;288 if ((GPIOx->IDR & GPIO_Pin) != (uint32_t)Bit_RESET)
000004 6893 LDR r3,[r2,#8]
000006 420b TST r3,r1
000008 d001 BEQ |L11.14|
;;;289 {
;;;290 bitstatus = (uint8_t)Bit_SET;
00000a 2001 MOVS r0,#1
00000c e000 B |L11.16|
|L11.14|
;;;291 }
;;;292 else
;;;293 {
;;;294 bitstatus = (uint8_t)Bit_RESET;
00000e 2000 MOVS r0,#0
|L11.16|
;;;295 }
;;;296 return bitstatus;
;;;297 }
000010 4770 BX lr
;;;298
ENDP
AREA ||i.GPIO_ReadOutputData||, CODE, READONLY, ALIGN=1
GPIO_ReadOutputData PROC
;;;341 */
;;;342 uint16_t GPIO_ReadOutputData(GPIO_TypeDef* GPIOx)
000000 4601 MOV r1,r0
;;;343 {
;;;344 /* Check the parameters */
;;;345 assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
;;;346
;;;347 return ((uint16_t)GPIOx->ODR);
000002 68c8 LDR r0,[r1,#0xc]
000004 b280 UXTH r0,r0
;;;348 }
000006 4770 BX lr
;;;349
ENDP
AREA ||i.GPIO_ReadOutputDataBit||, CODE, READONLY, ALIGN=1
GPIO_ReadOutputDataBit PROC
;;;318 */
;;;319 uint8_t GPIO_ReadOutputDataBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
000000 4602 MOV r2,r0
;;;320 {
;;;321 uint8_t bitstatus = 0x00;
000002 2000 MOVS r0,#0
;;;322 /* Check the parameters */
;;;323 assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
;;;324 assert_param(IS_GET_GPIO_PIN(GPIO_Pin));
;;;325
;;;326 if ((GPIOx->ODR & GPIO_Pin) != (uint32_t)Bit_RESET)
000004 68d3 LDR r3,[r2,#0xc]
000006 420b TST r3,r1
000008 d001 BEQ |L13.14|
;;;327 {
;;;328 bitstatus = (uint8_t)Bit_SET;
00000a 2001 MOVS r0,#1
00000c e000 B |L13.16|
|L13.14|
;;;329 }
;;;330 else
;;;331 {
;;;332 bitstatus = (uint8_t)Bit_RESET;
00000e 2000 MOVS r0,#0
|L13.16|
;;;333 }
;;;334 return bitstatus;
;;;335 }
000010 4770 BX lr
;;;336
ENDP
AREA ||i.GPIO_ResetBits||, CODE, READONLY, ALIGN=1
GPIO_ResetBits PROC
;;;372 */
;;;373 void GPIO_ResetBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
000000 6141 STR r1,[r0,#0x14]
;;;374 {
;;;375 /* Check the parameters */
;;;376 assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
;;;377 assert_param(IS_GPIO_PIN(GPIO_Pin));
;;;378
;;;379 GPIOx->BRR = GPIO_Pin;
;;;380 }
000002 4770 BX lr
;;;381
ENDP
AREA ||i.GPIO_SetBits||, CODE, READONLY, ALIGN=1
GPIO_SetBits PROC
;;;356 */
;;;357 void GPIO_SetBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
000000 6101 STR r1,[r0,#0x10]
;;;358 {
;;;359 /* Check the parameters */
;;;360 assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
;;;361 assert_param(IS_GPIO_PIN(GPIO_Pin));
;;;362
;;;363 GPIOx->BSRR = GPIO_Pin;
;;;364 }
000002 4770 BX lr
;;;365
ENDP
AREA ||i.GPIO_StructInit||, CODE, READONLY, ALIGN=1
GPIO_StructInit PROC
;;;264 */
;;;265 void GPIO_StructInit(GPIO_InitTypeDef* GPIO_InitStruct)
000000 f64f71ff MOV r1,#0xffff
;;;266 {
;;;267 /* Reset GPIO init structure parameters values */
;;;268 GPIO_InitStruct->GPIO_Pin = GPIO_Pin_All;
000004 8001 STRH r1,[r0,#0]
;;;269 GPIO_InitStruct->GPIO_Speed = GPIO_Speed_2MHz;
000006 2102 MOVS r1,#2
000008 7081 STRB r1,[r0,#2]
;;;270 GPIO_InitStruct->GPIO_Mode = GPIO_Mode_IN_FLOATING;
00000a 2104 MOVS r1,#4
00000c 70c1 STRB r1,[r0,#3]
;;;271 }
00000e 4770 BX lr
;;;272
ENDP
AREA ||i.GPIO_Write||, CODE, READONLY, ALIGN=1
GPIO_Write PROC
;;;415 */
;;;416 void GPIO_Write(GPIO_TypeDef* GPIOx, uint16_t PortVal)
000000 60c1 STR r1,[r0,#0xc]
;;;417 {
;;;418 /* Check the parameters */
;;;419 assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
;;;420
;;;421 GPIOx->ODR = PortVal;
;;;422 }
000002 4770 BX lr
;;;423
ENDP
AREA ||i.GPIO_WriteBit||, CODE, READONLY, ALIGN=1
GPIO_WriteBit PROC
;;;392 */
;;;393 void GPIO_WriteBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, BitAction BitVal)
000000 b10a CBZ r2,|L18.6|
;;;394 {
;;;395 /* Check the parameters */
;;;396 assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
;;;397 assert_param(IS_GET_GPIO_PIN(GPIO_Pin));
;;;398 assert_param(IS_GPIO_BIT_ACTION(BitVal));
;;;399
;;;400 if (BitVal != Bit_RESET)
;;;401 {
;;;402 GPIOx->BSRR = GPIO_Pin;
000002 6101 STR r1,[r0,#0x10]
000004 e000 B |L18.8|
|L18.6|
;;;403 }
;;;404 else
;;;405 {
;;;406 GPIOx->BRR = GPIO_Pin;
000006 6141 STR r1,[r0,#0x14]
|L18.8|
;;;407 }
;;;408 }
000008 4770 BX lr
;;;409
ENDP
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -