当前位置:网站首页>STM32 register
STM32 register
2022-06-30 07:28:00 【weixin_ forty-six million one thousand two hundred and twenty-o】


#define RCC_APB2ENR *((volatile unsigned int *) (0x40021000 + 0x18))
RCC_APB2ENR |= 1<<3;


CRH Is the control high octet pin
CRL Is the control low octet pin
// Configure push-pull output
GPIOB_CRH |= (3<<45); // Set up 3=11 Output maximum speed 50MHZ 45 Indicates which bit to control

GPIOB_BSRR=(1<<(16+5)); // Control which pin , low 16 position =1 Is a high level , high 16 position =1 Is a low level
//GPIOB_ODR&=~(1<<5); // also ODR Which pin is directly set 1 perhaps 0,1 High level ,0 Low level 

So for STM32 How to make GPIOB The port realizes all output high levels ?
GPIOB The address is 0x4001 0C00 - 0x4001 0FFF, however GPIOB These addresses allocate many registers , Assigned to 16 Bit port output data register (GPIOx_ODR) The address offset of is 0x0C,
1、 Access by absolute address :
//GPIOB All ports output High level 
1
2
Where register address = Base address + offset
0x4001 0C00 + 0x0C = 0x40010C0C
(unsigned int*) Type cast to int * The pointer







边栏推荐
- Network security - detailed explanation of VLAN and tunk methods
- Matter protocol
- Idea running run and services
- Starting MySQL ERROR! Couldn‘t find MySQL server (/usr/local/mysql/bin/mysqld_safe)
- Record the problem that the system file cannot be modified as an administrator during the development process
- nRF52832 GPIO LED
- Detailed methods for copying local computer files to virtual machine system
- The maximum expression in Oracle database message list is 1000 error
- 套接字socket编程——UDP
- [introduction to Expo application] v Expert recommendation letter template
猜你喜欢

大学刚毕业不知道做什么工作怎么办?

C51 minimum system board infrared remote control LED light on and off

Starting MySQL ERROR! Couldn‘t find MySQL server (/usr/local/mysql/bin/mysqld_safe)

Implementation of double linked list in C language

The maximum expression in Oracle database message list is 1000 error

期末复习-PHP学习笔记9-PHP会话控制

Stm32g0 Tim interrupt use

Use of ecostruxure (2) IEC61499 to establish function blocks

Calculation and parameter quantity of neural network

28 rounds of interviews with 10 companies in two and a half years
随机推荐
Basic knowledge of compiling learning records
PMIC power management
app quits unexpectedly
Proteus catalog component names and Chinese English cross reference table
Network security - packet capture and IP packet header analysis
Introduction to go language pointer
The maximum expression in Oracle database message list is 1000 error
Detailed methods for copying local computer files to virtual machine system
Binary tree traversal
手机开户股票开户安全吗?开户需要准备什么?
视频播放器(二):视频解码
Promise async/await
动态内存管理
Win10 step pit - power on 0xc0000225
next InitializeSecurityContext failed: Unknown error (0x80092012) - 吊销功能无法检查证书是否吊销。
单测调用对象的私有方法
[most complete] install MySQL on a Linux server
[resolved] error 1290 (HY000): unknown error 1290
Assembly learning register
Network security ARP protocol and defense