📄 stm32f10x_gpio.lst
字号:
\ 000000EC 1CFA04FC LSLS R12,R12,R4
\ 000000F0 6646 MOV R6,R12
240 tmpreg &= ~pinmask;
\ 000000F2 B543 BICS R5,R5,R6
241 /* Write the mode configuration in the corresponding bits */
242 tmpreg |= (currentmode << pos);
\ 000000F4 17FA04FC LSLS R12,R7,R4
\ 000000F8 5CEA0505 ORRS R5,R12,R5
243 /* Reset the corresponding ODR bit */
244 if (GPIO_InitStruct->GPIO_Mode == GPIO_Mode_IPD)
\ 000000FC 91F803C0 LDRB R12,[R1, #+3]
\ 00000100 BCF1280F CMP R12,#+40
\ 00000104 07D1 BNE.N ??GPIO_Init_10
245 {
246 GPIOx->BRR = (((uint32_t)0x01) << (pinpos + 0x08));
\ 00000106 5FF0010C MOVS R12,#+1
\ 0000010A 13F1080E ADDS LR,R3,#+8
\ 0000010E 1CFA0EFC LSLS R12,R12,LR
\ 00000112 C0F814C0 STR R12,[R0, #+20]
247 }
248 /* Set the corresponding ODR bit */
249 if (GPIO_InitStruct->GPIO_Mode == GPIO_Mode_IPU)
\ ??GPIO_Init_10:
\ 00000116 91F803C0 LDRB R12,[R1, #+3]
\ 0000011A BCF1480F CMP R12,#+72
\ 0000011E 07D1 BNE.N ??GPIO_Init_9
250 {
251 GPIOx->BSRR = (((uint32_t)0x01) << (pinpos + 0x08));
\ 00000120 5FF0010C MOVS R12,#+1
\ 00000124 13F1080E ADDS LR,R3,#+8
\ 00000128 1CFA0EFC LSLS R12,R12,LR
\ 0000012C C0F810C0 STR R12,[R0, #+16]
252 }
253 }
254 }
\ ??GPIO_Init_9:
\ 00000130 5B1C ADDS R3,R3,#+1
\ 00000132 C6E7 B.N ??GPIO_Init_7
255 GPIOx->CRH = tmpreg;
\ ??GPIO_Init_8:
\ 00000134 4560 STR R5,[R0, #+4]
256 }
257 }
\ ??GPIO_Init_6:
\ 00000136 F0BD POP {R4-R7,PC} ;; return
258
259 /**
260 * @brief Fills each GPIO_InitStruct member with its default value.
261 * @param GPIO_InitStruct : pointer to a GPIO_InitTypeDef structure which will
262 * be initialized.
263 * @retval None
264 */
\ In section .text, align 2, keep-with-next
265 void GPIO_StructInit(GPIO_InitTypeDef* GPIO_InitStruct)
266 {
267 /* Reset GPIO init structure parameters values */
268 GPIO_InitStruct->GPIO_Pin = GPIO_Pin_All;
\ GPIO_StructInit:
\ 00000000 4FF6FF71 MOVW R1,#+65535
\ 00000004 0180 STRH R1,[R0, #+0]
269 GPIO_InitStruct->GPIO_Speed = GPIO_Speed_2MHz;
\ 00000006 0221 MOVS R1,#+2
\ 00000008 8170 STRB R1,[R0, #+2]
270 GPIO_InitStruct->GPIO_Mode = GPIO_Mode_IN_FLOATING;
\ 0000000A 0421 MOVS R1,#+4
\ 0000000C C170 STRB R1,[R0, #+3]
271 }
\ 0000000E 7047 BX LR ;; return
272
273 /**
274 * @brief Reads the specified input port pin.
275 * @param GPIOx: where x can be (A..G) to select the GPIO peripheral.
276 * @param GPIO_Pin: specifies the port bit to read.
277 * This parameter can be GPIO_Pin_x where x can be (0..15).
278 * @retval The input port pin value.
279 */
\ In section .text, align 2, keep-with-next
280 uint8_t GPIO_ReadInputDataBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
281 {
\ GPIO_ReadInputDataBit:
\ 00000000 0200 MOVS R2,R0
282 uint8_t bitstatus = 0x00;
\ 00000002 0020 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)
\ 00000004 9368 LDR R3,[R2, #+8]
\ 00000006 9BB2 UXTH R3,R3 ;; ZeroExt R3,R3,#+16,#+16
\ 00000008 0B42 TST R3,R1
\ 0000000A 02D0 BEQ.N ??GPIO_ReadInputDataBit_0
289 {
290 bitstatus = (uint8_t)Bit_SET;
\ 0000000C 0123 MOVS R3,#+1
\ 0000000E 1800 MOVS R0,R3
\ 00000010 01E0 B.N ??GPIO_ReadInputDataBit_1
291 }
292 else
293 {
294 bitstatus = (uint8_t)Bit_RESET;
\ ??GPIO_ReadInputDataBit_0:
\ 00000012 0023 MOVS R3,#+0
\ 00000014 1800 MOVS R0,R3
295 }
296 return bitstatus;
\ ??GPIO_ReadInputDataBit_1:
\ 00000016 C0B2 UXTB R0,R0 ;; ZeroExt R0,R0,#+24,#+24
\ 00000018 7047 BX LR ;; return
297 }
298
299 /**
300 * @brief Reads the specified GPIO input data port.
301 * @param GPIOx: where x can be (A..G) to select the GPIO peripheral.
302 * @retval GPIO input data port value.
303 */
\ In section .text, align 2, keep-with-next
304 uint16_t GPIO_ReadInputData(GPIO_TypeDef* GPIOx)
305 {
306 /* Check the parameters */
307 assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
308
309 return ((uint16_t)GPIOx->IDR);
\ GPIO_ReadInputData:
\ 00000000 8068 LDR R0,[R0, #+8]
\ 00000002 80B2 UXTH R0,R0 ;; ZeroExt R0,R0,#+16,#+16
\ 00000004 7047 BX LR ;; return
310 }
311
312 /**
313 * @brief Reads the specified output data port bit.
314 * @param GPIOx: where x can be (A..G) to select the GPIO peripheral.
315 * @param GPIO_Pin: specifies the port bit to read.
316 * This parameter can be GPIO_Pin_x where x can be (0..15).
317 * @retval The output port pin value.
318 */
\ In section .text, align 2, keep-with-next
319 uint8_t GPIO_ReadOutputDataBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
320 {
\ GPIO_ReadOutputDataBit:
\ 00000000 0200 MOVS R2,R0
321 uint8_t bitstatus = 0x00;
\ 00000002 0020 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)
\ 00000004 D368 LDR R3,[R2, #+12]
\ 00000006 9BB2 UXTH R3,R3 ;; ZeroExt R3,R3,#+16,#+16
\ 00000008 0B42 TST R3,R1
\ 0000000A 02D0 BEQ.N ??GPIO_ReadOutputDataBit_0
327 {
328 bitstatus = (uint8_t)Bit_SET;
\ 0000000C 0123 MOVS R3,#+1
\ 0000000E 1800 MOVS R0,R3
\ 00000010 01E0 B.N ??GPIO_ReadOutputDataBit_1
329 }
330 else
331 {
332 bitstatus = (uint8_t)Bit_RESET;
\ ??GPIO_ReadOutputDataBit_0:
\ 00000012 0023 MOVS R3,#+0
\ 00000014 1800 MOVS R0,R3
333 }
334 return bitstatus;
\ ??GPIO_ReadOutputDataBit_1:
\ 00000016 C0B2 UXTB R0,R0 ;; ZeroExt R0,R0,#+24,#+24
\ 00000018 7047 BX LR ;; return
335 }
336
337 /**
338 * @brief Reads the specified GPIO output data port.
339 * @param GPIOx: where x can be (A..G) to select the GPIO peripheral.
340 * @retval GPIO output data port value.
341 */
\ In section .text, align 2, keep-with-next
342 uint16_t GPIO_ReadOutputData(GPIO_TypeDef* GPIOx)
343 {
344 /* Check the parameters */
345 assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
346
347 return ((uint16_t)GPIOx->ODR);
\ GPIO_ReadOutputData:
\ 00000000 C068 LDR R0,[R0, #+12]
\ 00000002 80B2 UXTH R0,R0 ;; ZeroExt R0,R0,#+16,#+16
\ 00000004 7047 BX LR ;; return
348 }
349
350 /**
351 * @brief Sets the selected data port bits.
352 * @param GPIOx: where x can be (A..G) to select the GPIO peripheral.
353 * @param GPIO_Pin: specifies the port bits to be written.
354 * This parameter can be any combination of GPIO_Pin_x where x can be (0..15).
355 * @retval None
356 */
\ In section .text, align 2, keep-with-next
357 void GPIO_SetBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
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;
\ GPIO_SetBits:
\ 00000000 89B2 UXTH R1,R1 ;; ZeroExt R1,R1,#+16,#+16
\ 00000002 0161 STR R1,[R0, #+16]
364 }
\ 00000004 7047 BX LR ;; return
365
366 /**
367 * @brief Clears the selected data port bits.
368 * @param GPIOx: where x can be (A..G) to select the GPIO peripheral.
369 * @param GPIO_Pin: specifies the port bits to be written.
370 * This parameter can be any combination of GPIO_Pin_x where x can be (0..15).
371 * @retval None
372 */
\ In section .text, align 2, keep-with-next
373 void GPIO_ResetBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
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;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -