GPIOB->CRH&=0XFF0FFFFF
时间: 2023-11-25 18:28:54 浏览: 38
GPIOB->CRH is a memory-mapped register in the STM32 microcontroller family that is used to configure the pins of GPIOB port in high-speed mode.
CRH stands for "configuration register high" and refers to the upper 16 bits of the GPIOB configuration register.
Each of these 16 bits corresponds to a pin on the GPIOB port, and can be programmed to control its speed, input/output mode, pull-up/pull-down resistors, and alternate function mapping.
GPIOB->CRH can be accessed and modified by writing to or reading from its memory address using the appropriate instructions in the programming language being used.
相关问题
GPIOB->CRH&=0XFF0FFFFF;GPIOB->CRL|=0X00800000;分析代码作用
这段代码作用是配置GPIOB的第13个引脚为推挽输出模式,速率为50MHz。具体实现方法是通过设置GPIOB的控制寄存器CRH和CRL的位来实现。其中,CRH设置高8位,CRL设置低8位。
详细解释如下:
GPIOB->CRH&=0XFF0FFFFF;
先将CRH寄存器中第13位清零,保留其他位不变。
GPIOB->CRL|=0X00800000;
将CRL寄存器中第13位设为1,表示配置为推挽输出模式。
GPIOB->CRH&=0XFF0FFFFF;GPIOB->CRL|=0X00800000;代码配置的是GPIOB的哪个引脚
这段代码配置了GPIOB的Pin13引脚为推挽输出模式,输出速率为50MHz。
其中,GPIOB->CRH&=0XFF0FFFFF;表示将GPIOB的高八位寄存器(CRH)中的第13位清零,即将Pin13引脚设置为推挽输出模式。
GPIOB->CRL|=0X00800000;表示将GPIOB的低八位寄存器(CRL)中的第13位设置为1,即将输出速率设置为50MHz。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)