/*Configure GPIO pin : PA8 */ GPIO_InitStruct.Pin = GPIO_PIN_1; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); /* USER CODE BEGIN MX_GPIO_Init_2 */ /* U...
/*Configure GPIO pin : PtPin */GPIO_InitStruct.Pin = LED4_Pin;GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;GPIO_InitStruct.Pull = GPIO_NOPULL;GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;HAL_GPIO_Init(LED4_GPIO_Port, &GPIO_InitStru...
GPIO_InitTypeDefGPIO_InitStruct={0}; //GPIO时钟使能 __HAL_RCC_GPIOC_CLK_ENABLE(); //GPIO配置 GPIO_InitStruct.Pin=LED_PIN; GPIO_InitStruct.Mode=GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Speed=GPIO_SPEED_FREQ_LOW; HAL_GPIO_Init(LED_GPIO_PORT,&GPIO_InitStruct); //初始化GPIO引脚 HAL_GPIO_...
HAL_GPIO_Init(Y_LED_GPIO_Port,&GPIO_InitStruct); /*ConfigureGPIOpin:PtPin*/ GPIO_InitStruct.Pin=CP_LED_Pin; GPIO_InitStruct.Mode=GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Pull=GPIO_NOPULL; GPIO_InitStruct.Speed=GPIO_SPEED_FREQ_LOW; HAL_GPIO_Init(CP_LED_GPIO_Port,&GPIO_InitStruct); } ...
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct); /Configure GPIO pins : PD12 PD13 PD14 PD15/ GPIO_InitStruct.Pin = GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; ...
GPIO_InitStruct.Mode=GPIO_MODE_INPUT; GPIO_InitStruct.Pull=GPIO_PULLUP; HAL_GPIO_Init(GPIOD,&GPIO_InitStruct);/*Configure GPIO pins : PD12 PD13 PD14 PD15*/GPIO_InitStruct.Pin= GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15; ...
voidHAL_GPIO_Init(GPIO_TypeDef*GPIOx,GPIO_InitTypeDef*GPIO_Init); 功能:GPIO初始化 实例:HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); 代码语言:javascript 代码运行次数:0 运行 AI代码解释 voidHAL_GPIO_DeInit(GPIO_TypeDef*GPIOx,uint32_t GPIO_Pin); ...
PAPin*/GPIO_InitStruct.Pin= DONG_OUT_1_Pin|DONG_OUT_2_Pin;//两个GPIO_PINGPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;//推挽输出模式GPIO_InitStruct.Pull = GPIO_NOPULL;//浮空,不上拉也不下拉GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;//低速HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); ...
HAL_GPIO_Init(GPIO_TypeDef*GPIOx,GPIO_InitTypeDef*GPIO_Init)//GPIOx为引脚组名 其中最主要的参数就是struct GPIO_InitTypeDef这个结构体的配置 在STM32F1xx_HAL_GPIO.H这个文件中我们可以看到这个结构体所包含的成员 typedef struct { uint32_t Pin; /*!< 引脚设置 */ ...
GPIO_InitTypeDef GPIO_InitStruct = {0}; // 使能GPIO时钟 __HAL_RCC_GPIOA_CLK_ENABLE(); // 配置GPIO引脚 GPIO_InitStruct.Pin = GPIO_PIN_0; GPIO_InitStruct.Mode = GPIO_MODE_INPUT; GPIO_InitStruct.Pull = GPIO_NOPULL; // 或者GPIO_PULLUP/GPIO_PULLDOWN GPIO_InitStruct.Speed = GPIO_SPE...