From f4aca2d5bca2e242cac25b11b888faa10c6bd33c Mon Sep 17 00:00:00 2001 From: panrui <1016625586@qq.com> Date: Fri, 16 Dec 2022 16:08:01 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=A2=9E=E6=B7=BB=E8=88=B5=E6=9C=BA?= =?UTF-8?q?=E6=A8=A1=E5=9D=97-=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/motor/servo_motor.c | 122 +++++++++++++++++++++++++++++++++++ modules/motor/servo_motor.h | 90 ++++++++++++++++++++++++++ modules/motor/servo_motor.md | 66 +++++++++++++++++++ 3 files changed, 278 insertions(+) diff --git a/modules/motor/servo_motor.c b/modules/motor/servo_motor.c index e69de29..80132cc 100644 --- a/modules/motor/servo_motor.c +++ b/modules/motor/servo_motor.c @@ -0,0 +1,122 @@ +#include "servo_motor.h" + +extern TIM_HandleTypeDef htim1; +/*第二版*/ +static ServoInstance *servo_motor[SERVO_MOTOR_CNT] = {NULL}; +static int16_t compare_value[SERVO_MOTOR_CNT]={0}; +static uint8_t servo_idx = 0; // register servo_idx,是该文件的全局舵机索引,在注册时使用 + +// 通过此函数注册一个舵机 +ServoInstance *ServoInit(Servo_Init_Config_s *Servo_Init_Config) +{ + servo_motor[servo_idx] = (ServoInstance *)malloc(sizeof(ServoInstance)); + memset(servo_motor[servo_idx], 0, sizeof(ServoInstance)); + servo_motor[servo_idx]->Servo_type = Servo_Init_Config->Servo_type; + servo_motor[servo_idx]->htim = Servo_Init_Config->htim; + servo_motor[servo_idx]->Channel = Servo_Init_Config->Channel; + HAL_TIM_Base_Start(Servo_Init_Config->htim); + HAL_TIM_PWM_Start(Servo_Init_Config->htim, Servo_Init_Config->Channel); + return servo_motor[servo_idx++]; +} + +/** + * @brief 写入自由角度数值 + * + * @param Servo_Motor 注册的舵机实例 + * @param S_angle 改变自由模式设定的角度 + */ +void Servo_Motor_FreeAngle_Set(ServoInstance *Servo_Motor, int16_t S_angle) +{ + switch (Servo_Motor->Servo_type) + { + case Servo180: + if (S_angle > 180) + S_angle = 180; + break; + case Servo270: + if (S_angle > 270) + S_angle = 270; + break; + case Servo360: + if (S_angle > 100) + S_angle = 100; + break; + default: + break; + } + if (S_angle < 0) + S_angle = 0; + Servo_Motor->Servo_Angle.free_angle = S_angle; +} + +/** + * @brief 写入起始,终止角度数值 + * + * @param Servo_Motor 注册的舵机实例 + * @param Start_angle 起始角度 + * @param Final_angle 终止角度 + */ +void Servo_Motor_StartSTOP_Angle_Set(ServoInstance *Servo_Motor, int16_t Start_angle, int16_t Final_angle) +{ + Servo_Motor->Servo_Angle.Init_angle = Start_angle; + Servo_Motor->Servo_Angle.Final_angle = Final_angle; +} +/** + * @brief 舵机模式选择 + * + * @param Servo_Motor 注册的舵机实例 + * @param mode 需要选择的模式 + */ +void Servo_Motor_Type_Select(ServoInstance *Servo_Motor,int16_t mode) +{ + Servo_Motor->Servo_Angle_Type = mode; +} + + +/** + * @brief 舵机输出控制 + * + */ +void Servo_Motor_Control() +{ + static ServoInstance *Servo_Motor; + static Servo_Type_e Servo_type; + + for (size_t i = 0; i < servo_idx; i++) + { + if (servo_motor[i]) + { + Servo_Motor = servo_motor[i]; + Servo_type = Servo_Motor->Servo_type; + + switch (Servo_type) + { + case Servo180: + if (Servo_Motor->Servo_type == Start_mode) + compare_value[i] = 0.5 * 20000 / 20 + Servo_Motor->Servo_Angle.Init_angle * 20000 / 20 / 90; + if (Servo_Motor->Servo_type == Final_mode) + compare_value[i] = 0.5 * 20000 / 20 + Servo_Motor->Servo_Angle.Final_angle * 20000 / 20 / 90; + if (Servo_Motor->Servo_type == Free_Angle_mode) + compare_value[i] = 0.5 * 20000 / 20 + Servo_Motor->Servo_Angle.free_angle * 20000 / 20 / 90; + __HAL_TIM_SET_COMPARE(Servo_Motor->htim, Servo_Motor->Channel, compare_value[i]); + break; + case Servo270: + if (Servo_Motor->Servo_type == Start_mode) + compare_value[i] = 0.5 * 20000 / 20 + Servo_Motor->Servo_Angle.Init_angle * 20000 / 20 / 135; + if (Servo_Motor->Servo_type == Final_mode) + compare_value[i] = 0.5 * 20000 / 20 + Servo_Motor->Servo_Angle.Final_angle * 20000 / 20 / 135; + if (Servo_Motor->Servo_type == Free_Angle_mode) + compare_value[i] = 0.5 * 20000 / 20 + Servo_Motor->Servo_Angle.free_angle * 20000 / 20 / 135; + __HAL_TIM_SET_COMPARE(Servo_Motor->htim, Servo_Motor->Channel, compare_value[i]); + break; + case Servo360: + /*500-2500的占空比 500-1500对应正向转速 1500-2500对于反向转速*/ + compare_value[i] = 500 + 20 * Servo_Motor->Servo_Angle.servo360speed; + __HAL_TIM_SET_COMPARE(Servo_Motor->htim, Servo_Motor->Channel, compare_value[i]); + break; + default: + break; + } + } + } +} diff --git a/modules/motor/servo_motor.h b/modules/motor/servo_motor.h index e69de29..d64180c 100644 --- a/modules/motor/servo_motor.h +++ b/modules/motor/servo_motor.h @@ -0,0 +1,90 @@ +/** + * @file servo_motor.h + * @author panrui + * @brief 舵机控制头文件 + * @version 0.1 + * @date 2022-12-12 + * + * @copyright Copyright (c) 2022 + * + */ + +#ifndef SERVO_MOTOR_H +#define SERVO_MOTOR_H + +#include "main.h" +#include "tim.h" +#include + +#define SERVO_MOTOR_CNT 7 + +/*各种舵机类型*/ +typedef enum +{ + Servo180 = 0, + Servo270 = 1, + Servo360 = 2, +} Servo_Type_e; + +/*舵机模式选择*/ +typedef enum +{ + Free_Angle_mode, // 任意角度模式 + Start_mode, // 起始角度模式 + Final_mode, // 终止角度模式 +} Servo_Angle_Type_e; +/*角度设置*/ +typedef struct +{ + /*起止角度模式设置值*/ + int16_t Init_angle; + int16_t Final_angle; + /*任意角度模式设置值*/ + int16_t free_angle; + /*下述值仅仅适用于360°舵机 + *设定值为0-100 为速度值百分比 + *0-50为正转 速度由快到慢 + *51-100为反转 速度由慢到快 + */ + int16_t servo360speed; +} Servo_Angle_s; + +/* 用于初始化不同舵机的结构体,各类舵机通用 */ +typedef struct +{ + Servo_Type_e Servo_type; + Servo_Angle_Type_e Servo_Angle_Type; + // 使用的定时器类型及通道 + TIM_HandleTypeDef *htim; + /*Channel值设定 + *TIM_CHANNEL_1 + *TIM_CHANNEL_2 + *TIM_CHANNEL_3 + *TIM_CHANNEL_4 + *TIM_CHANNEL_ALL + */ + uint32_t Channel; + +} Servo_Init_Config_s; +typedef struct +{ + Servo_Angle_Type_e Servo_Angle_Type; + Servo_Angle_s Servo_Angle; + Servo_Type_e Servo_type; + // 使用的定时器类型及通道 + TIM_HandleTypeDef *htim; + /*Channel值设定 + *TIM_CHANNEL_1 + *TIM_CHANNEL_2 + *TIM_CHANNEL_3 + *TIM_CHANNEL_4 + *TIM_CHANNEL_ALL + */ + uint32_t Channel; +} ServoInstance; + +ServoInstance *ServoInit(Servo_Init_Config_s *Servo_Init_Config); +void Servo_Motor_FreeAngle_Set(ServoInstance *Servo_Motor, int16_t S_angle); +void Servo_Motor_Type_Select(ServoInstance *Servo_Motor,int16_t mode); +void Servo_Motor_Control(); +#endif // SERVO_MOTOR_H \ No newline at end of file diff --git a/modules/motor/servo_motor.md b/modules/motor/servo_motor.md index e69de29..f585360 100644 --- a/modules/motor/servo_motor.md +++ b/modules/motor/servo_motor.md @@ -0,0 +1,66 @@ +##舵机的使用 +

panrui@hnu.edu.cn

+### 舵机基础知识 +已最常见的SG90舵机为例,SG90舵机要求工作在频率为50HZ——周期为20ms的PWM波,且对应信号的高低电平在0.5ms - 2.5ms之间,对应的舵机转动角度如下表所示(当然也可以按照这个线性的对应关系去达到转动自己想要的角度,如想要转动60°,则高电平脉宽为大概为1.2ms,具体能不能转到特定的角度还和舵机的精度有关) + +>0.5ms-------------0度; 2.5% +>1.0ms------------45度; 5.0% +>1.5ms------------90度; 7.5% +>2.0ms-----------135度; 10.0% +>2.5ms-----------180度; 12.5% + +根据`Tout = (PSC+1)* (ARR+1)/Tclk`公式 +则我们需要产生50Hz的PWM波,则预分频的系数为 Prescaler = 168-1,自动重装载值 Counter Period = 20000-1,此时定时器产生的频率为 168Mhz/168/20000 = 50Hz。 当然这个值也可以自己设置,只要满足产生的频率为50Hz即可. +`__HAL_TIM_SET_COMPARE(htim, Channel, compare_value);` +这是设置占空比的函数 +eg:当初始占空比为1200/20000则为6%,根据20*6%=1.2ms (1.2-0.5)/(2.5-0.5)*180=63° 故舵机会转动63° +为了方便通过上述eg我们将所需要的角度与PWM计数值对应关系封装成函数。只需要输入我们所需要的角度和相关定时器参数即可。这样我们就可以设置SG90为参数范围内(0~180°)任意度数。 + +--- + +## 如何注册一个舵机实例 +!!! + +**注意!由于舵机为开环控制,无论选择舵机为何种类型,舵机都能够正常运行,但是运行的角度可能会与设定不同,请务必正确选择舵机型号!且最多添加7个舵机!** +我们可以像这样注册一个舵机实例 +```c + +static ServoInstance *leftservomoto; +//初始化参数 +Servo_Init_Config_s config={ + //舵机安装选择的定时器及通道 + //C板有常用的7路PWM输出:TIM1-1,2,3,4 TIM8-1,2,3 + .htim=&htim1, + .Channel=TIM_CHANNEL_1, + //舵机的初始化模式和类型 + .Servo_Angle_Type=Start_mode, + .Servo_type=Servo180, +}; +// 设置好参数后进行初始化并保留返回的指针 +leftservomoto = ServoInit(&config); +``` +>要控制一个舵机 我们提供了以下三个接口 +```c +//自由模式下,写入自由角度数值 +void Servo_Motor_FreeAngle_Set(ServoInstance *Servo_Motor, int16_t S_angle); +//起止模式下,写入起始,终止角度数值(防止反复写入起始和终止角度) +void Servo_Motor_StartSTOP_Angle_Set(ServoInstance *Servo_Motor, int16_t Start_angle, int16_t Final_angle); +/* + Free_Angle_mode, // 任意角度模式 + Start_mode, // 起始角度模式 + Final_mode, // 终止角度模式 +*/ +void Servo_Motor_Type_Select(ServoInstance *Servo_Motor,int16_t mode); +//比如我们要使用舵机,并更改一个舵机的模式 +void ServoTask() +{ + //更改leftservomoto为Free_Angle_mode模式 + Servo_Motor_Type_Select(leftservomoto,Free_Angle_mode); + //设置转到0角度 + Servo_Motor_FreeAngle_Set(leftservomoto, 0); + //调用函数,控制电机 + Servo_Motor_Control(); +} + + +``` \ No newline at end of file From 3e312b004127f084015fab931e1edb1d4dbfbf92 Mon Sep 17 00:00:00 2001 From: panrui <1016625586@qq.com> Date: Fri, 16 Dec 2022 16:15:09 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=88=B5=E6=9C=BAmd=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/motor/servo_motor.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/motor/servo_motor.md b/modules/motor/servo_motor.md index f585360..303277a 100644 --- a/modules/motor/servo_motor.md +++ b/modules/motor/servo_motor.md @@ -14,7 +14,7 @@ `__HAL_TIM_SET_COMPARE(htim, Channel, compare_value);` 这是设置占空比的函数 eg:当初始占空比为1200/20000则为6%,根据20*6%=1.2ms (1.2-0.5)/(2.5-0.5)*180=63° 故舵机会转动63° -为了方便通过上述eg我们将所需要的角度与PWM计数值对应关系封装成函数。只需要输入我们所需要的角度和相关定时器参数即可。这样我们就可以设置SG90为参数范围内(0~180°)任意度数。 +为了方便通过上述eg我们将所需要的角度与PWM计数值对应关系封装成函数。需要在初始化的時候输入我们所需要的角度和相关定时器参数即可。这样我们就可以设置SG90为参数范围内(0~180°)任意度数。 --- From 390e168b46421443a49735778261957d445d55f8 Mon Sep 17 00:00:00 2001 From: panrui <1016625586@qq.com> Date: Thu, 29 Dec 2022 16:53:10 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=B8=8Emaster=E5=88=86=E6=94=AF=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + .mxproject | 10 +- .vscode/settings.json | 55 ----- HAL_N_Middlewares/Inc/main.h | 5 + HAL_N_Middlewares/Inc/spi.h | 3 + HAL_N_Middlewares/Inc/stm32f4xx_hal_conf.h | 75 ++++--- HAL_N_Middlewares/Inc/usbd_conf.h | 4 +- HAL_N_Middlewares/Src/gpio.c | 17 ++ HAL_N_Middlewares/Src/spi.c | 77 +++++++ HAL_N_Middlewares/Src/usbd_desc.c | 4 +- Makefile | 6 + application/application.md | 58 ++++- application/cmd/robot_cmd.c | 4 +- application/cmd/robot_cmd.h | 2 +- application/cmd/robot_cmd.md | 28 +++ application/robot.c | 2 +- basic_framework.ioc | 236 ++++++++++++++++----- bsp/bsp_can.c | 2 +- bsp/bsp_iic.c | 4 + bsp/bsp_iic.h | 11 + bsp/bsp_spi.c | 143 +++++++++++++ bsp/bsp_spi.h | 82 +++++++ modules/imu/BMI088driver.c | 2 +- modules/message_center/message_center.md | 2 +- openocd_dap.cfg | 2 +- 25 files changed, 674 insertions(+), 161 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.gitignore b/.gitignore index bbb2d53..844cd0c 100644 --- a/.gitignore +++ b/.gitignore @@ -52,3 +52,4 @@ build .vscode/.cortex-debug.peripherals.state.json .vscode/.cortex-debug.registers.state.json *.jdebug* +settings.json \ No newline at end of file diff --git a/.mxproject b/.mxproject index 7284037..a03dc7e 100644 --- a/.mxproject +++ b/.mxproject @@ -1,22 +1,22 @@ [PreviousLibFiles] -LibFiles=Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pcd.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pcd_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_usb.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rcc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rcc_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_bus.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_rcc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_system.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_utils.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash_ramfunc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_gpio.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_gpio_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_gpio.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_dma_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_dma.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_dma.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_dmamux.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pwr.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pwr_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_pwr.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_cortex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_cortex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal.h;Drivers\STM32F4xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_def.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_exti.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_exti.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_adc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_adc_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_adc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_can.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rng.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_rng.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rtc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_rtc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rtc_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_spi.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_tim.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_uart.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_usart.h;Middlewares\Third_Party\FreeRTOS\Source\include\croutine.h;Middlewares\Third_Party\FreeRTOS\Source\include\deprecated_definitions.h;Middlewares\Third_Party\FreeRTOS\Source\include\event_groups.h;Middlewares\Third_Party\FreeRTOS\Source\include\FreeRTOS.h;Middlewares\Third_Party\FreeRTOS\Source\include\list.h;Middlewares\Third_Party\FreeRTOS\Source\include\message_buffer.h;Middlewares\Third_Party\FreeRTOS\Source\include\mpu_prototypes.h;Middlewares\Third_Party\FreeRTOS\Source\include\mpu_wrappers.h;Middlewares\Third_Party\FreeRTOS\Source\include\portable.h;Middlewares\Third_Party\FreeRTOS\Source\include\projdefs.h;Middlewares\Third_Party\FreeRTOS\Source\include\queue.h;Middlewares\Third_Party\FreeRTOS\Source\include\semphr.h;Middlewares\Third_Party\FreeRTOS\Source\include\stack_macros.h;Middlewares\Third_Party\FreeRTOS\Source\include\StackMacros.h;Middlewares\Third_Party\FreeRTOS\Source\include\stream_buffer.h;Middlewares\Third_Party\FreeRTOS\Source\include\task.h;Middlewares\Third_Party\FreeRTOS\Source\include\timers.h;Middlewares\Third_Party\FreeRTOS\Source\include\atomic.h;Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS\cmsis_os.h;Middlewares\Third_Party\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h;Middlewares\ST\STM32_USB_Device_Library\Core\Inc\usbd_core.h;Middlewares\ST\STM32_USB_Device_Library\Core\Inc\usbd_ctlreq.h;Middlewares\ST\STM32_USB_Device_Library\Core\Inc\usbd_def.h;Middlewares\ST\STM32_USB_Device_Library\Core\Inc\usbd_ioreq.h;Middlewares\ST\STM32_USB_Device_Library\Class\CDC\Inc\usbd_cdc.h;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pcd.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pcd_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_ll_usb.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ramfunc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_gpio.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cortex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_exti.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_ll_adc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_can.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rng.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rtc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rtc_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_spi.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_uart.c;Middlewares\Third_Party\FreeRTOS\Source\croutine.c;Middlewares\Third_Party\FreeRTOS\Source\event_groups.c;Middlewares\Third_Party\FreeRTOS\Source\list.c;Middlewares\Third_Party\FreeRTOS\Source\queue.c;Middlewares\Third_Party\FreeRTOS\Source\stream_buffer.c;Middlewares\Third_Party\FreeRTOS\Source\tasks.c;Middlewares\Third_Party\FreeRTOS\Source\timers.c;Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS\cmsis_os.c;Middlewares\Third_Party\FreeRTOS\Source\portable\MemMang\heap_4.c;Middlewares\Third_Party\FreeRTOS\Source\portable\GCC\ARM_CM4F\port.c;Middlewares\ST\STM32_USB_Device_Library\Core\Src\usbd_core.c;Middlewares\ST\STM32_USB_Device_Library\Core\Src\usbd_ctlreq.c;Middlewares\ST\STM32_USB_Device_Library\Core\Src\usbd_ioreq.c;Middlewares\ST\STM32_USB_Device_Library\Class\CDC\Src\usbd_cdc.c;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pcd.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pcd_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_usb.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rcc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rcc_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_bus.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_rcc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_system.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_utils.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash_ramfunc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_gpio.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_gpio_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_gpio.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_dma_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_dma.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_dma.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_dmamux.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pwr.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pwr_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_pwr.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_cortex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_cortex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal.h;Drivers\STM32F4xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_def.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_exti.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_exti.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_adc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_adc_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_adc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_can.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rng.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_rng.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rtc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_rtc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rtc_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_spi.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_tim.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_uart.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_usart.h;Middlewares\Third_Party\FreeRTOS\Source\include\croutine.h;Middlewares\Third_Party\FreeRTOS\Source\include\deprecated_definitions.h;Middlewares\Third_Party\FreeRTOS\Source\include\event_groups.h;Middlewares\Third_Party\FreeRTOS\Source\include\FreeRTOS.h;Middlewares\Third_Party\FreeRTOS\Source\include\list.h;Middlewares\Third_Party\FreeRTOS\Source\include\message_buffer.h;Middlewares\Third_Party\FreeRTOS\Source\include\mpu_prototypes.h;Middlewares\Third_Party\FreeRTOS\Source\include\mpu_wrappers.h;Middlewares\Third_Party\FreeRTOS\Source\include\portable.h;Middlewares\Third_Party\FreeRTOS\Source\include\projdefs.h;Middlewares\Third_Party\FreeRTOS\Source\include\queue.h;Middlewares\Third_Party\FreeRTOS\Source\include\semphr.h;Middlewares\Third_Party\FreeRTOS\Source\include\stack_macros.h;Middlewares\Third_Party\FreeRTOS\Source\include\StackMacros.h;Middlewares\Third_Party\FreeRTOS\Source\include\stream_buffer.h;Middlewares\Third_Party\FreeRTOS\Source\include\task.h;Middlewares\Third_Party\FreeRTOS\Source\include\timers.h;Middlewares\Third_Party\FreeRTOS\Source\include\atomic.h;Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS\cmsis_os.h;Middlewares\Third_Party\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h;Middlewares\ST\STM32_USB_Device_Library\Core\Inc\usbd_core.h;Middlewares\ST\STM32_USB_Device_Library\Core\Inc\usbd_ctlreq.h;Middlewares\ST\STM32_USB_Device_Library\Core\Inc\usbd_def.h;Middlewares\ST\STM32_USB_Device_Library\Core\Inc\usbd_ioreq.h;Middlewares\ST\STM32_USB_Device_Library\Class\CDC\Inc\usbd_cdc.h;Drivers\CMSIS\Device\ST\STM32F4xx\Include\stm32f407xx.h;Drivers\CMSIS\Device\ST\STM32F4xx\Include\stm32f4xx.h;Drivers\CMSIS\Device\ST\STM32F4xx\Include\system_stm32f4xx.h;Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c;Drivers\CMSIS\Include\cmsis_armcc.h;Drivers\CMSIS\Include\cmsis_armclang.h;Drivers\CMSIS\Include\cmsis_compiler.h;Drivers\CMSIS\Include\cmsis_gcc.h;Drivers\CMSIS\Include\cmsis_iccarm.h;Drivers\CMSIS\Include\cmsis_version.h;Drivers\CMSIS\Include\core_armv8mbl.h;Drivers\CMSIS\Include\core_armv8mml.h;Drivers\CMSIS\Include\core_cm0.h;Drivers\CMSIS\Include\core_cm0plus.h;Drivers\CMSIS\Include\core_cm1.h;Drivers\CMSIS\Include\core_cm23.h;Drivers\CMSIS\Include\core_cm3.h;Drivers\CMSIS\Include\core_cm33.h;Drivers\CMSIS\Include\core_cm4.h;Drivers\CMSIS\Include\core_cm7.h;Drivers\CMSIS\Include\core_sc000.h;Drivers\CMSIS\Include\core_sc300.h;Drivers\CMSIS\Include\mpu_armv7.h;Drivers\CMSIS\Include\mpu_armv8.h;Drivers\CMSIS\Include\tz_context.h; +LibFiles=Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pcd.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pcd_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_usb.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rcc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rcc_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_bus.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_rcc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_system.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_utils.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash_ramfunc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_gpio.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_gpio_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_gpio.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_dma_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_dma.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_dma.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_dmamux.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pwr.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pwr_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_pwr.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_cortex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_cortex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal.h;Drivers\STM32F4xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_def.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_exti.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_exti.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_adc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_adc_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_adc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_can.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_i2c.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_i2c.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_i2c_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rng.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_rng.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rtc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_rtc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rtc_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_spi.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_tim.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_uart.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_usart.h;Middlewares\Third_Party\FreeRTOS\Source\include\croutine.h;Middlewares\Third_Party\FreeRTOS\Source\include\deprecated_definitions.h;Middlewares\Third_Party\FreeRTOS\Source\include\event_groups.h;Middlewares\Third_Party\FreeRTOS\Source\include\FreeRTOS.h;Middlewares\Third_Party\FreeRTOS\Source\include\list.h;Middlewares\Third_Party\FreeRTOS\Source\include\message_buffer.h;Middlewares\Third_Party\FreeRTOS\Source\include\mpu_prototypes.h;Middlewares\Third_Party\FreeRTOS\Source\include\mpu_wrappers.h;Middlewares\Third_Party\FreeRTOS\Source\include\portable.h;Middlewares\Third_Party\FreeRTOS\Source\include\projdefs.h;Middlewares\Third_Party\FreeRTOS\Source\include\queue.h;Middlewares\Third_Party\FreeRTOS\Source\include\semphr.h;Middlewares\Third_Party\FreeRTOS\Source\include\stack_macros.h;Middlewares\Third_Party\FreeRTOS\Source\include\StackMacros.h;Middlewares\Third_Party\FreeRTOS\Source\include\stream_buffer.h;Middlewares\Third_Party\FreeRTOS\Source\include\task.h;Middlewares\Third_Party\FreeRTOS\Source\include\timers.h;Middlewares\Third_Party\FreeRTOS\Source\include\atomic.h;Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS\cmsis_os.h;Middlewares\Third_Party\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h;Middlewares\ST\STM32_USB_Device_Library\Core\Inc\usbd_core.h;Middlewares\ST\STM32_USB_Device_Library\Core\Inc\usbd_ctlreq.h;Middlewares\ST\STM32_USB_Device_Library\Core\Inc\usbd_def.h;Middlewares\ST\STM32_USB_Device_Library\Core\Inc\usbd_ioreq.h;Middlewares\ST\STM32_USB_Device_Library\Class\CDC\Inc\usbd_cdc.h;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pcd.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pcd_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_ll_usb.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ramfunc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_gpio.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cortex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_exti.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_ll_adc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_can.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2c.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2c_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rng.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rtc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rtc_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_spi.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_uart.c;Middlewares\Third_Party\FreeRTOS\Source\croutine.c;Middlewares\Third_Party\FreeRTOS\Source\event_groups.c;Middlewares\Third_Party\FreeRTOS\Source\list.c;Middlewares\Third_Party\FreeRTOS\Source\queue.c;Middlewares\Third_Party\FreeRTOS\Source\stream_buffer.c;Middlewares\Third_Party\FreeRTOS\Source\tasks.c;Middlewares\Third_Party\FreeRTOS\Source\timers.c;Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS\cmsis_os.c;Middlewares\Third_Party\FreeRTOS\Source\portable\MemMang\heap_4.c;Middlewares\Third_Party\FreeRTOS\Source\portable\GCC\ARM_CM4F\port.c;Middlewares\ST\STM32_USB_Device_Library\Core\Src\usbd_core.c;Middlewares\ST\STM32_USB_Device_Library\Core\Src\usbd_ctlreq.c;Middlewares\ST\STM32_USB_Device_Library\Core\Src\usbd_ioreq.c;Middlewares\ST\STM32_USB_Device_Library\Class\CDC\Src\usbd_cdc.c;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pcd.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pcd_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_usb.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rcc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rcc_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_bus.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_rcc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_system.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_utils.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash_ramfunc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_gpio.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_gpio_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_gpio.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_dma_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_dma.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_dma.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_dmamux.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pwr.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pwr_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_pwr.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_cortex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_cortex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal.h;Drivers\STM32F4xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_def.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_exti.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_exti.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_adc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_adc_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_adc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_can.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_i2c.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_i2c.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_i2c_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rng.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_rng.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rtc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_rtc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rtc_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_spi.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_tim.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_uart.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_usart.h;Middlewares\Third_Party\FreeRTOS\Source\include\croutine.h;Middlewares\Third_Party\FreeRTOS\Source\include\deprecated_definitions.h;Middlewares\Third_Party\FreeRTOS\Source\include\event_groups.h;Middlewares\Third_Party\FreeRTOS\Source\include\FreeRTOS.h;Middlewares\Third_Party\FreeRTOS\Source\include\list.h;Middlewares\Third_Party\FreeRTOS\Source\include\message_buffer.h;Middlewares\Third_Party\FreeRTOS\Source\include\mpu_prototypes.h;Middlewares\Third_Party\FreeRTOS\Source\include\mpu_wrappers.h;Middlewares\Third_Party\FreeRTOS\Source\include\portable.h;Middlewares\Third_Party\FreeRTOS\Source\include\projdefs.h;Middlewares\Third_Party\FreeRTOS\Source\include\queue.h;Middlewares\Third_Party\FreeRTOS\Source\include\semphr.h;Middlewares\Third_Party\FreeRTOS\Source\include\stack_macros.h;Middlewares\Third_Party\FreeRTOS\Source\include\StackMacros.h;Middlewares\Third_Party\FreeRTOS\Source\include\stream_buffer.h;Middlewares\Third_Party\FreeRTOS\Source\include\task.h;Middlewares\Third_Party\FreeRTOS\Source\include\timers.h;Middlewares\Third_Party\FreeRTOS\Source\include\atomic.h;Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS\cmsis_os.h;Middlewares\Third_Party\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h;Middlewares\ST\STM32_USB_Device_Library\Core\Inc\usbd_core.h;Middlewares\ST\STM32_USB_Device_Library\Core\Inc\usbd_ctlreq.h;Middlewares\ST\STM32_USB_Device_Library\Core\Inc\usbd_def.h;Middlewares\ST\STM32_USB_Device_Library\Core\Inc\usbd_ioreq.h;Middlewares\ST\STM32_USB_Device_Library\Class\CDC\Inc\usbd_cdc.h;Drivers\CMSIS\Device\ST\STM32F4xx\Include\stm32f407xx.h;Drivers\CMSIS\Device\ST\STM32F4xx\Include\stm32f4xx.h;Drivers\CMSIS\Device\ST\STM32F4xx\Include\system_stm32f4xx.h;Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c;Drivers\CMSIS\Include\cmsis_armcc.h;Drivers\CMSIS\Include\cmsis_armclang.h;Drivers\CMSIS\Include\cmsis_compiler.h;Drivers\CMSIS\Include\cmsis_gcc.h;Drivers\CMSIS\Include\cmsis_iccarm.h;Drivers\CMSIS\Include\cmsis_version.h;Drivers\CMSIS\Include\core_armv8mbl.h;Drivers\CMSIS\Include\core_armv8mml.h;Drivers\CMSIS\Include\core_cm0.h;Drivers\CMSIS\Include\core_cm0plus.h;Drivers\CMSIS\Include\core_cm1.h;Drivers\CMSIS\Include\core_cm23.h;Drivers\CMSIS\Include\core_cm3.h;Drivers\CMSIS\Include\core_cm33.h;Drivers\CMSIS\Include\core_cm4.h;Drivers\CMSIS\Include\core_cm7.h;Drivers\CMSIS\Include\core_sc000.h;Drivers\CMSIS\Include\core_sc300.h;Drivers\CMSIS\Include\mpu_armv7.h;Drivers\CMSIS\Include\mpu_armv8.h;Drivers\CMSIS\Include\tz_context.h; [PreviousUsedMakefileFiles] -SourceFiles=Src\main.c;Src\gpio.c;Src\freertos.c;Src\adc.c;Src\can.c;Src\dma.c;Src\rng.c;Src\rtc.c;Src\spi.c;Src\tim.c;Src\usart.c;Src\usb_device.c;Src\usbd_conf.c;Src\usbd_desc.c;Src\usbd_cdc_if.c;Src\stm32f4xx_it.c;Src\stm32f4xx_hal_msp.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pcd.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pcd_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_ll_usb.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ramfunc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_gpio.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cortex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_exti.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_ll_adc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_can.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rng.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rtc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rtc_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_spi.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_uart.c;Middlewares\Third_Party\FreeRTOS\Source\croutine.c;Middlewares\Third_Party\FreeRTOS\Source\event_groups.c;Middlewares\Third_Party\FreeRTOS\Source\list.c;Middlewares\Third_Party\FreeRTOS\Source\queue.c;Middlewares\Third_Party\FreeRTOS\Source\stream_buffer.c;Middlewares\Third_Party\FreeRTOS\Source\tasks.c;Middlewares\Third_Party\FreeRTOS\Source\timers.c;Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS\cmsis_os.c;Middlewares\Third_Party\FreeRTOS\Source\portable\MemMang\heap_4.c;Middlewares\Third_Party\FreeRTOS\Source\portable\GCC\ARM_CM4F\port.c;Middlewares\ST\STM32_USB_Device_Library\Core\Src\usbd_core.c;Middlewares\ST\STM32_USB_Device_Library\Core\Src\usbd_ctlreq.c;Middlewares\ST\STM32_USB_Device_Library\Core\Src\usbd_ioreq.c;Middlewares\ST\STM32_USB_Device_Library\Class\CDC\Src\usbd_cdc.c;Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c;Src\system_stm32f4xx.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pcd.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pcd_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_ll_usb.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ramfunc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_gpio.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cortex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_exti.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_ll_adc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_can.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rng.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rtc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rtc_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_spi.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_uart.c;Middlewares\Third_Party\FreeRTOS\Source\croutine.c;Middlewares\Third_Party\FreeRTOS\Source\event_groups.c;Middlewares\Third_Party\FreeRTOS\Source\list.c;Middlewares\Third_Party\FreeRTOS\Source\queue.c;Middlewares\Third_Party\FreeRTOS\Source\stream_buffer.c;Middlewares\Third_Party\FreeRTOS\Source\tasks.c;Middlewares\Third_Party\FreeRTOS\Source\timers.c;Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS\cmsis_os.c;Middlewares\Third_Party\FreeRTOS\Source\portable\MemMang\heap_4.c;Middlewares\Third_Party\FreeRTOS\Source\portable\GCC\ARM_CM4F\port.c;Middlewares\ST\STM32_USB_Device_Library\Core\Src\usbd_core.c;Middlewares\ST\STM32_USB_Device_Library\Core\Src\usbd_ctlreq.c;Middlewares\ST\STM32_USB_Device_Library\Core\Src\usbd_ioreq.c;Middlewares\ST\STM32_USB_Device_Library\Class\CDC\Src\usbd_cdc.c;Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c;Src\system_stm32f4xx.c;;;Middlewares\Third_Party\FreeRTOS\Source\croutine.c;Middlewares\Third_Party\FreeRTOS\Source\event_groups.c;Middlewares\Third_Party\FreeRTOS\Source\list.c;Middlewares\Third_Party\FreeRTOS\Source\queue.c;Middlewares\Third_Party\FreeRTOS\Source\stream_buffer.c;Middlewares\Third_Party\FreeRTOS\Source\tasks.c;Middlewares\Third_Party\FreeRTOS\Source\timers.c;Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS\cmsis_os.c;Middlewares\Third_Party\FreeRTOS\Source\portable\MemMang\heap_4.c;Middlewares\Third_Party\FreeRTOS\Source\portable\GCC\ARM_CM4F\port.c;Middlewares\ST\STM32_USB_Device_Library\Core\Src\usbd_core.c;Middlewares\ST\STM32_USB_Device_Library\Core\Src\usbd_ctlreq.c;Middlewares\ST\STM32_USB_Device_Library\Core\Src\usbd_ioreq.c;Middlewares\ST\STM32_USB_Device_Library\Class\CDC\Src\usbd_cdc.c; +SourceFiles=Src\main.c;Src\gpio.c;Src\freertos.c;Src\adc.c;Src\can.c;Src\dma.c;Src\i2c.c;Src\rng.c;Src\rtc.c;Src\spi.c;Src\tim.c;Src\usart.c;Src\usb_device.c;Src\usbd_conf.c;Src\usbd_desc.c;Src\usbd_cdc_if.c;Src\stm32f4xx_it.c;Src\stm32f4xx_hal_msp.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pcd.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pcd_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_ll_usb.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ramfunc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_gpio.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cortex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_exti.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_ll_adc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_can.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2c.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2c_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rng.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rtc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rtc_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_spi.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_uart.c;Middlewares\Third_Party\FreeRTOS\Source\croutine.c;Middlewares\Third_Party\FreeRTOS\Source\event_groups.c;Middlewares\Third_Party\FreeRTOS\Source\list.c;Middlewares\Third_Party\FreeRTOS\Source\queue.c;Middlewares\Third_Party\FreeRTOS\Source\stream_buffer.c;Middlewares\Third_Party\FreeRTOS\Source\tasks.c;Middlewares\Third_Party\FreeRTOS\Source\timers.c;Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS\cmsis_os.c;Middlewares\Third_Party\FreeRTOS\Source\portable\MemMang\heap_4.c;Middlewares\Third_Party\FreeRTOS\Source\portable\GCC\ARM_CM4F\port.c;Middlewares\ST\STM32_USB_Device_Library\Core\Src\usbd_core.c;Middlewares\ST\STM32_USB_Device_Library\Core\Src\usbd_ctlreq.c;Middlewares\ST\STM32_USB_Device_Library\Core\Src\usbd_ioreq.c;Middlewares\ST\STM32_USB_Device_Library\Class\CDC\Src\usbd_cdc.c;Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c;Src\system_stm32f4xx.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pcd.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pcd_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_ll_usb.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ramfunc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_gpio.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cortex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_exti.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_ll_adc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_can.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2c.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2c_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rng.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rtc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rtc_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_spi.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_uart.c;Middlewares\Third_Party\FreeRTOS\Source\croutine.c;Middlewares\Third_Party\FreeRTOS\Source\event_groups.c;Middlewares\Third_Party\FreeRTOS\Source\list.c;Middlewares\Third_Party\FreeRTOS\Source\queue.c;Middlewares\Third_Party\FreeRTOS\Source\stream_buffer.c;Middlewares\Third_Party\FreeRTOS\Source\tasks.c;Middlewares\Third_Party\FreeRTOS\Source\timers.c;Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS\cmsis_os.c;Middlewares\Third_Party\FreeRTOS\Source\portable\MemMang\heap_4.c;Middlewares\Third_Party\FreeRTOS\Source\portable\GCC\ARM_CM4F\port.c;Middlewares\ST\STM32_USB_Device_Library\Core\Src\usbd_core.c;Middlewares\ST\STM32_USB_Device_Library\Core\Src\usbd_ctlreq.c;Middlewares\ST\STM32_USB_Device_Library\Core\Src\usbd_ioreq.c;Middlewares\ST\STM32_USB_Device_Library\Class\CDC\Src\usbd_cdc.c;Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c;Src\system_stm32f4xx.c;;;Middlewares\Third_Party\FreeRTOS\Source\croutine.c;Middlewares\Third_Party\FreeRTOS\Source\event_groups.c;Middlewares\Third_Party\FreeRTOS\Source\list.c;Middlewares\Third_Party\FreeRTOS\Source\queue.c;Middlewares\Third_Party\FreeRTOS\Source\stream_buffer.c;Middlewares\Third_Party\FreeRTOS\Source\tasks.c;Middlewares\Third_Party\FreeRTOS\Source\timers.c;Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS\cmsis_os.c;Middlewares\Third_Party\FreeRTOS\Source\portable\MemMang\heap_4.c;Middlewares\Third_Party\FreeRTOS\Source\portable\GCC\ARM_CM4F\port.c;Middlewares\ST\STM32_USB_Device_Library\Core\Src\usbd_core.c;Middlewares\ST\STM32_USB_Device_Library\Core\Src\usbd_ctlreq.c;Middlewares\ST\STM32_USB_Device_Library\Core\Src\usbd_ioreq.c;Middlewares\ST\STM32_USB_Device_Library\Class\CDC\Src\usbd_cdc.c; HeaderPath=Drivers\STM32F4xx_HAL_Driver\Inc;Drivers\STM32F4xx_HAL_Driver\Inc\Legacy;Middlewares\Third_Party\FreeRTOS\Source\include;Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS;Middlewares\Third_Party\FreeRTOS\Source\portable\GCC\ARM_CM4F;Middlewares\ST\STM32_USB_Device_Library\Core\Inc;Middlewares\ST\STM32_USB_Device_Library\Class\CDC\Inc;Drivers\CMSIS\Device\ST\STM32F4xx\Include;Drivers\CMSIS\Include;Middlewares\ST\ARM\DSP\Inc;Inc; CDefines=USE_HAL_DRIVER;STM32F407xx;USE_HAL_DRIVER;USE_HAL_DRIVER; [PreviousGenFiles] HeaderPath=..\Inc -HeaderFiles=gpio.h;FreeRTOSConfig.h;adc.h;can.h;dma.h;rng.h;rtc.h;spi.h;tim.h;usart.h;usb_device.h;usbd_conf.h;usbd_desc.h;usbd_cdc_if.h;stm32f4xx_it.h;stm32f4xx_hal_conf.h;main.h; +HeaderFiles=gpio.h;FreeRTOSConfig.h;adc.h;can.h;dma.h;i2c.h;rng.h;rtc.h;spi.h;tim.h;usart.h;usb_device.h;usbd_conf.h;usbd_desc.h;usbd_cdc_if.h;stm32f4xx_it.h;stm32f4xx_hal_conf.h;main.h; SourcePath=..\Src -SourceFiles=gpio.c;freertos.c;adc.c;can.c;dma.c;rng.c;rtc.c;spi.c;tim.c;usart.c;usb_device.c;usbd_conf.c;usbd_desc.c;usbd_cdc_if.c;stm32f4xx_it.c;stm32f4xx_hal_msp.c;main.c; +SourceFiles=gpio.c;freertos.c;adc.c;can.c;dma.c;i2c.c;rng.c;rtc.c;spi.c;tim.c;usart.c;usb_device.c;usbd_conf.c;usbd_desc.c;usbd_cdc_if.c;stm32f4xx_it.c;stm32f4xx_hal_msp.c;main.c; [ThirdPartyIp] ThirdPartyIpNumber=1 ThirdPartyIpName#0=STMicroelectronics.X-CUBE-ALGOBUILD.1.3.0 [ThirdPartyIp#STMicroelectronics.X-CUBE-ALGOBUILD.1.3.0] -library=..\Middlewares\ST\ARM\DSP\Lib\iar_cortexM4lf_math.a; +library=..\Middlewares\ST\ARM\DSP\Lib\libarm_cortexM4lf_math.a; header=..\Middlewares\ST\ARM\DSP\Inc\arm_math.h; diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 10ac569..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "files.associations": { - "memory.h": "c", - "stdint.h": "c", - "led_task.h": "c", - "stdinf.h": "c", - "usart.h": "c", - "controller.h": "c", - "ins_task.h": "c", - "task.h": "c", - "user_lib.h": "c", - "chassis.h": "c", - "can_comm.h": "c", - "string.h": "c", - "stdlib.h": "c", - "crc8.h": "c", - "main.h": "c", - "can.h": "c", - "bsp_can.h": "c", - "dji_motor.h": "c", - "master_process.h": "c", - "seasky_protocol.h": "c", - "bsp_usart.h": "c", - "message_center.h": "c", - "stddef.h": "c", - "stm32_hal_legacy.h": "c", - "message_buffer.h": "c", - "robot_def.h": "c", - "remote_control.h": "c", - "robot_cmd.h": "c", - "chassis_cmd.h": "c", - "referee.h": "c", - "arm_math.h": "c", - "bsp_dwt.h": "c", - "compare": "c", - "*.tcc": "c", - "type_traits": "c", - "typeinfo": "c", - "general_def.h": "c", - "super_cap.h": "c", - "motor_def.h": "c", - "quaternionekf.h": "c", - "shoot.h": "c", - "lk9025.h": "c", - "ht04.h": "c", - "rtc.h": "c", - "tim.h": "c", - "usb_device.h": "c", - "gpio.h": "c", - "rng.h": "c", - "cmsis_os.h": "c" - }, - "C_Cpp.default.configurationProvider": "ms-vscode.makefile-tools", - "C_Cpp.intelliSenseEngineFallback": "enabled", -} \ No newline at end of file diff --git a/HAL_N_Middlewares/Inc/main.h b/HAL_N_Middlewares/Inc/main.h index ce98080..554637b 100644 --- a/HAL_N_Middlewares/Inc/main.h +++ b/HAL_N_Middlewares/Inc/main.h @@ -59,8 +59,12 @@ void Error_Handler(void); /* Private defines -----------------------------------------------------------*/ #define IMU_TEMP_Pin GPIO_PIN_8 #define IMU_TEMP_GPIO_Port GPIOB +#define MAG_RST_Pin GPIO_PIN_6 +#define MAG_RST_GPIO_Port GPIOG #define LED_R_Pin GPIO_PIN_12 #define LED_R_GPIO_Port GPIOH +#define MAG_DR_Pin GPIO_PIN_3 +#define MAG_DR_GPIO_Port GPIOG #define LED_G_Pin GPIO_PIN_11 #define LED_G_GPIO_Port GPIOH #define LED_B_Pin GPIO_PIN_10 @@ -75,6 +79,7 @@ void Error_Handler(void); #define SERVO_GPIO_Port GPIOE #define CS1_GYRO_Pin GPIO_PIN_0 #define CS1_GYRO_GPIO_Port GPIOB + /* USER CODE BEGIN Private defines */ /* USER CODE END Private defines */ diff --git a/HAL_N_Middlewares/Inc/spi.h b/HAL_N_Middlewares/Inc/spi.h index a5dbefc..5c35683 100644 --- a/HAL_N_Middlewares/Inc/spi.h +++ b/HAL_N_Middlewares/Inc/spi.h @@ -34,11 +34,14 @@ extern "C" { extern SPI_HandleTypeDef hspi1; +extern SPI_HandleTypeDef hspi2; + /* USER CODE BEGIN Private defines */ /* USER CODE END Private defines */ void MX_SPI1_Init(void); +void MX_SPI2_Init(void); /* USER CODE BEGIN Prototypes */ diff --git a/HAL_N_Middlewares/Inc/stm32f4xx_hal_conf.h b/HAL_N_Middlewares/Inc/stm32f4xx_hal_conf.h index 305e248..264135c 100644 --- a/HAL_N_Middlewares/Inc/stm32f4xx_hal_conf.h +++ b/HAL_N_Middlewares/Inc/stm32f4xx_hal_conf.h @@ -37,50 +37,49 @@ */ #define HAL_MODULE_ENABLED - #define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ + /* #define HAL_CRYP_MODULE_ENABLED */ +#define HAL_ADC_MODULE_ENABLED #define HAL_CAN_MODULE_ENABLED -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CAN_LEGACY_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_DAC_MODULE_ENABLED */ -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -/* #define HAL_I2C_MODULE_ENABLED */ -/* #define HAL_I2S_MODULE_ENABLED */ -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ +/* #define HAL_CRC_MODULE_ENABLED */ +/* #define HAL_CAN_LEGACY_MODULE_ENABLED */ +/* #define HAL_DAC_MODULE_ENABLED */ +/* #define HAL_DCMI_MODULE_ENABLED */ +/* #define HAL_DMA2D_MODULE_ENABLED */ +/* #define HAL_ETH_MODULE_ENABLED */ +/* #define HAL_NAND_MODULE_ENABLED */ +/* #define HAL_NOR_MODULE_ENABLED */ +/* #define HAL_PCCARD_MODULE_ENABLED */ +/* #define HAL_SRAM_MODULE_ENABLED */ +/* #define HAL_SDRAM_MODULE_ENABLED */ +/* #define HAL_HASH_MODULE_ENABLED */ +#define HAL_I2C_MODULE_ENABLED +/* #define HAL_I2S_MODULE_ENABLED */ +/* #define HAL_IWDG_MODULE_ENABLED */ +/* #define HAL_LTDC_MODULE_ENABLED */ #define HAL_RNG_MODULE_ENABLED #define HAL_RTC_MODULE_ENABLED -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ +/* #define HAL_SAI_MODULE_ENABLED */ +/* #define HAL_SD_MODULE_ENABLED */ +/* #define HAL_MMC_MODULE_ENABLED */ #define HAL_SPI_MODULE_ENABLED #define HAL_TIM_MODULE_ENABLED #define HAL_UART_MODULE_ENABLED -/* #define HAL_USART_MODULE_ENABLED */ -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_SMBUS_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ +/* #define HAL_USART_MODULE_ENABLED */ +/* #define HAL_IRDA_MODULE_ENABLED */ +/* #define HAL_SMARTCARD_MODULE_ENABLED */ +/* #define HAL_SMBUS_MODULE_ENABLED */ +/* #define HAL_WWDG_MODULE_ENABLED */ #define HAL_PCD_MODULE_ENABLED -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_FMPSMBUS_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ +/* #define HAL_HCD_MODULE_ENABLED */ +/* #define HAL_DSI_MODULE_ENABLED */ +/* #define HAL_QSPI_MODULE_ENABLED */ +/* #define HAL_QSPI_MODULE_ENABLED */ +/* #define HAL_CEC_MODULE_ENABLED */ +/* #define HAL_FMPI2C_MODULE_ENABLED */ +/* #define HAL_FMPSMBUS_MODULE_ENABLED */ +/* #define HAL_SPDIFRX_MODULE_ENABLED */ +/* #define HAL_DFSDM_MODULE_ENABLED */ +/* #define HAL_LPTIM_MODULE_ENABLED */ #define HAL_GPIO_MODULE_ENABLED #define HAL_EXTI_MODULE_ENABLED #define HAL_DMA_MODULE_ENABLED @@ -214,7 +213,7 @@ #define MAC_ADDR5 0U /* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_RX_BUF_SIZE /* buffer size for receive */ #define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ #define ETH_RXBUFNB 4U /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ #define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ diff --git a/HAL_N_Middlewares/Inc/usbd_conf.h b/HAL_N_Middlewares/Inc/usbd_conf.h index db51286..4c39852 100644 --- a/HAL_N_Middlewares/Inc/usbd_conf.h +++ b/HAL_N_Middlewares/Inc/usbd_conf.h @@ -116,7 +116,7 @@ #if (USBD_DEBUG_LEVEL > 1) -#define USBD_ErrLog(...) printf("ERROR: ") ;\ +#define USBD_ErrLog(...) printf("ERROR: ");\ printf(__VA_ARGS__);\ printf("\n"); #else @@ -124,7 +124,7 @@ #endif /* (USBD_DEBUG_LEVEL > 1U) */ #if (USBD_DEBUG_LEVEL > 2) -#define USBD_DbgLog(...) printf("DEBUG : ") ;\ +#define USBD_DbgLog(...) printf("DEBUG : ");\ printf(__VA_ARGS__);\ printf("\n"); #else diff --git a/HAL_N_Middlewares/Src/gpio.c b/HAL_N_Middlewares/Src/gpio.c index b7dc222..a27349e 100644 --- a/HAL_N_Middlewares/Src/gpio.c +++ b/HAL_N_Middlewares/Src/gpio.c @@ -51,15 +51,32 @@ void MX_GPIO_Init(void) __HAL_RCC_GPIOD_CLK_ENABLE(); __HAL_RCC_GPIOC_CLK_ENABLE(); __HAL_RCC_GPIOI_CLK_ENABLE(); + __HAL_RCC_GPIOF_CLK_ENABLE(); __HAL_RCC_GPIOH_CLK_ENABLE(); __HAL_RCC_GPIOE_CLK_ENABLE(); + /*Configure GPIO pin Output Level */ + HAL_GPIO_WritePin(MAG_RST_GPIO_Port, MAG_RST_Pin, GPIO_PIN_RESET); + /*Configure GPIO pin Output Level */ HAL_GPIO_WritePin(CS1_ACCEL_GPIO_Port, CS1_ACCEL_Pin, GPIO_PIN_SET); /*Configure GPIO pin Output Level */ HAL_GPIO_WritePin(CS1_GYRO_GPIO_Port, CS1_GYRO_Pin, GPIO_PIN_SET); + /*Configure GPIO pin : PtPin */ + GPIO_InitStruct.Pin = MAG_RST_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_PULLUP; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_MEDIUM; + HAL_GPIO_Init(MAG_RST_GPIO_Port, &GPIO_InitStruct); + + /*Configure GPIO pin : PtPin */ + GPIO_InitStruct.Pin = MAG_DR_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING; + GPIO_InitStruct.Pull = GPIO_PULLUP; + HAL_GPIO_Init(MAG_DR_GPIO_Port, &GPIO_InitStruct); + /*Configure GPIO pin : PtPin */ GPIO_InitStruct.Pin = KEY_Pin; GPIO_InitStruct.Mode = GPIO_MODE_INPUT; diff --git a/HAL_N_Middlewares/Src/spi.c b/HAL_N_Middlewares/Src/spi.c index 043f842..4586ed9 100644 --- a/HAL_N_Middlewares/Src/spi.c +++ b/HAL_N_Middlewares/Src/spi.c @@ -25,6 +25,7 @@ /* USER CODE END 0 */ SPI_HandleTypeDef hspi1; +SPI_HandleTypeDef hspi2; /* SPI1 init function */ void MX_SPI1_Init(void) @@ -57,6 +58,38 @@ void MX_SPI1_Init(void) /* USER CODE END SPI1_Init 2 */ +} +/* SPI2 init function */ +void MX_SPI2_Init(void) +{ + + /* USER CODE BEGIN SPI2_Init 0 */ + + /* USER CODE END SPI2_Init 0 */ + + /* USER CODE BEGIN SPI2_Init 1 */ + + /* USER CODE END SPI2_Init 1 */ + hspi2.Instance = SPI2; + hspi2.Init.Mode = SPI_MODE_MASTER; + hspi2.Init.Direction = SPI_DIRECTION_2LINES; + hspi2.Init.DataSize = SPI_DATASIZE_8BIT; + hspi2.Init.CLKPolarity = SPI_POLARITY_HIGH; + hspi2.Init.CLKPhase = SPI_PHASE_2EDGE; + hspi2.Init.NSS = SPI_NSS_SOFT; + hspi2.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_256; + hspi2.Init.FirstBit = SPI_FIRSTBIT_MSB; + hspi2.Init.TIMode = SPI_TIMODE_DISABLE; + hspi2.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; + hspi2.Init.CRCPolynomial = 10; + if (HAL_SPI_Init(&hspi2) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN SPI2_Init 2 */ + + /* USER CODE END SPI2_Init 2 */ + } void HAL_SPI_MspInit(SPI_HandleTypeDef* spiHandle) @@ -96,6 +129,31 @@ void HAL_SPI_MspInit(SPI_HandleTypeDef* spiHandle) /* USER CODE END SPI1_MspInit 1 */ } + else if(spiHandle->Instance==SPI2) + { + /* USER CODE BEGIN SPI2_MspInit 0 */ + + /* USER CODE END SPI2_MspInit 0 */ + /* SPI2 clock enable */ + __HAL_RCC_SPI2_CLK_ENABLE(); + + __HAL_RCC_GPIOB_CLK_ENABLE(); + /**SPI2 GPIO Configuration + PB13 ------> SPI2_SCK + PB14 ------> SPI2_MISO + PB15 ------> SPI2_MOSI + */ + GPIO_InitStruct.Pin = GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.Alternate = GPIO_AF5_SPI2; + HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); + + /* USER CODE BEGIN SPI2_MspInit 1 */ + + /* USER CODE END SPI2_MspInit 1 */ + } } void HAL_SPI_MspDeInit(SPI_HandleTypeDef* spiHandle) @@ -122,6 +180,25 @@ void HAL_SPI_MspDeInit(SPI_HandleTypeDef* spiHandle) /* USER CODE END SPI1_MspDeInit 1 */ } + else if(spiHandle->Instance==SPI2) + { + /* USER CODE BEGIN SPI2_MspDeInit 0 */ + + /* USER CODE END SPI2_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_SPI2_CLK_DISABLE(); + + /**SPI2 GPIO Configuration + PB13 ------> SPI2_SCK + PB14 ------> SPI2_MISO + PB15 ------> SPI2_MOSI + */ + HAL_GPIO_DeInit(GPIOB, GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15); + + /* USER CODE BEGIN SPI2_MspDeInit 1 */ + + /* USER CODE END SPI2_MspDeInit 1 */ + } } /* USER CODE BEGIN 1 */ diff --git a/HAL_N_Middlewares/Src/usbd_desc.c b/HAL_N_Middlewares/Src/usbd_desc.c index 04f958b..89ab7d4 100644 --- a/HAL_N_Middlewares/Src/usbd_desc.c +++ b/HAL_N_Middlewares/Src/usbd_desc.c @@ -387,7 +387,9 @@ uint8_t * USBD_FS_USR_BOSDescriptor(USBD_SpeedTypeDef speed, uint16_t *length) */ static void Get_SerialNum(void) { - uint32_t deviceserial0, deviceserial1, deviceserial2; + uint32_t deviceserial0; + uint32_t deviceserial1; + uint32_t deviceserial2; deviceserial0 = *(uint32_t *) DEVICE_ID1; deviceserial1 = *(uint32_t *) DEVICE_ID2; diff --git a/Makefile b/Makefile index 3fa9f3b..4f243aa 100644 --- a/Makefile +++ b/Makefile @@ -39,6 +39,7 @@ BUILD_DIR = build C_SOURCES = \ HAL_N_Middlewares/Src/main.c \ HAL_N_Middlewares/Src/gpio.c \ +HAL_N_Middlewares/Src/i2c.c \ HAL_N_Middlewares/Src/adc.c \ HAL_N_Middlewares/Src/can.c \ HAL_N_Middlewares/Src/dma.c \ @@ -64,6 +65,8 @@ HAL_N_Middlewares/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c \ HAL_N_Middlewares/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c \ HAL_N_Middlewares/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c \ HAL_N_Middlewares/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c \ +HAL_N_Middlewares/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c_ex.c \ +HAL_N_Middlewares/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c \ HAL_N_Middlewares/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c \ HAL_N_Middlewares/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c \ HAL_N_Middlewares/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c \ @@ -99,8 +102,11 @@ HAL_N_Middlewares/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/ HAL_N_Middlewares/Middlewares/Third_Party/SEGGER/RTT/SEGGER_RTT_printf.c \ HAL_N_Middlewares/Middlewares/Third_Party/SEGGER/RTT/SEGGER_RTT.c \ bsp/bsp_dwt.c \ +bsp/bsp_pwm.c \ bsp/bsp_temperature.c \ bsp/bsp_led.c \ +bsp/bsp_spi.c \ +bsp/bsp_iic.c \ bsp/bsp_can.c \ bsp/bsp_buzzer.c \ bsp/bsp_usart.c \ diff --git a/application/application.md b/application/application.md index d314406..a68e948 100644 --- a/application/application.md +++ b/application/application.md @@ -1,3 +1,59 @@ # application -这是application层的说明 \ No newline at end of file +

neozng1@hnu.edu.cn

+ +这是application层的说明。 + + + +## 使用说明 + +在main函数中包含`robot.h`头文件,这是对整车的抽象。将`INStask`,`motortask`,`ledtask`,`monitortask`这四个task加入`freertos.c`中,创建对应的任务,设置合适的任务运行间隔;然后将`robottask`放入freertos.c中,同样以一定的频率运行。 在初始化实时系统之前,在`main()`中调用`RobotInit()`进行整车的初始化。 + +INStask的运行频率为1kHz,motortask推荐的运行频率为200Hz\~500Hz,对于高实时性要求的电机可以提升到1kHz,不过要注意CAN总线的负载。ledtask的运行频率推荐为1kHz,monitortask的运行频率推荐为50\~100Hz;robottask的运行频率推荐为150Hz以上,应当高于视觉发送的频率,若后续使用插帧,应该保证不低过motortask太多。 + +若使用双板,则在`robot_def.h`中给对应的开发板设定宏定义,如底盘板使用`#define CHASSIS_BOARD`,云台板使用`#define GIMBAL_BOARD`;单个开发板控制整车,则定义`#define ONE_BOARD`。在每个应用中,都已经使用编译预处理指令完成条件编译,会自动根据设定的宏切换功能。使用双板的时候,目前板间通信通过CAN完成,因此两个开发板会挂载在一条总线上,在两个开发板对这条总线的其他使用CAN的设备进行配置时注意**不要发生ID冲突**,还要注意**防止负载过大**。 + +**同样,在该文件中你需要修改一些关于机器人的参数**。比如底盘和云台对齐时yaw电机编码器的值,拨盘的单圈载弹量、底盘的轴距等等。 + + + +## 封装总览 + +Robot.c是整个机器人的抽象,其下有4个应用:robot_cmd,gimbal,chassis,shoot。此框架当前是针对步兵/英雄/哨兵设计的,其他机器人只需要根据各自的特殊机构进行修改即可。robot_cmd是整个机器人的核心应用,其负责接受遥控器/上位机发来的指令,并将指令转化为实际的运动控制目标,发送给其他三个应用。后者会根据robot_cmd发来的命令,设定电机和其他执行单元的参考值等。 + +为了进一步解耦应用之间的关系,这里并没有采用层级结构(或设计模式中所谓的**工厂模式**,即robot_cmd包含其他三个模块),而采用了应用并列的**发布-订阅**机制,四个应用之间没有任何相互包含关系,他们之间的通信通过module层提供的`message_center`实现。每个应用会通过该模块向一些话题(事件)发布一些消息,同时从一些话题订阅消息。如robot_cmd应用会发布其他三个模块的控制信息,同时订阅其他三个模块的反馈信息。其他三个模块会订阅robot_cmd发布的控制信息,同时发布反馈给robot_cmd的信息,他们不需要知道彼此的存在,只是从`message_center`处获取其他应用发布的消息或向自己发布的话题推送消息。 + + + +## 整车程序流程 + +```mermaid +graph TD +main调用RobotInit进行初始化 --> RobotInit调用基础bsp初始化以及各个app的初始化 --> 各个app进行消息订阅初始化和自有模块的初始化 --> 启动实时系统 --> 各任务开始运行 + +``` + +任务开始之后,每个app之间的交互关系如下: + +```mermaid +graph TD +robot_cmd获取遥控器/上位机指令以及各个应用发布的回传信息 --> 将指令转化为具体的控制信息 --> 发布指令到对应话题 +``` + +gimbal/chassis/shoot则根据订阅的robot_cmd发布的消息,将具体的控制信息根据当前模式转化为执行单元的目标值,通过自己拥有的模块完成这些指令,然后把回传的信息发布到对应话题。 + +每个应用的具体流程和实现,参见它们各自的说明文档。 + + + +## 开发要点 + +各个应用之间务必通过`message_center`以发布-订阅的方式进行消息交换,不要出现包含关系,这可以大大减小耦合度并提高合作开发的效率。 + + + + + + + diff --git a/application/cmd/robot_cmd.c b/application/cmd/robot_cmd.c index a50da6a..7949f62 100644 --- a/application/cmd/robot_cmd.c +++ b/application/cmd/robot_cmd.c @@ -176,11 +176,11 @@ static void EmergencyHandler() } } -void GimbalCMDTask() +void RobotCMDTask() { // 从其他应用获取回传数据 #ifdef ONE_BOARD - SubGetMessage(chassis_feed_sub, (void*)&chassis_fetch_data); + SubGetMessage(chassis_feed_sub, (void *)&chassis_fetch_data); #endif // ONE_BOARD #ifdef GIMBAL_BOARD chassis_fetch_data = *(Chassis_Upload_Data_s *)CANCommGet(cmd_can_comm); diff --git a/application/cmd/robot_cmd.h b/application/cmd/robot_cmd.h index 8f0931d..faa8d80 100644 --- a/application/cmd/robot_cmd.h +++ b/application/cmd/robot_cmd.h @@ -3,6 +3,6 @@ void GimbalCMDInit(); -void GimbalCMDTask(); +void RobotCMDTask(); #endif // !GIMBAL_CMD_H \ No newline at end of file diff --git a/application/cmd/robot_cmd.md b/application/cmd/robot_cmd.md index e69de29..1a9075d 100644 --- a/application/cmd/robot_cmd.md +++ b/application/cmd/robot_cmd.md @@ -0,0 +1,28 @@ +# robot_cmd + +

neozng1@hnu.edu.cn

+ +## 运行流程 + +运行流程可以很直观的从`RobotCMDTask()`中看出。首先通过消息订阅机制,获取其他应用的反馈信息,然后使用`CalcOffsetAngle()`计算底盘和云台的offset angle(使得底盘始终获知当前的正方向),接着根据当前是通过键鼠or遥控器控制,调用对应的函数,将控制指令量化为具体的控制信息;得到控制信息之后,先不急着发布,而是检测重要的模块和应用是否掉线或出现异常,以及遥控器是否进入紧急停止模式,如果以上情况发生,那么将所有的控制信息都置零,即让电机和其他执行单元保持静止。最后还是通过pubsub机制,把具体的控制信息发布到对应话题,让其他应用获取。 + + + +## 外部接口 + + + + + + + + + +## 私有函数和变量 + + + + + + + diff --git a/application/robot.c b/application/robot.c index 3fbbc92..7610866 100644 --- a/application/robot.c +++ b/application/robot.c @@ -29,7 +29,7 @@ void RobotInit() void RobotTask() { #if defined(ONE_BOARD) || defined(GIMBAL_BOARD) - GimbalCMDTask(); + RobotCMDTask(); GimbalTask(); ShootTask(); #endif diff --git a/basic_framework.ioc b/basic_framework.ioc index 851ff09..1bd1e36 100644 --- a/basic_framework.ioc +++ b/basic_framework.ioc @@ -6,6 +6,9 @@ ADC1.NbrOfConversionFlag=1 ADC1.Rank-0\#ChannelRegularConversion=1 ADC1.SamplingTime-0\#ChannelRegularConversion=ADC_SAMPLETIME_3CYCLES ADC1.master=1 +CAD.formats= +CAD.pinconfig= +CAD.provider= CAN1.BS1=CAN_BS1_10TQ CAN1.BS2=CAN_BS2_3TQ CAN1.CalculateBaudRate=1000000 @@ -18,12 +21,82 @@ CAN2.CalculateBaudRate=1000000 CAN2.CalculateTimeQuantum=71.42857142857143 CAN2.IPParameters=CalculateTimeQuantum,BS1,BS2,Prescaler,CalculateBaudRate CAN2.Prescaler=3 +Dma.MEMTOMEM.5.Direction=DMA_MEMORY_TO_MEMORY +Dma.MEMTOMEM.5.FIFOMode=DMA_FIFOMODE_ENABLE +Dma.MEMTOMEM.5.FIFOThreshold=DMA_FIFO_THRESHOLD_FULL +Dma.MEMTOMEM.5.Instance=DMA2_Stream3 +Dma.MEMTOMEM.5.MemBurst=DMA_MBURST_SINGLE +Dma.MEMTOMEM.5.MemDataAlignment=DMA_MDATAALIGN_BYTE +Dma.MEMTOMEM.5.MemInc=DMA_MINC_ENABLE +Dma.MEMTOMEM.5.Mode=DMA_NORMAL +Dma.MEMTOMEM.5.PeriphBurst=DMA_PBURST_SINGLE +Dma.MEMTOMEM.5.PeriphDataAlignment=DMA_PDATAALIGN_BYTE +Dma.MEMTOMEM.5.PeriphInc=DMA_PINC_ENABLE +Dma.MEMTOMEM.5.Priority=DMA_PRIORITY_HIGH +Dma.MEMTOMEM.5.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority,FIFOMode,FIFOThreshold,MemBurst,PeriphBurst Dma.Request0=USART3_RX Dma.Request1=USART6_RX Dma.Request2=USART6_TX Dma.Request3=USART1_TX Dma.Request4=USART1_RX -Dma.RequestsNb=5 +Dma.Request5=MEMTOMEM +Dma.Request6=SPI1_RX +Dma.Request7=SPI1_TX +Dma.Request8=SPI2_RX +Dma.Request9=SPI2_TX +Dma.RequestsNb=10 +Dma.SPI1_RX.6.Direction=DMA_PERIPH_TO_MEMORY +Dma.SPI1_RX.6.FIFOMode=DMA_FIFOMODE_ENABLE +Dma.SPI1_RX.6.FIFOThreshold=DMA_FIFO_THRESHOLD_FULL +Dma.SPI1_RX.6.Instance=DMA2_Stream0 +Dma.SPI1_RX.6.MemBurst=DMA_MBURST_SINGLE +Dma.SPI1_RX.6.MemDataAlignment=DMA_MDATAALIGN_BYTE +Dma.SPI1_RX.6.MemInc=DMA_MINC_ENABLE +Dma.SPI1_RX.6.Mode=DMA_NORMAL +Dma.SPI1_RX.6.PeriphBurst=DMA_PBURST_SINGLE +Dma.SPI1_RX.6.PeriphDataAlignment=DMA_PDATAALIGN_BYTE +Dma.SPI1_RX.6.PeriphInc=DMA_PINC_DISABLE +Dma.SPI1_RX.6.Priority=DMA_PRIORITY_LOW +Dma.SPI1_RX.6.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority,FIFOMode,FIFOThreshold,MemBurst,PeriphBurst +Dma.SPI1_TX.7.Direction=DMA_MEMORY_TO_PERIPH +Dma.SPI1_TX.7.FIFOMode=DMA_FIFOMODE_ENABLE +Dma.SPI1_TX.7.FIFOThreshold=DMA_FIFO_THRESHOLD_FULL +Dma.SPI1_TX.7.Instance=DMA2_Stream5 +Dma.SPI1_TX.7.MemBurst=DMA_MBURST_SINGLE +Dma.SPI1_TX.7.MemDataAlignment=DMA_MDATAALIGN_BYTE +Dma.SPI1_TX.7.MemInc=DMA_MINC_ENABLE +Dma.SPI1_TX.7.Mode=DMA_NORMAL +Dma.SPI1_TX.7.PeriphBurst=DMA_PBURST_SINGLE +Dma.SPI1_TX.7.PeriphDataAlignment=DMA_PDATAALIGN_BYTE +Dma.SPI1_TX.7.PeriphInc=DMA_PINC_DISABLE +Dma.SPI1_TX.7.Priority=DMA_PRIORITY_LOW +Dma.SPI1_TX.7.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority,FIFOMode,FIFOThreshold,MemBurst,PeriphBurst +Dma.SPI2_RX.8.Direction=DMA_PERIPH_TO_MEMORY +Dma.SPI2_RX.8.FIFOMode=DMA_FIFOMODE_ENABLE +Dma.SPI2_RX.8.FIFOThreshold=DMA_FIFO_THRESHOLD_FULL +Dma.SPI2_RX.8.Instance=DMA1_Stream3 +Dma.SPI2_RX.8.MemBurst=DMA_MBURST_SINGLE +Dma.SPI2_RX.8.MemDataAlignment=DMA_MDATAALIGN_BYTE +Dma.SPI2_RX.8.MemInc=DMA_MINC_ENABLE +Dma.SPI2_RX.8.Mode=DMA_NORMAL +Dma.SPI2_RX.8.PeriphBurst=DMA_PBURST_SINGLE +Dma.SPI2_RX.8.PeriphDataAlignment=DMA_PDATAALIGN_BYTE +Dma.SPI2_RX.8.PeriphInc=DMA_PINC_DISABLE +Dma.SPI2_RX.8.Priority=DMA_PRIORITY_LOW +Dma.SPI2_RX.8.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority,FIFOMode,FIFOThreshold,MemBurst,PeriphBurst +Dma.SPI2_TX.9.Direction=DMA_MEMORY_TO_PERIPH +Dma.SPI2_TX.9.FIFOMode=DMA_FIFOMODE_ENABLE +Dma.SPI2_TX.9.FIFOThreshold=DMA_FIFO_THRESHOLD_FULL +Dma.SPI2_TX.9.Instance=DMA1_Stream4 +Dma.SPI2_TX.9.MemBurst=DMA_MBURST_SINGLE +Dma.SPI2_TX.9.MemDataAlignment=DMA_MDATAALIGN_BYTE +Dma.SPI2_TX.9.MemInc=DMA_MINC_ENABLE +Dma.SPI2_TX.9.Mode=DMA_NORMAL +Dma.SPI2_TX.9.PeriphBurst=DMA_PBURST_SINGLE +Dma.SPI2_TX.9.PeriphDataAlignment=DMA_PDATAALIGN_BYTE +Dma.SPI2_TX.9.PeriphInc=DMA_PINC_DISABLE +Dma.SPI2_TX.9.Priority=DMA_PRIORITY_LOW +Dma.SPI2_TX.9.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority,FIFOMode,FIFOThreshold,MemBurst,PeriphBurst Dma.USART1_RX.4.Direction=DMA_PERIPH_TO_MEMORY Dma.USART1_RX.4.FIFOMode=DMA_FIFOMODE_DISABLE Dma.USART1_RX.4.Instance=DMA2_Stream2 @@ -79,31 +152,38 @@ FREERTOS.Tasks01=defaultTask,0,128,StartDefaultTask,Default,NULL,Dynamic,NULL,NU FREERTOS.configENABLE_FPU=1 File.Version=6 GPIO.groupedBy=Group By Peripherals +I2C2.I2C_Mode=I2C_Fast +I2C2.IPParameters=I2C_Mode +I2C3.I2C_Mode=I2C_Fast +I2C3.IPParameters=I2C_Mode KeepUserPlacement=false Mcu.CPN=STM32F407IGH6 Mcu.Family=STM32F4 Mcu.IP0=ADC1 Mcu.IP1=CAN1 -Mcu.IP10=SYS -Mcu.IP11=TIM1 -Mcu.IP12=TIM4 -Mcu.IP13=TIM5 -Mcu.IP14=TIM8 -Mcu.IP15=TIM10 -Mcu.IP16=USART1 -Mcu.IP17=USART3 -Mcu.IP18=USART6 -Mcu.IP19=USB_DEVICE +Mcu.IP10=RTC +Mcu.IP11=SPI1 +Mcu.IP12=SPI2 +Mcu.IP13=SYS +Mcu.IP14=TIM1 +Mcu.IP15=TIM4 +Mcu.IP16=TIM5 +Mcu.IP17=TIM8 +Mcu.IP18=TIM10 +Mcu.IP19=USART1 Mcu.IP2=CAN2 -Mcu.IP20=USB_OTG_FS +Mcu.IP20=USART3 +Mcu.IP21=USART6 +Mcu.IP22=USB_DEVICE +Mcu.IP23=USB_OTG_FS Mcu.IP3=DMA Mcu.IP4=FREERTOS -Mcu.IP5=NVIC -Mcu.IP6=RCC -Mcu.IP7=RNG -Mcu.IP8=RTC -Mcu.IP9=SPI1 -Mcu.IPNb=21 +Mcu.IP5=I2C2 +Mcu.IP6=I2C3 +Mcu.IP7=NVIC +Mcu.IP8=RCC +Mcu.IP9=RNG +Mcu.IPNb=24 Mcu.Name=STM32F407I(E-G)Hx Mcu.Package=UFBGA176 Mcu.Pin0=PB8 @@ -116,58 +196,71 @@ Mcu.Pin14=PI6 Mcu.Pin15=PG9 Mcu.Pin16=PD1 Mcu.Pin17=PA11 -Mcu.Pin18=PA9 -Mcu.Pin19=PH0-OSC_IN +Mcu.Pin18=PF0 +Mcu.Pin19=PA9 Mcu.Pin2=PG14 -Mcu.Pin20=PH1-OSC_OUT -Mcu.Pin21=PC6 -Mcu.Pin22=PH12 -Mcu.Pin23=PH11 -Mcu.Pin24=PH10 -Mcu.Pin25=PD14 -Mcu.Pin26=PA0-WKUP -Mcu.Pin27=PA4 -Mcu.Pin28=PE13 -Mcu.Pin29=PE9 +Mcu.Pin20=PC9 +Mcu.Pin21=PA8 +Mcu.Pin22=PH0-OSC_IN +Mcu.Pin23=PH1-OSC_OUT +Mcu.Pin24=PF1 +Mcu.Pin25=PC6 +Mcu.Pin26=PG6 +Mcu.Pin27=PH12 +Mcu.Pin28=PG3 +Mcu.Pin29=PH11 Mcu.Pin3=PB4 -Mcu.Pin30=PE11 -Mcu.Pin31=PE14 -Mcu.Pin32=PA7 -Mcu.Pin33=PB0 -Mcu.Pin34=VP_ADC1_TempSens_Input -Mcu.Pin35=VP_ADC1_Vref_Input -Mcu.Pin36=VP_FREERTOS_VS_CMSIS_V1 -Mcu.Pin37=VP_RNG_VS_RNG -Mcu.Pin38=VP_RTC_VS_RTC_Activate -Mcu.Pin39=VP_SYS_VS_Systick +Mcu.Pin30=PH10 +Mcu.Pin31=PD14 +Mcu.Pin32=PA0-WKUP +Mcu.Pin33=PA4 +Mcu.Pin34=PE13 +Mcu.Pin35=PE9 +Mcu.Pin36=PE11 +Mcu.Pin37=PE14 +Mcu.Pin38=PB13 +Mcu.Pin39=PA7 Mcu.Pin4=PB3 -Mcu.Pin40=VP_TIM1_VS_ClockSourceINT -Mcu.Pin41=VP_TIM4_VS_ClockSourceINT -Mcu.Pin42=VP_TIM5_VS_ClockSourceINT -Mcu.Pin43=VP_TIM8_VS_ClockSourceINT -Mcu.Pin44=VP_TIM10_VS_ClockSourceINT -Mcu.Pin45=VP_USB_DEVICE_VS_USB_DEVICE_CDC_FS -Mcu.Pin46=VP_STMicroelectronics.X-CUBE-ALGOBUILD_VS_DSPOoLibraryJjLibrary_1.3.0_1.3.0 +Mcu.Pin40=PB0 +Mcu.Pin41=PB14 +Mcu.Pin42=PB15 +Mcu.Pin43=VP_ADC1_TempSens_Input +Mcu.Pin44=VP_ADC1_Vref_Input +Mcu.Pin45=VP_FREERTOS_VS_CMSIS_V1 +Mcu.Pin46=VP_RNG_VS_RNG +Mcu.Pin47=VP_RTC_VS_RTC_Activate +Mcu.Pin48=VP_SYS_VS_Systick +Mcu.Pin49=VP_TIM1_VS_ClockSourceINT Mcu.Pin5=PA14 +Mcu.Pin50=VP_TIM4_VS_ClockSourceINT +Mcu.Pin51=VP_TIM5_VS_ClockSourceINT +Mcu.Pin52=VP_TIM8_VS_ClockSourceINT +Mcu.Pin53=VP_TIM10_VS_ClockSourceINT +Mcu.Pin54=VP_USB_DEVICE_VS_USB_DEVICE_CDC_FS +Mcu.Pin55=VP_STMicroelectronics.X-CUBE-ALGOBUILD_VS_DSPOoLibraryJjLibrary_1.3.0_1.3.0 Mcu.Pin6=PA13 Mcu.Pin7=PB7 Mcu.Pin8=PB6 Mcu.Pin9=PD0 -Mcu.PinsNb=47 +Mcu.PinsNb=56 Mcu.ThirdParty0=STMicroelectronics.X-CUBE-ALGOBUILD.1.3.0 Mcu.ThirdPartyNb=1 Mcu.UserConstants= Mcu.UserName=STM32F407IGHx -MxCube.Version=6.6.1 -MxDb.Version=DB.6.0.60 +MxCube.Version=6.7.0 +MxDb.Version=DB.6.0.70 NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false NVIC.CAN1_RX0_IRQn=true\:6\:0\:true\:false\:true\:true\:true\:true\:true NVIC.CAN1_RX1_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true NVIC.CAN2_RX0_IRQn=true\:6\:0\:true\:false\:true\:true\:true\:true\:true NVIC.CAN2_RX1_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true NVIC.DMA1_Stream1_IRQn=true\:5\:0\:true\:false\:true\:true\:false\:true\:true +NVIC.DMA1_Stream3_IRQn=true\:5\:0\:false\:false\:true\:true\:false\:true\:true +NVIC.DMA1_Stream4_IRQn=true\:5\:0\:false\:false\:true\:true\:false\:true\:true +NVIC.DMA2_Stream0_IRQn=true\:5\:0\:false\:false\:true\:true\:false\:true\:true NVIC.DMA2_Stream1_IRQn=true\:5\:0\:true\:false\:true\:true\:false\:true\:true NVIC.DMA2_Stream2_IRQn=true\:5\:0\:false\:false\:true\:true\:false\:true\:true +NVIC.DMA2_Stream5_IRQn=true\:5\:0\:false\:false\:true\:true\:false\:true\:true NVIC.DMA2_Stream6_IRQn=true\:5\:0\:true\:false\:true\:true\:false\:true\:true NVIC.DMA2_Stream7_IRQn=true\:5\:0\:true\:false\:true\:true\:false\:true\:true NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false @@ -178,6 +271,8 @@ NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:fa NVIC.OTG_FS_IRQn=true\:5\:0\:false\:false\:true\:true\:false\:true\:true NVIC.PendSV_IRQn=true\:15\:0\:false\:false\:false\:true\:false\:false\:false NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4 +NVIC.SPI1_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true +NVIC.SPI2_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:false\:false\:false\:false\:false NVIC.SavedPendsvIrqHandlerGenerated=true NVIC.SavedSvcallIrqHandlerGenerated=true @@ -212,6 +307,8 @@ PA7.GPIO_PuPd=GPIO_PULLUP PA7.Locked=true PA7.Mode=Full_Duplex_Master PA7.Signal=SPI1_MOSI +PA8.Mode=I2C +PA8.Signal=I2C3_SCL PA9.Locked=true PA9.Mode=Asynchronous PA9.Signal=USART1_TX @@ -222,6 +319,15 @@ PB0.GPIO_Speed=GPIO_SPEED_FREQ_HIGH PB0.Locked=true PB0.PinState=GPIO_PIN_SET PB0.Signal=GPIO_Output +PB13.Locked=true +PB13.Mode=Full_Duplex_Master +PB13.Signal=SPI2_SCK +PB14.Locked=true +PB14.Mode=Full_Duplex_Master +PB14.Signal=SPI2_MISO +PB15.Locked=true +PB15.Mode=Full_Duplex_Master +PB15.Signal=SPI2_MOSI PB3.GPIOParameters=GPIO_PuPd PB3.GPIO_PuPd=GPIO_PULLUP PB3.Locked=true @@ -255,6 +361,8 @@ PC11.Mode=Asynchronous PC11.Signal=USART3_RX PC6.Locked=true PC6.Signal=S_TIM8_CH1 +PC9.Mode=I2C +PC9.Signal=I2C3_SDA PD0.Locked=true PD0.Mode=CAN_Activate PD0.Signal=CAN1_RX @@ -277,9 +385,25 @@ PE9.GPIO_PuPd=GPIO_PULLUP PE9.GPIO_Speed=GPIO_SPEED_FREQ_HIGH PE9.Locked=true PE9.Signal=S_TIM1_CH1 +PF0.Mode=I2C +PF0.Signal=I2C2_SDA +PF1.Mode=I2C +PF1.Signal=I2C2_SCL PG14.Locked=true PG14.Mode=Asynchronous PG14.Signal=USART6_TX +PG3.GPIOParameters=GPIO_PuPd,GPIO_Label,GPIO_ModeDefaultEXTI +PG3.GPIO_Label=MAG_DR +PG3.GPIO_ModeDefaultEXTI=GPIO_MODE_IT_FALLING +PG3.GPIO_PuPd=GPIO_PULLUP +PG3.Locked=true +PG3.Signal=GPXTI3 +PG6.GPIOParameters=GPIO_Speed,GPIO_PuPd,GPIO_Label +PG6.GPIO_Label=MAG_RST +PG6.GPIO_PuPd=GPIO_PULLUP +PG6.GPIO_Speed=GPIO_SPEED_FREQ_MEDIUM +PG6.Locked=true +PG6.Signal=GPIO_Output PG9.Locked=true PG9.Mode=Asynchronous PG9.Signal=USART6_RX @@ -336,7 +460,7 @@ ProjectManager.StackSize=0x4000 ProjectManager.TargetToolchain=Makefile ProjectManager.ToolChainLocation= ProjectManager.UnderRoot=false -ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-SystemClock_Config-RCC-false-HAL-false,4-MX_ADC1_Init-ADC1-false-HAL-true,5-MX_CAN1_Init-CAN1-false-HAL-true,6-MX_CAN2_Init-CAN2-false-HAL-true,7-MX_SPI1_Init-SPI1-false-HAL-true,8-MX_TIM4_Init-TIM4-false-HAL-true,9-MX_TIM5_Init-TIM5-false-HAL-true,10-MX_USART3_UART_Init-USART3-false-HAL-true,11-MX_RNG_Init-RNG-false-HAL-true,12-MX_RTC_Init-RTC-false-HAL-true,13-MX_TIM1_Init-TIM1-false-HAL-true,14-MX_TIM10_Init-TIM10-false-HAL-true,15-MX_USART1_UART_Init-USART1-false-HAL-true,16-MX_USART6_UART_Init-USART6-false-HAL-true,17-MX_USB_DEVICE_Init-USB_DEVICE-false-HAL-false,18-MX_TIM8_Init-TIM8-false-HAL-true +ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-SystemClock_Config-RCC-false-HAL-false,4-MX_ADC1_Init-ADC1-false-HAL-true,5-MX_CAN1_Init-CAN1-false-HAL-true,6-MX_CAN2_Init-CAN2-false-HAL-true,7-MX_SPI1_Init-SPI1-false-HAL-true,8-MX_TIM4_Init-TIM4-false-HAL-true,9-MX_TIM5_Init-TIM5-false-HAL-true,10-MX_USART3_UART_Init-USART3-false-HAL-true,11-MX_RNG_Init-RNG-false-HAL-true,12-MX_RTC_Init-RTC-false-HAL-true,13-MX_TIM1_Init-TIM1-false-HAL-true,14-MX_TIM10_Init-TIM10-false-HAL-true,15-MX_USART1_UART_Init-USART1-false-HAL-true,16-MX_USART6_UART_Init-USART6-false-HAL-true,17-MX_USB_DEVICE_Init-USB_DEVICE-false-HAL-false,18-MX_TIM8_Init-TIM8-false-HAL-true,19-MX_I2C2_Init-I2C2-false-HAL-true,20-MX_I2C3_Init-I2C3-false-HAL-true,21-MX_SPI2_Init-SPI2-false-HAL-true RCC.48MHZClocksFreq_Value=48000000 RCC.AHBFreq_Value=168000000 RCC.APB1CLKDivider=RCC_HCLK_DIV4 @@ -375,6 +499,8 @@ RCC.VcooutputI2S=192000000 RTC.AsynchPrediv=124 RTC.IPParameters=SynchPrediv,AsynchPrediv RTC.SynchPrediv=3199 +SH.GPXTI3.0=GPIO_EXTI3 +SH.GPXTI3.ConfNb=1 SH.S_TIM10_CH1.0=TIM10_CH1,PWM Generation1 CH1 SH.S_TIM10_CH1.ConfNb=1 SH.S_TIM1_CH1.0=TIM1_CH1,PWM Generation1 CH1 @@ -407,6 +533,14 @@ SPI1.Direction=SPI_DIRECTION_2LINES SPI1.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate,BaudRatePrescaler,CLKPolarity,CLKPhase SPI1.Mode=SPI_MODE_MASTER SPI1.VirtualType=VM_MASTER +SPI2.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_256 +SPI2.CLKPhase=SPI_PHASE_2EDGE +SPI2.CLKPolarity=SPI_POLARITY_HIGH +SPI2.CalculateBaudRate=164.062 KBits/s +SPI2.Direction=SPI_DIRECTION_2LINES +SPI2.IPParameters=VirtualType,Mode,Direction,CLKPhase,CLKPolarity,CalculateBaudRate,BaudRatePrescaler +SPI2.Mode=SPI_MODE_MASTER +SPI2.VirtualType=VM_MASTER STMicroelectronics.X-CUBE-ALGOBUILD.1.3.0.DSPOoLibraryJjLibrary_Checked=true STMicroelectronics.X-CUBE-ALGOBUILD.1.3.0.IPParameters=LibraryCcDSPOoLibraryJjDSPOoLibrary STMicroelectronics.X-CUBE-ALGOBUILD.1.3.0.LibraryCcDSPOoLibraryJjDSPOoLibrary=true diff --git a/bsp/bsp_can.c b/bsp/bsp_can.c index 930cf47..4549afe 100644 --- a/bsp/bsp_can.c +++ b/bsp/bsp_can.c @@ -1,7 +1,7 @@ #include "bsp_can.h" #include "main.h" -#include #include "memory.h" +#include "stdlib.h" /* can instance ptrs storage, used for recv callback */ // 在CAN产生接收中断会遍历数组,选出hcan和rxid与发生中断的实例相同的那个,调用其回调函数 diff --git a/bsp/bsp_iic.c b/bsp/bsp_iic.c index e69de29..805ffed 100644 --- a/bsp/bsp_iic.c +++ b/bsp/bsp_iic.c @@ -0,0 +1,4 @@ +#include "bsp_iic.h" +#include "memory.h" +#include "stdlib.h" + diff --git a/bsp/bsp_iic.h b/bsp/bsp_iic.h index e69de29..aafc249 100644 --- a/bsp/bsp_iic.h +++ b/bsp/bsp_iic.h @@ -0,0 +1,11 @@ +#include "i2c.h" +#include "stdint.h" + +#define IIC_DEVICE_CNT () + +typedef struct +{ + I2C_HandleTypeDef* handle; + +}; + diff --git a/bsp/bsp_spi.c b/bsp/bsp_spi.c index e69de29..184a89c 100644 --- a/bsp/bsp_spi.c +++ b/bsp/bsp_spi.c @@ -0,0 +1,143 @@ +#include "bsp_spi.h" +#include "memory.h" +#include "stdlib.h" + +/* 所有的spi instance保存于此,用于callback时判断中断来源*/ +static SPIInstance *spi_instance[SPI_DEVICE_CNT] = {NULL}; +static uint8_t idx = 0; // 配合中断以及初始化 + +/** + * @brief 当SPI接收完成,将会调用此回调函数,可以进行协议解析或其他必须的数据处理等 + * + * @param hspi spi handle + */ +void HAL_SPI_RxCpltCallback(SPI_HandleTypeDef *hspi) +{ + for (size_t i = 0; i < idx; i++) + { + if (spi_instance[i]->spi_handle == hspi && spi_instance[i]->callback) + { + // 拉高片选(关闭传输),调用解析回调函数 + HAL_GPIO_WritePin(spi_instance[i]->GPIO_cs, spi_instance[i]->cs_pin, GPIO_PIN_SET); + spi_instance[i]->callback(spi_instance[i]); + break; + } + } +} + +/** + * @brief 和RxCpltCallback共用解析即可,这里只是形式上封装一下,不用重复写 + * + * @param hspi spi handle + */ +void HAL_SPI_TxRxCpltCallback(SPI_HandleTypeDef *hspi) +{ + HAL_SPI_RxCpltCallback(hspi); +} + +SPIInstance *SPIRegister(SPI_Init_Config_s *conf) +{ + spi_instance[idx] = (SPIInstance *)malloc(sizeof(SPIInstance)); + spi_instance[idx]->callback = conf->callback; + spi_instance[idx]->spi_work_mode = conf->spi_work_mode; + spi_instance[idx]->spi_handle = conf->spi_handle; + return spi_instance[idx++]; +} + +void SPITransmit(SPIInstance *spi_ins, uint8_t *ptr_data, uint8_t len) +{ + // 拉低片选,开始传输 + HAL_GPIO_WritePin(spi_ins->GPIO_cs, spi_ins->cs_pin, GPIO_PIN_RESET); + switch (spi_ins->spi_work_mode) + { + case SPI_DMA_MODE: + HAL_SPI_Transmit_DMA(spi_ins->spi_handle, ptr_data, len); + break; + case SPI_IT_MODE: + HAL_SPI_Transmit_IT(spi_ins->spi_handle, ptr_data, len); + break; + case SPI_BLOCK_MODE: + HAL_SPI_Transmit(spi_ins->spi_handle, ptr_data, len, 10); + // 阻塞模式不会调用回调函数,传输完成后直接拉高片选结束 + HAL_GPIO_WritePin(spi_ins->GPIO_cs, spi_ins->cs_pin, GPIO_PIN_SET); + break; + default: + while (1) + ; // error mode! 请查看是否正确设置模式,或出现指针越界导致模式被异常修改的情况 + break; + } +} + +void SPIRecv(SPIInstance *spi_ins, uint8_t *ptr_data, uint8_t len) +{ + // 拉低片选,开始传输 + HAL_GPIO_WritePin(spi_ins->GPIO_cs, spi_ins->cs_pin, GPIO_PIN_RESET); + switch (spi_ins->spi_work_mode) + { + case SPI_DMA_MODE: + HAL_SPI_Receive_DMA(spi_ins->spi_handle, ptr_data, len); + break; + case SPI_IT_MODE: + HAL_SPI_Receive_IT(spi_ins->spi_handle, ptr_data, len); + break; + case SPI_BLOCK_MODE: + HAL_SPI_Receive(spi_ins->spi_handle, ptr_data, len, 10); + // 阻塞模式不会调用回调函数,传输完成后直接拉高片选结束 + HAL_GPIO_WritePin(spi_ins->GPIO_cs, spi_ins->cs_pin, GPIO_PIN_SET); + break; + default: + while (1) + ; // error mode! 请查看是否正确设置模式,或出现指针越界导致模式被异常修改的情况 + break; + } +} + +void SPITransRecv(SPIInstance *spi_ins, uint8_t *ptr_data_rx, uint8_t *ptr_data_tx, uint8_t len) +{ + // 拉低片选,开始传输 + HAL_GPIO_WritePin(spi_ins->GPIO_cs, spi_ins->cs_pin, GPIO_PIN_RESET); + switch (spi_ins->spi_work_mode) + { + case SPI_DMA_MODE: + HAL_SPI_TransmitReceive_DMA(spi_ins->spi_handle, ptr_data_tx, ptr_data_rx, len); + break; + case SPI_IT_MODE: + HAL_SPI_TransmitReceive_IT(spi_ins->spi_handle, ptr_data_tx, ptr_data_rx, len); + break; + case SPI_BLOCK_MODE: + HAL_SPI_TransmitReceive(spi_ins->spi_handle, ptr_data_tx, ptr_data_rx, len, 10); + // 阻塞模式不会调用回调函数,传输完成后直接拉高片选结束 + HAL_GPIO_WritePin(spi_ins->GPIO_cs, spi_ins->cs_pin, GPIO_PIN_SET); + break; + default: + while (1) + ; // error mode! 请查看是否正确设置模式,或出现指针越界导致模式被异常修改的情况 + break; + } +} + +void SPISetMode(SPIInstance *spi_ins, SPI_TXRX_MODE_e spi_mode) +{ + if (spi_ins->spi_work_mode != spi_mode) + { + switch (spi_ins->spi_work_mode) + { + case SPI_IT_MODE: + case SPI_DMA_MODE: + // IT和DMA处理相同,都是先终止传输,防止传输未完成直接切换导致spi死机 + HAL_SPI_Abort_IT(spi_ins->spi_handle); + HAL_GPIO_WritePin(spi_ins->GPIO_cs, spi_ins->cs_pin, GPIO_PIN_SET); // 关闭后拉高片选 + break; + case SPI_BLOCK_MODE: + // 阻塞模式仍然有可能在多线程的情况下出现传输到一半切换,因此先终止 + HAL_SPI_Abort(spi_ins->spi_handle); + HAL_GPIO_WritePin(spi_ins->GPIO_cs, spi_ins->cs_pin, GPIO_PIN_SET); // 关闭后拉高片选 + break; + default: + while (1) + ; // error mode! 请查看是否正确设置模式,或出现指针越界导致模式被异常修改的情况 + break; + } + spi_ins->spi_work_mode = spi_mode; + } +} diff --git a/bsp/bsp_spi.h b/bsp/bsp_spi.h index e69de29..c428333 100644 --- a/bsp/bsp_spi.h +++ b/bsp/bsp_spi.h @@ -0,0 +1,82 @@ +#include "spi.h" +#include "stdint.h" +#include "gpio.h" + +/* 根据开发板引出的spi引脚以及CubeMX中的初始化配置设定 */ +#define SPI_DEVICE_CNT 2 // C型开发板引出两路spi,分别连接BMI088/作为扩展IO在8pin牛角座引出 +#define MX_SPI_BUS_SLAVE_CNT 4 // 单个spi总线上挂载的从机数目 + +/* spi transmit recv mode enumerate*/ +typedef enum +{ + SPI_BLOCK_MODE = 0, // 默认使用阻塞模式 + SPI_IT_MODE, + SPI_DMA_MODE, +} SPI_TXRX_MODE_e; + +/* SPI实例结构体定义 */ +typedef struct spi_ins_temp +{ + SPI_HandleTypeDef *spi_handle; // SPI外设handle + GPIO_TypeDef *GPIO_cs; // 片选信号对应的GPIO,如GPIOA,GPIOB等等 + uint16_t cs_pin; // 片选信号对应的引脚号,GPIO_PIN_1,GPIO_PIN_2等等 + SPI_TXRX_MODE_e spi_work_mode; // 传输工作模式 + void (*callback)(struct spi_ins_temp *); // 接收回调函数 +} SPIInstance; + +/* rx data resolve callback*/ +typedef void (*spi_rx_callback)(SPIInstance *); + +/* SPI初始化配置,其实和SPIIstance一模一样,为了代码风格统一因此再次定义 */ +typedef struct +{ + SPI_HandleTypeDef *spi_handle; // SPI外设handle + GPIO_TypeDef *GPIO_cs; // 片选信号对应的GPIO,如GPIOA,GPIOB等等 + uint16_t cs_pin; // 片选信号对应的引脚号,GPIO_PIN_1,GPIO_PIN_2等等 + SPI_TXRX_MODE_e spi_work_mode; // 传输工作模式 + spi_rx_callback callback; // 接收回调函数 +} SPI_Init_Config_s; + +/** + * @brief 注册一个spi instance + * + * @param conf 传入spi配置 + * @return SPIInstance* 返回一个spi实例指针,之后通过该指针操作spi外设 + */ +SPIInstance *SPIRegister(SPI_Init_Config_s *conf); + +/** + * @brief 通过spi向对应从机发送数据 + * + * @param spi_ins spi实例指针 + * @param ptr_data 要发送的数据 + * @param len 待发送的数据长度 + */ +void SPITransmit(SPIInstance *spi_ins, uint8_t *ptr_data, uint8_t len); + +/** + * @brief 通过spi从从机获取数据 + * + * @param spi_ins spi实例指针 + * @param ptr_data 接受数据buffer的首地址 + * @param len 待接收的长度 + */ +void SPIRecv(SPIInstance *spi_ins, uint8_t *ptr_data, uint8_t len); + +/** + * @brief 通过spi利用移位寄存器同时收发数据 + * + * @param spi_ins spi实例指针 + * @param ptr_data_rx 接收数据地址 + * @param ptr_data_tx 发送数据地址 + * @param len 接收&发送的长度 + */ +void SPITransRecv(SPIInstance *spi_ins, uint8_t *ptr_data_rx, uint8_t *ptr_data_tx, uint8_t len); + +/** + * @brief 设定spi收发的工作模式 + * + * @param spi_ins spi实例指针 + * @param spi_mode 工作模式,包括阻塞模式(block),中断模式(IT),DMA模式.详见SPI_TXRX_MODE_e的定义 + */ +void SPISetMode(SPIInstance *spi_ins, SPI_TXRX_MODE_e spi_mode); diff --git a/modules/imu/BMI088driver.c b/modules/imu/BMI088driver.c index 787a304..db2d2eb 100644 --- a/modules/imu/BMI088driver.c +++ b/modules/imu/BMI088driver.c @@ -317,7 +317,7 @@ uint8_t bmi088_gyro_init(void) void BMI088_Read(IMU_Data_t *bmi088) { - static uint8_t buf[8] = {0, 0, 0, 0, 0, 0}; + static uint8_t buf[8] = {0}; static int16_t bmi088_raw_temp; static float dt = 1.0; static uint8_t first_read_flag = 0; diff --git a/modules/message_center/message_center.md b/modules/message_center/message_center.md index 183a02d..9db777f 100644 --- a/modules/message_center/message_center.md +++ b/modules/message_center/message_center.md @@ -24,7 +24,7 @@ - 订阅者:获取消息的对象。订阅者在订阅了某个事件之后,可以通过接口获得该事件的消息。 - 事件(event / topic):用于区分消息来源的对象。可以将一个事件看作一刊杂志,不同的发布者会将文章汇集到杂志上,而订阅者选择订阅一种杂志,然后就可以获取所有写在杂志上的文章。 -Message Center不同应用间进行消息传递的中介,它的存在可以在相当大的程度上解耦不同的app,使得不同的应用之间**不存在包含关系**,让代码的自由度更大,将不同模块之间的关系降为**松耦合**。在以往,如果一个.c文件中的数据需要被其他任务/源文件共享,那么其他模块应该要包含前者的头文件,或头文件中应当存在获取该模块数据的接口(即函数,一般是返回数据指针或直接返回数据);但现在,不同的应用之间完全隔离,他们不需要了解彼此的存在,而是只能看见一个**消息中心**。 +Message Center不同应用间进行消息传递的中介,它的存在可以在相当大的程度上解耦不同的app,使得不同的应用之间**不存在包含关系**,让代码的自由度更大,将不同模块之间的关系降为**松耦合**。在以往,如果一个.c文件中的数据需要被其他任务/源文件共享,那么其他模块应该要包含前者的头文件,且头文件中应当存在获取该模块数据的接口(即函数,一般是返回数据指针或直接返回数据,**强烈建议不要使用全局变量**);但现在,不同的应用之间完全隔离,他们不需要了解彼此的存在,而是只能看见一个**消息中心**以及一些事件(有些地方也称**话题**)。 需要被共享的消息,将会被**发布者**(publisher)发送到消息中心;要获取消息,则由**订阅者**(subscriber)从消息中心根据订阅的消息名(事件)获取。在这之前,发布者要在消息中心完成**注册**,将自己要发布的消息类型和消息名称提交到消息中心;订阅者同样要先在消息中心完成订阅,将自己要接收的消息类型和消息名称提交到订阅中心。消息中心会根据**消息名称**,把订阅者绑定到发布相同名称的发布者上。 diff --git a/openocd_dap.cfg b/openocd_dap.cfg index 8710b89..2ff8684 100644 --- a/openocd_dap.cfg +++ b/openocd_dap.cfg @@ -1,7 +1,7 @@ # 选择调试器为jlink source [find interface/cmsis-dap.cfg] -# source [find interface/jlink.cfg] #使用jlink硬件进行调试,注意其他地方也要更改 +# source [find interface/jlink.cfg] #使用cmsis-dap硬件进行调试,注意其他地方也要更改 # OpenOCD作为GDB和硬件调试器的桥梁(为硬件提供抽象,把接口给GDB),支持多种硬件调试器. # OpenOCD会自动在其根目录的share/openocd/scripts/interface里面寻找对应的配置文件