2040 views|6 replies

411

Posts

9

Resources
The OP
 

Please help explain this procedure [Copy link]

  temp = ((uint32_t)(GPIO_AF) << ((uint32_t)((uint32_t)GPIO_PinSource & (uint32_t)0x07) * 4)) ; GPIOx->AFR[GPIO_PinSource >> 0x03] &= ~((uint32_t)0xF < < ((uint32_t)((uint32_t)GPIO_PinSource & (uint32_t)0x07) * 4)) ; temp_2 = GPIOx->AFR[GPIO_PinSource >> 0x03] | temp; GPIOx->AFR[GPIO_PinSource >> 0x03] = temp_2;
This post is from stm32/stm8

Latest reply

It seems that brother is really a beginner among beginners. It’s a very simple question. Come on young man, the road is still long. Take your time.,,  Details Published on 2018-7-20 10:53
 

1903

Posts

0

Resources
2
 

  temp = ((uint32_t)(GPIO_AF) << ((uint32_t)((uint32_t)GPIO_PinSource & (uint32_t)0x07) * 4)) ; Read the AF register value GPIOx->AFR[GPIO_PinSource >> 0x03] &= ~( (uint32_t)0xF << ((uint32_t)((uint32_t)GPIO_PinSource & (uint32_t)0x07) * 4)) ;Clear some bits temp_2 = GPIOx->AFR[GPIO_PinSource >> 0x03] | temp; GPIOx->AFR[GPIO_PinSource >> 0x03] = temp_2; The last two are very simple to assign values to the AFR register. Are you a beginner?
This post is from stm32/stm8

Comments

Then why 0x07*4?  Details Published on 2018-7-20 10:25
 
 

1903

Posts

0

Resources
3
 
It’s more comfortable to use register configuration. I feel dizzy just looking at these official ones. I don’t like them.
This post is from stm32/stm8

Comments

I also have a problem with the register register, #define DS18B20_IO_IN1() {GPIOA->MODER&= 0  Details Published on 2018-7-20 10:23
 
 

411

Posts

9

Resources
4
 
This post was last edited by shijizai at 2018-7-20 10:25
[ color=#999999]star_66666 published on 2018-7-20 10:11 It is more comfortable to use register configuration. I feel dizzy looking at these official ones. I don’t like it.
Register: congratulate: I also have a problem with the register, #define DS18B20_IO_IN1() {GPIOA->MODER&= 0<<30;GPIOA->MODER&= 0<<31;GPIOA->MODER|=0<<15* 2;} #define DS18B20_IO_OUT1() {GPIOA->MODER&= 0<<30;GPIOA->MODER&= 0<<31;GPIOA->MODER|=1<<15*2;} This is the operation of stm32F405, I I want to clear PA15 first and then assign a value. (Unfortunately, PA14 and PA13 next to PA15 are my download pins.) Master, see if there is something wrong in these two sentences. I can't burn the program into the program board when I click on it. After downloading this program, the board can no longer burn programs: Cry:
This post is from stm32/stm8
 
 
 

411

Posts

9

Resources
5
 
star_66666 Published on 2018-7-20 10:10 temp = ((uint32_t)(GPIO_AF) AFR[GPIO_PinSource >> 0x03] &= ~((uint32_t)0xF AFR[GPIO_PinSource >> ...
Then why 0x07*4?
This post is from stm32/stm8
 
 
 

1903

Posts

0

Resources
6
 
It seems that brother is really a beginner among beginners. It’s a very simple question. Come on young man, the road is still long. Take your time.,,
This post is from stm32/stm8
 
 
 

411

Posts

9

Resources
7
 
Is there anyone passing by? Give Xiaobai a thumbs up~
This post is from stm32/stm8
 
 
 

Guess Your Favourite
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list