📄 stm32f10x_gpio.s79
字号:
CFI Block cfiBlock4 Using cfiCommon0
CFI Function GPIO_ReadInputDataBit
THUMB
// 243 u8 GPIO_ReadInputDataBit(GPIO_TypeDef* GPIOx, u16 GPIO_Pin)
// 244 {
GPIO_ReadInputDataBit:
PUSH {LR}
CFI ?RET Frame(CFA, -4)
CFI CFA R13+4
// 245 u8 bitstatus = 0x00;
// 246
// 247 /* Check the parameters */
// 248 assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
// 249 assert_param(IS_GET_GPIO_PIN(GPIO_Pin));
// 250
// 251 if ((GPIOx->IDR & GPIO_Pin) != (u32)Bit_RESET)
LDR R0,[R0, #+8]
TST R0,R1
ITT NE
// 252 {
// 253 bitstatus = (u8)Bit_SET;
MOVNE R0,#+1
POPNE {PC}
// 254 }
// 255 else
// 256 {
// 257 bitstatus = (u8)Bit_RESET;
MOVS R0,#+0
// 258 }
// 259 return bitstatus;
POP {PC} ;; return
CFI EndBlock cfiBlock4
// 260 }
// 261
// 262 /*******************************************************************************
// 263 * Function Name : GPIO_ReadInputData
// 264 * Description : Reads the specified GPIO input data port.
// 265 * Input : - GPIOx: where x can be (A..G) to select the GPIO peripheral.
// 266 * Output : None
// 267 * Return : GPIO input data port value.
// 268 *******************************************************************************/
RSEG CODE:CODE:NOROOT(2)
CFI Block cfiBlock5 Using cfiCommon0
CFI Function GPIO_ReadInputData
THUMB
// 269 u16 GPIO_ReadInputData(GPIO_TypeDef* GPIOx)
// 270 {
// 271 /* Check the parameters */
// 272 assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
// 273
// 274 return ((u16)GPIOx->IDR);
GPIO_ReadInputData:
LDR R0,[R0, #+8]
UXTH R0,R0
BX LR ;; return
CFI EndBlock cfiBlock5
// 275 }
// 276
// 277 /*******************************************************************************
// 278 * Function Name : GPIO_ReadOutputDataBit
// 279 * Description : Reads the specified output data port bit.
// 280 * Input : - GPIOx: where x can be (A..G) to select the GPIO peripheral.
// 281 * : - GPIO_Pin: specifies the port bit to read.
// 282 * This parameter can be GPIO_Pin_x where x can be (0..15).
// 283 * Output : None
// 284 * Return : The output port pin value.
// 285 *******************************************************************************/
RSEG CODE:CODE:NOROOT(2)
CFI Block cfiBlock6 Using cfiCommon0
CFI Function GPIO_ReadOutputDataBit
THUMB
// 286 u8 GPIO_ReadOutputDataBit(GPIO_TypeDef* GPIOx, u16 GPIO_Pin)
// 287 {
GPIO_ReadOutputDataBit:
PUSH {LR}
CFI ?RET Frame(CFA, -4)
CFI CFA R13+4
// 288 u8 bitstatus = 0x00;
// 289
// 290 /* Check the parameters */
// 291 assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
// 292 assert_param(IS_GET_GPIO_PIN(GPIO_Pin));
// 293
// 294 if ((GPIOx->ODR & GPIO_Pin) != (u32)Bit_RESET)
LDR R0,[R0, #+12]
TST R0,R1
ITT NE
// 295 {
// 296 bitstatus = (u8)Bit_SET;
MOVNE R0,#+1
POPNE {PC}
// 297 }
// 298 else
// 299 {
// 300 bitstatus = (u8)Bit_RESET;
MOVS R0,#+0
// 301 }
// 302 return bitstatus;
POP {PC} ;; return
CFI EndBlock cfiBlock6
// 303 }
// 304
// 305 /*******************************************************************************
// 306 * Function Name : GPIO_ReadOutputData
// 307 * Description : Reads the specified GPIO output data port.
// 308 * Input : - GPIOx: where x can be (A..G) to select the GPIO peripheral.
// 309 * Output : None
// 310 * Return : GPIO output data port value.
// 311 *******************************************************************************/
RSEG CODE:CODE:NOROOT(2)
CFI Block cfiBlock7 Using cfiCommon0
CFI Function GPIO_ReadOutputData
THUMB
// 312 u16 GPIO_ReadOutputData(GPIO_TypeDef* GPIOx)
// 313 {
// 314 /* Check the parameters */
// 315 assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
// 316
// 317 return ((u16)GPIOx->ODR);
GPIO_ReadOutputData:
LDR R0,[R0, #+12]
UXTH R0,R0
BX LR ;; return
CFI EndBlock cfiBlock7
// 318 }
// 319
// 320 /*******************************************************************************
// 321 * Function Name : GPIO_SetBits
// 322 * Description : Sets the selected data port bits.
// 323 * Input : - GPIOx: where x can be (A..G) to select the GPIO peripheral.
// 324 * - GPIO_Pin: specifies the port bits to be written.
// 325 * This parameter can be any combination of GPIO_Pin_x where
// 326 * x can be (0..15).
// 327 * Output : None
// 328 * Return : None
// 329 *******************************************************************************/
RSEG CODE:CODE:NOROOT(2)
CFI Block cfiBlock8 Using cfiCommon0
CFI Function GPIO_SetBits
THUMB
// 330 void GPIO_SetBits(GPIO_TypeDef* GPIOx, u16 GPIO_Pin)
// 331 {
// 332 /* Check the parameters */
// 333 assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
// 334 assert_param(IS_GPIO_PIN(GPIO_Pin));
// 335
// 336 GPIOx->BSRR = GPIO_Pin;
GPIO_SetBits:
STR R1,[R0, #+16]
// 337 }
BX LR ;; return
CFI EndBlock cfiBlock8
// 338
// 339 /*******************************************************************************
// 340 * Function Name : GPIO_ResetBits
// 341 * Description : Clears the selected data port bits.
// 342 * Input : - GPIOx: where x can be (A..G) to select the GPIO peripheral.
// 343 * - GPIO_Pin: specifies the port bits to be written.
// 344 * This parameter can be any combination of GPIO_Pin_x where
// 345 * x can be (0..15).
// 346 * Output : None
// 347 * Return : None
// 348 *******************************************************************************/
RSEG CODE:CODE:NOROOT(2)
CFI Block cfiBlock9 Using cfiCommon0
CFI Function GPIO_ResetBits
THUMB
// 349 void GPIO_ResetBits(GPIO_TypeDef* GPIOx, u16 GPIO_Pin)
// 350 {
// 351 /* Check the parameters */
// 352 assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
// 353 assert_param(IS_GPIO_PIN(GPIO_Pin));
// 354
// 355 GPIOx->BRR = GPIO_Pin;
GPIO_ResetBits:
STR R1,[R0, #+20]
// 356 }
BX LR ;; return
CFI EndBlock cfiBlock9
// 357
// 358 /*******************************************************************************
// 359 * Function Name : GPIO_WriteBit
// 360 * Description : Sets or clears the selected data port bit.
// 361 * Input : - GPIOx: where x can be (A..G) to select the GPIO peripheral.
// 362 * - GPIO_Pin: specifies the port bit to be written.
// 363 * This parameter can be one of GPIO_Pin_x where x can be (0..15).
// 364 * - BitVal: specifies the value to be written to the selected bit.
// 365 * This parameter can be one of the BitAction enum values:
// 366 * - Bit_RESET: to clear the port pin
// 367 * - Bit_SET: to set the port pin
// 368 * Output : None
// 369 * Return : None
// 370 *******************************************************************************/
RSEG CODE:CODE:NOROOT(2)
CFI Block cfiBlock10 Using cfiCommon0
CFI Function GPIO_WriteBit
THUMB
// 371 void GPIO_WriteBit(GPIO_TypeDef* GPIOx, u16 GPIO_Pin, BitAction BitVal)
// 372 {
// 373 /* Check the parameters */
// 374 assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
// 375 assert_param(IS_GET_GPIO_PIN(GPIO_Pin));
// 376 assert_param(IS_GPIO_BIT_ACTION(BitVal));
// 377
// 378 if (BitVal != Bit_RESET)
GPIO_WriteBit:
CBZ R2,??GPIO_WriteBit_0
// 379 {
// 380 GPIOx->BSRR = GPIO_Pin;
STR R1,[R0, #+16]
BX LR
// 381 }
// 382 else
// 383 {
// 384 GPIOx->BRR = GPIO_Pin;
??GPIO_WriteBit_0:
STR R1,[R0, #+20]
// 385 }
// 386 }
BX LR ;; return
CFI EndBlock cfiBlock10
// 387
// 388 /*******************************************************************************
// 389 * Function Name : GPIO_Write
// 390 * Description : Writes data to the specified GPIO data port.
// 391 * Input : - GPIOx: where x can be (A..G) to select the GPIO peripheral.
// 392 * - PortVal: specifies the value to be written to the port output
// 393 * data register.
// 394 * Output : None
// 395 * Return : None
// 396 *******************************************************************************/
RSEG CODE:CODE:NOROOT(2)
CFI Block cfiBlock11 Using cfiCommon0
CFI Function GPIO_Write
THUMB
// 397 void GPIO_Write(GPIO_TypeDef* GPIOx, u16 PortVal)
// 398 {
// 399 /* Check the parameters */
// 400 assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
// 401
// 402 GPIOx->ODR = PortVal;
GPIO_Write:
STR R1,[R0, #+12]
// 403 }
BX LR ;; return
CFI EndBlock cfiBlock11
// 404
// 405 /*******************************************************************************
// 406 * Function Name : GPIO_PinLockConfig
// 407 * Description : Locks GPIO Pins configuration registers.
// 408 * Input : - GPIOx: where x can be (A..G) to select the GPIO peripheral.
// 409 * - GPIO_Pin: specifies the port bit to be written.
// 410 * This parameter can be any combination of GPIO_Pin_x where
// 411 * x can be (0..15).
// 412 * Output : None
// 413 * Return : None
// 414 *******************************************************************************/
RSEG CODE:CODE:NOROOT(2)
CFI Block cfiBlock12 Using cfiCommon0
CFI Function GPIO_PinLockConfig
THUMB
// 415 void GPIO_PinLockConfig(GPIO_TypeDef* GPIOx, u16 GPIO_Pin)
// 416 {
// 417 u32 tmp = 0x00010000;
// 418
// 419 /* Check the parameters */
// 420 assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
// 421 assert_param(IS_GPIO_PIN(GPIO_Pin));
// 422
// 423 tmp |= GPIO_Pin;
GPIO_PinLockConfig:
ORRS R2,R1,#0x10000
// 424 /* Set LCKK bit */
// 425 GPIOx->LCKR = tmp;
STR R2,[R0, #+24]
// 426 /* Reset LCKK bit */
// 427 GPIOx->LCKR = GPIO_Pin;
STR R1,[R0, #+24]
// 428 /* Set LCKK bit */
// 429 GPIOx->LCKR = tmp;
STR R2,[R0, #+24]
// 430 /* Read LCKK bit*/
// 431 tmp = GPIOx->LCKR;
LDR R1,[R0, #+24]
// 432 /* Read LCKK bit*/
// 433 tmp = GPIOx->LCKR;
LDR R0,[R0, #+24]
// 434 }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -