GPIOB->ODR |= 1<<15
时间: 2023-11-12 10:05:09 浏览: 155
2.2 寄存器方式点亮LED.rar
这段代码的作用是将GPIOB的ODR寄存器的第15位设置为1。具体来说,代码中的`1<<15`表示将二进制数1左移15位,即得到二进制数10000000000000000。然后,通过`|=`操作符将这个二进制数与GPIOB的ODR寄存器进行按位或操作,将第15位设置为1。最终的结果是将GPIOB的ODR寄存器的第15位设置为1。\[3\]
#### 引用[.reference_title]
- *1* [STM32的GPIO的寄存器配置学习1](https://blog.csdn.net/qq_21990661/article/details/104749416)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [GPIO 配置之ODR, BSRR, BRR 详解](https://blog.csdn.net/byhunpo/article/details/88996657)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [对 GPIOB_ODR|=(1<<10) GPIOB_ODR&=~(1<<10)的理解](https://blog.csdn.net/qq_57064185/article/details/119870019)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文