当前位置:网站首页>STM32 library function for GPIO initialization
STM32 library function for GPIO initialization
2022-07-02 14:30:00 【Little BigUs】
The following two pieces of code should be equivalent , But I found that it is OK to initialize with the above code , You can't initialize with the following code , I don't know why .
void KEY_Init(void) {
GPIO_InitTypeDef GPIO_InitStruct;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOE, ENABLE);
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_3 | GPIO_Pin_4;
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_IPU;
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOE, &GPIO_InitStruct);
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_0;
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_IPD;
GPIO_Init(GPIOA, &GPIO_InitStruct);
}
void KEY_Init(void) {
GPIO_InitTypeDef *GPIO_InitStruct;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOE, ENABLE);
GPIO_InitStruct->GPIO_Pin = GPIO_Pin_3 | GPIO_Pin_4;
GPIO_InitStruct->GPIO_Mode = GPIO_Mode_IPU;
GPIO_InitStruct->GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOE, GPIO_InitStruct);
GPIO_InitStruct->GPIO_Pin = GPIO_Pin_0;
GPIO_InitStruct->GPIO_Mode = GPIO_Mode_IPD;
GPIO_Init(GPIOA, GPIO_InitStruct);
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
I am a pig ,
Defines a structure variable , But didn't let him point to the structure , Naturally, it's useless , Just change it to the above .
边栏推荐
- Fabric. JS upper dash, middle dash (strikethrough), underline
- In 2021, the global revenue of structural bolts was about $796.4 million, and it is expected to reach $1097.6 million in 2028
- Basic knowledge of QT original code
- How kaggle uses utility script
- 默认插槽,具名插槽,作用域插槽
- Do you know that there is an upper limit on the size of Oracle data files?
- Launcher startup process
- Systemserver process
- <口算练习机 方案开发原理图>口算练习机/口算宝/儿童数学宝/儿童计算器 LCD液晶显示驱动IC-VK1621B,提供技术支持
- Teamtalk source code analysis win client
猜你喜欢

Fabric. JS free draw circle

Systemserver process
![[development environment] StarUML tool (download software | StarUML installation | StarUML creation project)](/img/08/9f25515e600a3174340b2589c81b0e.jpg)
[development environment] StarUML tool (download software | StarUML installation | StarUML creation project)

Yyds dry goods inventory software encryption lock function

Analysis of CPU surge in production environment service

Essential elements of science fiction 3D scenes - City

万物生长大会在杭召开,当贝入选2022中国未来独角兽TOP100榜单

腾讯云 TStor 统一存储通过信通院首批文件存储基础能力评测
![[development environment] 010 editor tool (tool download | binary file analysis template template installation | shortcut key viewing and setting)](/img/de/7d70f513577e93f1bde1969935a29e.jpg)
[development environment] 010 editor tool (tool download | binary file analysis template template installation | shortcut key viewing and setting)

途家木鸟美团夏日折扣对垒,门槛低就一定香吗?
随机推荐
Method of creating linked server for cross server data access
Fabric.js 元素被选中时保持原有层级
千元投影小明Q1 Pro和极米NEW Play谁更好?和哈趣K1比哪款配置更高?
PHP linked list creation and traversal
In 2021, the global TCB adapter revenue was about $93 million, and it is expected to reach $315.5 million in 2028
Methods of software testing
Data consistency between redis and database
Fabric. JS upper dash, middle dash (strikethrough), underline
Qt新建项目
String matching problem
The most complete analysis of Flink frame window function
Fabric.js 手动加粗文本iText
Available solution development oral arithmetic training machine / math treasure / children's oral arithmetic treasure / intelligent math treasure LCD LCD driver ic-vk1622 (lqfp64 package), original te
2、const 型指针
MQ教程 | Exchange(交换机)
联合搜索:搜索中的所有需求
PyQt5_ Qscrollarea content is saved as a picture
Delete element (with transition animation)
路由(二)
Adhere to the foundation of 20 minutes go every day II