优化中,生成HEX文件

This commit is contained in:
2021-10-24 11:04:21 +08:00
parent 230f928a0f
commit b8bf07f4cf
27 changed files with 3005 additions and 3072 deletions
+26
View File
@@ -0,0 +1,26 @@
/*
* gpio.c
*
* Created on: Oct 24, 2021
* Author: wuwenfeng
*/
#include "gpio.h"
void change_io_function(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin,char a)
{
GPIO_InitTypeDef GPIO_InitStruct;
GPIO_InitStruct.Pin = GPIO_Pin;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
if(a==1)
{
GPIO_InitStruct.Pull = GPIO_PULLUP;
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
}
if(a==0)
{
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
}
HAL_GPIO_Init(GPIOx, &GPIO_InitStruct);
}