資源簡介
gpio初始化設置 對于stm32的控制有詳盡的描述
代碼片段和文件信息
#include?“stm32f0xx.h“
#include?“pid.h“
/*
霍爾輸入IO口采用PC0-PC2
*/
void?HALL_IN_GPIO_Config(void)
{
GPIO_InitTypeDef??GPIO_Initure;
GPIO_DeInit(GPIOC);????????????????????????????????????????//恢復GPIOC配置到缺省值
GPIO_Initure.GPIO_Pin=GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2;
GPIO_Initure.GPIO_Mode=GPIO_Mode_IN;
GPIO_Initure.GPIO_Speed=GPIO_Speed_2MHz;
GPIO_Initure.GPIO_OType=GPIO_OType_PP;
GPIO_Initure.GPIO_PuPd=GPIO_PuPd_NOPULL;
GPIO_Init(GPIOC&GPIO_Initure);
}
void?TIM_PWM_GPIO_Config(void)
{
/*?Private?typedef?---------------------------------------------------------*/
GPIO_InitTypeDef?GPIO_InitStruct;
/**?TIM1?GPIO?Configuration
?PA6 ?------>?TIM1_BKIN
?PA7 ?------>?TIM1_CH1N
?PB0 ?------>?TIM1_CH2N
?PB1 ?------>?TIM1_CH3N
?PA8 ?------>?TIM1_CH1
- 上一篇:window看門狗程序
- 下一篇:新生報到管理系統論文+源碼
評論
共有 條評論