如何在 STM32 Arduino (PlatformIO) 中设置引脚速度/备用功能
在 PlatformIO 中使用 Arduino 作为 STM32 板的框架时,你仍然可以使用 STM32 HAL (STM32CubeMX):
gpio_init_example.cpp
GPIO_InitTypeDef pinInit = {
.Pin = GPIO_PIN_8,
.Mode = GPIO_MODE_AF_PP,
.Pull = GPIO_NOPULL,
.Speed = GPIO_SPEED_FREQ_VERY_HIGH,
.Alternate = GPIO_AF1_TIM1
};
HAL_GPIO_Init(GPIOA, &pinInit);Use
include_hal_gpio.h
#include <stm32f4xx_hal_gpio.h>以包含 HAL 函数。
Check out similar posts by category:
Arduino, Electronics, PlatformIO, STM32
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow