diff --git a/doc/ebf_brushless motordriver_20210602_原理图.pdf b/doc/ebf_brushless motordriver_20210602_原理图.pdf new file mode 100644 index 0000000..db0565b Binary files /dev/null and b/doc/ebf_brushless motordriver_20210602_原理图.pdf differ diff --git a/doc/野火_F407骄阳原理图_V1.0_2020_10_10.pdf b/doc/野火_F407骄阳原理图_V1.0_2020_10_10.pdf new file mode 100644 index 0000000..032f84b Binary files /dev/null and b/doc/野火_F407骄阳原理图_V1.0_2020_10_10.pdf differ diff --git a/src/Bsp/gpio.c b/src/Bsp/gpio.c index f406687..eed7065 100644 --- a/src/Bsp/gpio.c +++ b/src/Bsp/gpio.c @@ -4,8 +4,8 @@ * @date 2023-08-14 * @version 0.0.1 * @copyright XiazhiTech Copyright (c) 2023 - * - * @brief + * + * @brief */ /* Includes ------------------------------------------------------------------*/ @@ -17,19 +17,24 @@ void MX_GPIO_Init(void) GPIO_InitTypeDef GPIO_InitStruct = {0}; /* GPIO Ports Clock Enable */ - __HAL_RCC_GPIOF_CLK_ENABLE(); - __HAL_RCC_GPIOH_CLK_ENABLE(); __HAL_RCC_GPIOA_CLK_ENABLE(); + __HAL_RCC_GPIOE_CLK_ENABLE(); /*Configure GPIO pin Output Level */ - HAL_GPIO_WritePin(GPIOF, LED0_Pin | LED1_Pin, GPIO_PIN_RESET); + HAL_GPIO_WritePin(LED0_GPIO_Port, LED0_Pin, GPIO_PIN_RESET); /*Configure GPIO pins : PFPin PFPin */ - GPIO_InitStruct.Pin = LED0_Pin | LED1_Pin; + GPIO_InitStruct.Pin = LED0_Pin; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Pull = GPIO_PULLUP; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - HAL_GPIO_Init(GPIOF, &GPIO_InitStruct); + HAL_GPIO_Init(LED0_GPIO_Port, &GPIO_InitStruct); + + GPIO_InitStruct.Pin = LED1_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_PULLUP; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + HAL_GPIO_Init(LED1_GPIO_Port, &GPIO_InitStruct); } // INIT_BOARD_EXPORT(MX_GPIO_Init); @@ -37,11 +42,11 @@ void led_ctrl(uint8_t cmd) { if (cmd) { - HAL_GPIO_WritePin(GPIOF, LED0_Pin | LED1_Pin, GPIO_PIN_SET); + HAL_GPIO_WritePin(LED1_GPIO_Port, LED0_Pin, GPIO_PIN_SET); } else { - HAL_GPIO_WritePin(GPIOF, LED0_Pin | LED1_Pin, GPIO_PIN_RESET); + HAL_GPIO_WritePin(LED1_GPIO_Port, LED0_Pin, GPIO_PIN_RESET); } } diff --git a/src/Bsp/gpio.h b/src/Bsp/gpio.h index 58ad407..082d402 100644 --- a/src/Bsp/gpio.h +++ b/src/Bsp/gpio.h @@ -20,10 +20,10 @@ extern "C" #include "main.h" -#define LED0_Pin GPIO_PIN_9 -#define LED0_GPIO_Port GPIOF -#define LED1_Pin GPIO_PIN_10 -#define LED1_GPIO_Port GPIOF +#define LED0_Pin GPIO_PIN_15 +#define LED0_GPIO_Port GPIOA +#define LED1_Pin GPIO_PIN_2 +#define LED1_GPIO_Port GPIOE void MX_GPIO_Init(void); void led_ctrl(uint8_t cmd);