当前位置:网站首页>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
}
边栏推荐
- Getting started with shell programming
- Leetcode daily question (2305. fair distribution of cookies)
- SCM career development: those who can continue to do it have become great people. If they can't endure it, they will resign or change their careers
- Epollet lessons
- IDEA远程断点调试jar包项目
- 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
- Chromium Embedded Framework (CEF) 介绍
- PRACH --- originator
- 1300. sum of varied array closed to target
- Find all possible recipes from given supplies
猜你喜欢
Seven sorting of ten thousand words by hand (code + dynamic diagram demonstration)
How does the nr-prach receiver detect the relationship between prembleid and Ta
Fundamentals of Electronic Technology (III)__ Fundamentals of circuit analysis__ Basic amplifier operating principle
端午节快乐!—— canvas写的粽子~~~~~
Characteristics of PUCCH formats
Project cost management__ Topic of comprehensive calculation
STM32 serial communication principle
Code word in NR
Leetcode daily question (2090. K radius subarray averages)
Nodemcu-esp8266 development (vscode+platformio+arduino framework): Part 4 --blinker_ DHT_ WiFi (lighting technology app control + temperature and humidity data app display)
随机推荐
Leetcode daily question (1162. as far from land as possible)
要选择那种语言为单片机编写程序呢
Hal library sets STM32 clock
单片机现在可谓是铺天盖地,种类繁多,让开发者们应接不暇
MySQL Data Definition Language DDL common commands
[combinatorics] Introduction to Combinatorics (combinatorial thought 2: mathematical induction | mathematical induction promotion | multiple induction thought)
Flink learning notes (XI) table API and SQL
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
内存数据库究竟是如何发挥内存优势的?
Development of electrical fire system
新系列单片机还延续了STM32产品家族的低电压和节能两大优势
Raspberry pie installation SciPy
Find all possible recipes from given supplies
CEF下载,编译工程
Convert IP address to int
单片机职业发展:能做下去的都成牛人了,熬不动就辞职或者改行了
SCM career development: those who can continue to do it have become great people. If they can't endure it, they will resign or change their careers
Education is a pass and ticket. With it, you can step into a higher-level environment
Fundamentals of Electronic Technology (III)__ Chapter 1 resistance of parallel circuit
【力扣刷题笔记(二)】特别技巧,模块突破,45道经典题目分类总结,在不断巩固中精进