当前位置:网站首页>Gpiof6, 7, 8 configuration
Gpiof6, 7, 8 configuration
2022-07-03 09:52:00 【0725 you Guangchuan】
- GPIO To configure
To configure GIPO Through this picture To configure

To configure GIPO Input and output mode configuration method
1、 Configure pins ,2、 To configure GPIO The input of 、 Output 、 Alternative models 、3、 Logical mode 、 Pattern 、 To configure GPIO The speed of *,4、 Configure push-pull / Open a leak ( Output ),5、 To configure ( Pull up / The drop-down *)
Define a GPIO_InitTypeDef Type of structure *
GPIO_InitTypeDef GPIO_InitStructure;
typedef struct
{
uint32_t GPIO_Pin; /* To configure GPIO The pin of */
GPIOMode_TypeDef GPIO_Mode; /* To configure GPIO The input of 、 Output 、 Alternative models 、 Logical mode 、 Pattern */
GPIOSpeed_TypeDef GPIO_Speed; / To configure GPIO The speed of /
GPIOOType_TypeDef GPIO_OType; /* push-pull / Open a leak */
GPIOPuPd_TypeDef GPIO_PuPd; / Pull up / The drop-down /
}GPIO_InitTypeDef;
The programming is as follows
To configure GPIOF_6,GPIOF_7,GPIOF_8 The output mode
void LED_GPIO_Config(void)
{
/ Define a GPIO_InitTypeDef Type of structure /
GPIO_InitTypeDef GPIO_InitStructure;
/* Turn on LED dependent GPIO Peripheral clock */
RCC_AHB1PeriphClockCmd ( LED1_GPIO_CLK|
LED2_GPIO_CLK|
LED3_GPIO_CLK, ENABLE); // RCC->AHB1ENR |= RCC_AHB1Periph;
/* Choose what you want to control GPIO Pin */
GPIO_InitStructure.GPIO_Pin = LED1_PIN;//GPIO_Pin_6
/* Set pin mode to output mode */
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
/* Set the output type of the pin to push-pull output */
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
/* Set the pin to pull-up mode */
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
/* Set the pin rate to 2MHz */
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
/* Call library function , Use the GPIO_InitStructure initialization GPIO*/
GPIO_Init(LED1_GPIO_PORT, &GPIO_InitStructure);
/* Choose what you want to control GPIO Pin */
GPIO_InitStructure.GPIO_Pin = LED2_PIN;//GPIO_Pin_7
GPIO_Init(LED2_GPIO_PORT, &GPIO_InitStructure);
/* Choose what you want to control GPIO Pin */
GPIO_InitStructure.GPIO_Pin = LED3_PIN; //GPIO_Pin_8
GPIO_Init(LED3_GPIO_PORT, &GPIO_InitStructure); To configure GIOP The pattern of
/* close RGB The lamp */
LED_RGBOFF; // The relevant output is 1
}
边栏推荐
- [combinatorics] Introduction to Combinatorics (context of combinatorics | skills of combinatorics | thought of combinatorics 1: one-to-one correspondence)
- Basic knowledge of MySQL database (an introduction to systematization)
- Find all possible recipes from given supplies
- 【力扣刷题笔记(二)】特别技巧,模块突破,45道经典题目分类总结,在不断巩固中精进
- 在三线城市、在县城,很难毕业就拿到10K
- IDEA远程断点调试jar包项目
- Development of fire power monitoring system
- STM32 serial communication principle
- JMX、MBean、MXBean、MBeanServer 入门
- Install local sources using yum
猜你喜欢

How MySQL modifies null to not null

MySQL environment variable configuration

numpy. Reshape() and resize() functions

Which language should I choose to program for single chip microcomputer

Nr-prach: access scenario and access process

I didn't think so much when I was in the field of single chip microcomputer. I just wanted to earn money to support myself first

How does the memory database give full play to the advantages of memory?

Project cost management__ Topic of comprehensive calculation

Electronic product design, MCU development, circuit cloning

Error output redirection
随机推荐
单片机学到什么程度能找到工作,这个标准不好量化
【顺利毕业】[1]-游览 [学生管理信息系统]
应用最广泛的8位单片机当然也是初学者们最容易上手学习的单片机
Design and development of biological instruments
[male nanny style] teach you to open the first wechat applet
Fundamentals of Electronic Technology (III)__ Chapter 1 resistance of parallel circuit
PRACH --- originator
CEF download, compile project
Error output redirection
嵌入式系统没有特别明确的定义
Qt QComboBox QSS样式设置
[combinatorics] Introduction to Combinatorics (combinatorial thought 2: mathematical induction | mathematical induction promotion | multiple induction thought)
编程思想比任何都重要,不是比谁多会用几个函数而是比程序的理解
Programming ideas are more important than anything, not more than who can use several functions, but more than the understanding of the program
开学实验里要用到mysql,忘记基本的select语句怎么玩啦?补救来啦~
Leetcode daily question (745. prefix and suffix search)
Leetcode daily question (931. minimum falling path sum)
Leetcode daily question (2090. K radius subarray averages)
The cyclic shift of PUCCH in NR channel is generated by MATLAB
MySQL 数据库基础知识(系统化一篇入门)