当前位置:网站首页>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 .
边栏推荐
- Penetrate the remote connection database through the Intranet
- Go operation redis
- What is erdma? Popular science cartoon illustration
- Quarkus learning IV - project development to deployment
- 2、const 型指针
- 给Android程序员的一些面试建议「建议收藏」
- Golang 快速生成数据库表的 model 和 queryset
- Fabric. JS free drawing ellipse
- < 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
- PyQt5_ Qscrollarea content is saved as a picture
猜你喜欢

Fabric.js 上划线、中划线(删除线)、下划线

途家木鸟美团夏日折扣对垒,门槛低就一定香吗?

The use of TestNG, the testing framework (II): the use of TestNG XML

HMS core machine learning service helps zaful users to shop conveniently

Method of creating linked server for cross server data access

博睿数据一体化智能可观测平台入选中国信通院2022年“云原生产品名录”

Fabric.js 自由绘制圆形

Use of swagger

Quick analysis: easy to share the Internet

Fabric. JS upper dash, middle dash (strikethrough), underline
随机推荐
联合搜索:搜索中的所有需求
什么是 eRDMA?丨科普漫画图解
无主灯设计:如何让智能照明更加「智能」?
Fabric.js 自由绘制椭圆
Daily learning 3
STM32-DAC实验&高频DAC输出测试
Federated Search: all requirements in search
Design of non main lamp: how to make intelligent lighting more "intelligent"?
字符串匹配问题
P1042 [noip2003 popularization group] Table Tennis
途家木鸟美团夏日折扣对垒,门槛低就一定香吗?
腾讯云 TStor 统一存储通过信通院首批文件存储基础能力评测
Selenium element positioning method
Yyds dry goods inventory software encryption lock function
How many knowledge points can a callable interface have?
P1042 [NOIP2003 普及组] 乒乓球
Fabric.js 动态设置字号大小
提示:SQL Server 阻止了对组件‘Ad Hoc Distributed Queries ‘的STATEMENT ‘OpenRowset/OpenDatasource“”
默认插槽,具名插槽,作用域插槽
P1908 逆序对