当前位置:网站首页>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 .
边栏推荐
- 没有从远程服务器‘‘映射到本地用户‘(null)/sa‘的远程用户‘sa‘及服务主密码解密错误的解决办法
- What is erdma? Popular science cartoon illustration
- STM32-DAC实验&高频DAC输出测试
- < schéma de développement de la machine d'exercice oral > machine d'exercice oral / trésor d'exercice oral / trésor de mathématiques pour enfants / lecteur LCD de calculatrice pour enfants IC - vk1621
- 关于Flink框架窗口(window)函数最全解析
- Multi rotor aircraft control using PID and LQR controllers
- Generally speaking, if the error of inconsistent tab and space occurs frequently
- 2022家用投影仪首选!当贝F5强悍音画效果带来极致视听体验
- NLA natural language analysis makes data analysis more intelligent
- Federated Search: all requirements in search
猜你喜欢
Fabric. JS free draw circle
Penetrate the remote connection database through the Intranet
c# 水晶报表打印
Essential elements of science fiction 3D scenes - City
Dangbei projection 4K laser projection X3 Pro received unanimous praise: 10000 yuan projector preferred
Daily learning 2
<口算練習機 方案開發原理圖>口算練習機/口算寶/兒童數學寶/兒童計算器 LCD液晶顯示驅動IC-VK1621B,提供技術支持
Do you know that there is an upper limit on the size of Oracle data files?
全屋Wi-Fi:一个谁也解决不好的痛点?
In 2021, the global styrene butadiene styrene (SBS) revenue was about $3722.7 million, and it is expected to reach $5679.6 million in 2028
随机推荐
Fabric.js 缩放画布
Route (II)
测试框架TestNG的使用(二):testNG xml的使用
Story point vs. Human Sky
[development environment] Dell computer system reinstallation (download Dell OS recovery tool | use Dell OS recovery tool to make USB flash disk system | install system)
[deep learning] simple implementation of neural network forward propagation
Borui data integrated intelligent observable platform was selected into the "Yunyuan production catalogue" of China Academy of communications in 2022
P1042 [NOIP2003 普及组] 乒乓球
P1042 [noip2003 popularization group] Table Tennis
Fabric. JS manual bold text iText
Yyds dry goods inventory software encryption lock function
There is no solution to the decryption error of the remote user 'sa' and the service master password mapped from the remote server 'to the local user' (null) /sa '
一般来讲,如果频繁出现inconsistent tab and space的报错
Fabric.js 上划线、中划线(删除线)、下划线
MySQL45讲——学习极客时间MySQL实战45讲笔记—— 05 | 深入浅出索引(下)
Using computed in uni app solves the abnormal display of data () value in tab switching
软件测试的方法
PHP linked list creation and traversal
全屋Wi-Fi:一个谁也解决不好的痛点?
[development environment] StarUML tool (download software | StarUML installation | StarUML creation project)