From 5b215855cc9e3369f5eb9b7bf68846407fdf9de8 Mon Sep 17 00:00:00 2001 From: ShunjiHashimoto Date: Wed, 18 Dec 2024 02:14:09 +0900 Subject: [PATCH] =?UTF-8?q?=E5=89=B2=E3=82=8A=E8=BE=BC=E3=81=BF=E3=81=A7?= =?UTF-8?q?=E5=A3=81=E3=82=BB=E3=83=B3=E3=82=B5=E3=81=AE=E5=80=A4=E5=8F=96?= =?UTF-8?q?=E5=BE=97=E5=AE=8C=E4=BA=86=E3=80=81=E8=A6=81=E3=83=AA=E3=83=95?= =?UTF-8?q?=E3=82=A1=E3=82=AF=E3=82=BF=E3=80=81=E3=81=BE=E3=81=9F=E5=89=B2?= =?UTF-8?q?=E3=82=8A=E8=BE=BC=E3=81=BF=E5=91=A8=E6=9C=9F=E3=82=82=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .mxproject | 32 ++++++++--------- Core/Inc/dma.h | 52 --------------------------- Core/Inc/params.hpp | 4 +++ Core/Inc/photo_trans.hpp | 12 ++++--- Core/Inc/robot_controller.hpp | 1 + Core/Inc/stm32f4xx_it.h | 1 - Core/Src/adc.c | 60 +++---------------------------- Core/Src/dma.c | 55 ---------------------------- Core/Src/main.cpp | 10 ++---- Core/Src/params.cpp | 4 +++ Core/Src/photo_trans.cpp | 66 ++++++++++++++++++++++++++-------- Core/Src/robot_controller.cpp | 7 ++++ Core/Src/stm32f4xx_it.c | 31 ++++------------ Core/Src/tim.c | 2 +- micro_tang.ioc | 67 ++++++++++++----------------------- 15 files changed, 126 insertions(+), 278 deletions(-) delete mode 100644 Core/Inc/dma.h delete mode 100644 Core/Src/dma.c diff --git a/.mxproject b/.mxproject index 47301b9..0976d68 100644 --- a/.mxproject +++ b/.mxproject @@ -2,35 +2,33 @@ LibFiles=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_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_spi.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_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;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_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_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;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_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_spi.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_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;Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f405xx.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/core_cm55.h;Drivers/CMSIS/Include/cmsis_gcc.h;Drivers/CMSIS/Include/pac_armv81.h;Drivers/CMSIS/Include/core_cm7.h;Drivers/CMSIS/Include/cmsis_version.h;Drivers/CMSIS/Include/core_cm1.h;Drivers/CMSIS/Include/core_armv81mml.h;Drivers/CMSIS/Include/pmu_armv8.h;Drivers/CMSIS/Include/cachel1_armv7.h;Drivers/CMSIS/Include/core_cm3.h;Drivers/CMSIS/Include/cmsis_armcc.h;Drivers/CMSIS/Include/tz_context.h;Drivers/CMSIS/Include/cmsis_compiler.h;Drivers/CMSIS/Include/core_cm35p.h;Drivers/CMSIS/Include/cmsis_armclang_ltm.h;Drivers/CMSIS/Include/mpu_armv7.h;Drivers/CMSIS/Include/core_cm33.h;Drivers/CMSIS/Include/core_starmc1.h;Drivers/CMSIS/Include/core_sc000.h;Drivers/CMSIS/Include/core_armv8mbl.h;Drivers/CMSIS/Include/core_cm0.h;Drivers/CMSIS/Include/core_cm4.h;Drivers/CMSIS/Include/cmsis_armclang.h;Drivers/CMSIS/Include/core_cm23.h;Drivers/CMSIS/Include/core_cm0plus.h;Drivers/CMSIS/Include/core_sc300.h;Drivers/CMSIS/Include/core_armv8mml.h;Drivers/CMSIS/Include/core_cm85.h;Drivers/CMSIS/Include/cmsis_iccarm.h;Drivers/CMSIS/Include/mpu_armv8.h; [PreviousUsedCubeIDEFiles] -SourceFiles=Core/Src/main.c;Core/Src/gpio.c;Core/Src/adc.c;Core/Src/dma.c;Core/Src/spi.c;Core/Src/tim.c;Core/Src/usart.c;Core/Src/stm32f4xx_it.c;Core/Src/stm32f4xx_hal_msp.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_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_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;Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c;Core/Src/system_stm32f4xx.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_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_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;Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c;Core/Src/system_stm32f4xx.c;;; +SourceFiles=Core/Src/main.c;Core/Src/gpio.c;Core/Src/adc.c;Core/Src/spi.c;Core/Src/tim.c;Core/Src/usart.c;Core/Src/stm32f4xx_it.c;Core/Src/stm32f4xx_hal_msp.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_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_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;Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c;Core/Src/system_stm32f4xx.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_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_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;Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c;Core/Src/system_stm32f4xx.c;;; HeaderPath=Drivers/STM32F4xx_HAL_Driver/Inc;Drivers/STM32F4xx_HAL_Driver/Inc/Legacy;Drivers/CMSIS/Device/ST/STM32F4xx/Include;Drivers/CMSIS/Include;Core/Inc; CDefines=USE_HAL_DRIVER;STM32F405xx;USE_HAL_DRIVER;USE_HAL_DRIVER; [PreviousGenFiles] AdvancedFolderStructure=true -HeaderFileListSize=9 +HeaderFileListSize=8 HeaderFiles#0=../Core/Inc/gpio.h HeaderFiles#1=../Core/Inc/adc.h -HeaderFiles#2=../Core/Inc/dma.h -HeaderFiles#3=../Core/Inc/spi.h -HeaderFiles#4=../Core/Inc/tim.h -HeaderFiles#5=../Core/Inc/usart.h -HeaderFiles#6=../Core/Inc/stm32f4xx_it.h -HeaderFiles#7=../Core/Inc/stm32f4xx_hal_conf.h -HeaderFiles#8=../Core/Inc/main.h +HeaderFiles#2=../Core/Inc/spi.h +HeaderFiles#3=../Core/Inc/tim.h +HeaderFiles#4=../Core/Inc/usart.h +HeaderFiles#5=../Core/Inc/stm32f4xx_it.h +HeaderFiles#6=../Core/Inc/stm32f4xx_hal_conf.h +HeaderFiles#7=../Core/Inc/main.h HeaderFolderListSize=1 HeaderPath#0=../Core/Inc HeaderFiles=; -SourceFileListSize=9 +SourceFileListSize=8 SourceFiles#0=../Core/Src/gpio.c SourceFiles#1=../Core/Src/adc.c -SourceFiles#2=../Core/Src/dma.c -SourceFiles#3=../Core/Src/spi.c -SourceFiles#4=../Core/Src/tim.c -SourceFiles#5=../Core/Src/usart.c -SourceFiles#6=../Core/Src/stm32f4xx_it.c -SourceFiles#7=../Core/Src/stm32f4xx_hal_msp.c -SourceFiles#8=../Core/Src/main.c +SourceFiles#2=../Core/Src/spi.c +SourceFiles#3=../Core/Src/tim.c +SourceFiles#4=../Core/Src/usart.c +SourceFiles#5=../Core/Src/stm32f4xx_it.c +SourceFiles#6=../Core/Src/stm32f4xx_hal_msp.c +SourceFiles#7=../Core/Src/main.c SourceFolderListSize=1 SourcePath#0=../Core/Src SourceFiles=; diff --git a/Core/Inc/dma.h b/Core/Inc/dma.h deleted file mode 100644 index 68ee595..0000000 --- a/Core/Inc/dma.h +++ /dev/null @@ -1,52 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file dma.h - * @brief This file contains all the function prototypes for - * the dma.c file - ****************************************************************************** - * @attention - * - * Copyright (c) 2024 STMicroelectronics. - * All rights reserved. - * - * This software is licensed under terms that can be found in the LICENSE file - * in the root directory of this software component. - * If no LICENSE file comes with this software, it is provided AS-IS. - * - ****************************************************************************** - */ -/* USER CODE END Header */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __DMA_H__ -#define __DMA_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* DMA memory to memory transfer handles -------------------------------------*/ - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_DMA_Init(void); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif /* __DMA_H__ */ - diff --git a/Core/Inc/params.hpp b/Core/Inc/params.hpp index 22891c1..1897105 100644 --- a/Core/Inc/params.hpp +++ b/Core/Inc/params.hpp @@ -65,4 +65,8 @@ namespace Mode { LOG }; } + +namespace ADCParam { + const int SENSOR_COUNT = 4; +} #endif // INC_PARAMS_HPP diff --git a/Core/Inc/photo_trans.hpp b/Core/Inc/photo_trans.hpp index d6e3f40..1f6cc17 100644 --- a/Core/Inc/photo_trans.hpp +++ b/Core/Inc/photo_trans.hpp @@ -1,22 +1,24 @@ #ifndef INC_PHOTO_TRANS_HPP_ #define INC_PHOTO_TRANS_HPP_ + #include "../../Core/Inc/main.h" #include "adc.h" #include "tim.h" #include "stm32f4xx_hal.h" #include "stm32f405xx.h" #include "led.hpp" +#include "params.hpp" class PhotoTransSensor { public: - GPIO_TypeDef* LED_PORTS[4] = {LL_LED_GPIO_Port, RF_LED_GPIO_Port, LF_LED_GPIO_Port, RR_LED_GPIO_Port}; uint16_t LED_PINS[4] = {LL_LED_Pin, RF_LED_Pin, LF_LED_Pin, RR_LED_Pin}; - uint32_t adc_value = 0; - float adc_val[4]; - void getWallSensorData(); - LedSensor led_sensor; + uint32_t adc_channels[4] = {ADC_CHANNEL_9, ADC_CHANNEL_13, ADC_CHANNEL_15, ADC_CHANNEL_11}; + void configureADCChannel(uint32_t channel); + uint16_t getCurrentADC(int i) const; + void updateADC(int i); + uint16_t adc_val[4] = {0}; }; #endif /* INC_PHOTO_TRANS_HPP_ */ diff --git a/Core/Inc/robot_controller.hpp b/Core/Inc/robot_controller.hpp index 76b3ff3..97045d1 100644 --- a/Core/Inc/robot_controller.hpp +++ b/Core/Inc/robot_controller.hpp @@ -7,6 +7,7 @@ #include "motor.hpp" #include "log.hpp" #include "adc.h" +#include "photo_trans.hpp" // TODO: diff --git a/Core/Inc/stm32f4xx_it.h b/Core/Inc/stm32f4xx_it.h index 6c529e8..5795423 100644 --- a/Core/Inc/stm32f4xx_it.h +++ b/Core/Inc/stm32f4xx_it.h @@ -60,7 +60,6 @@ void TIM4_IRQHandler(void); void TIM8_BRK_TIM12_IRQHandler(void); void TIM5_IRQHandler(void); void TIM7_IRQHandler(void); -void DMA2_Stream0_IRQHandler(void); /* USER CODE BEGIN EFP */ /* USER CODE END EFP */ diff --git a/Core/Src/adc.c b/Core/Src/adc.c index 4b9ccb0..bc680bb 100644 --- a/Core/Src/adc.c +++ b/Core/Src/adc.c @@ -26,7 +26,6 @@ ADC_HandleTypeDef hadc1; ADC_HandleTypeDef hadc2; -DMA_HandleTypeDef hdma_adc1; /* ADC1 init function */ void MX_ADC1_Init(void) @@ -47,15 +46,15 @@ void MX_ADC1_Init(void) hadc1.Instance = ADC1; hadc1.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV4; hadc1.Init.Resolution = ADC_RESOLUTION_12B; - hadc1.Init.ScanConvMode = ENABLE; - hadc1.Init.ContinuousConvMode = ENABLE; + hadc1.Init.ScanConvMode = DISABLE; + hadc1.Init.ContinuousConvMode = DISABLE; hadc1.Init.DiscontinuousConvMode = DISABLE; hadc1.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE; hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START; hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT; - hadc1.Init.NbrOfConversion = 4; - hadc1.Init.DMAContinuousRequests = ENABLE; - hadc1.Init.EOCSelection = ADC_EOC_SEQ_CONV; + hadc1.Init.NbrOfConversion = 1; + hadc1.Init.DMAContinuousRequests = DISABLE; + hadc1.Init.EOCSelection = ADC_EOC_SINGLE_CONV; if (HAL_ADC_Init(&hadc1) != HAL_OK) { Error_Handler(); @@ -70,34 +69,6 @@ void MX_ADC1_Init(void) { Error_Handler(); } - - /** Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time. - */ - sConfig.Channel = ADC_CHANNEL_13; - sConfig.Rank = 2; - if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK) - { - Error_Handler(); - } - - /** Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time. - */ - sConfig.Channel = ADC_CHANNEL_15; - sConfig.Rank = 3; - sConfig.SamplingTime = ADC_SAMPLETIME_3CYCLES; - if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK) - { - Error_Handler(); - } - - /** Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time. - */ - sConfig.Channel = ADC_CHANNEL_11; - sConfig.Rank = 4; - if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK) - { - Error_Handler(); - } /* USER CODE BEGIN ADC1_Init 2 */ /* USER CODE END ADC1_Init 2 */ @@ -181,25 +152,6 @@ void HAL_ADC_MspInit(ADC_HandleTypeDef* adcHandle) GPIO_InitStruct.Pull = GPIO_NOPULL; HAL_GPIO_Init(LL_ADC1_GPIO_Port, &GPIO_InitStruct); - /* ADC1 DMA Init */ - /* ADC1 Init */ - hdma_adc1.Instance = DMA2_Stream0; - hdma_adc1.Init.Channel = DMA_CHANNEL_0; - hdma_adc1.Init.Direction = DMA_PERIPH_TO_MEMORY; - hdma_adc1.Init.PeriphInc = DMA_PINC_DISABLE; - hdma_adc1.Init.MemInc = DMA_MINC_ENABLE; - hdma_adc1.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD; - hdma_adc1.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD; - hdma_adc1.Init.Mode = DMA_CIRCULAR; - hdma_adc1.Init.Priority = DMA_PRIORITY_LOW; - hdma_adc1.Init.FIFOMode = DMA_FIFOMODE_DISABLE; - if (HAL_DMA_Init(&hdma_adc1) != HAL_OK) - { - Error_Handler(); - } - - __HAL_LINKDMA(adcHandle,DMA_Handle,hdma_adc1); - /* USER CODE BEGIN ADC1_MspInit 1 */ /* USER CODE END ADC1_MspInit 1 */ @@ -248,8 +200,6 @@ void HAL_ADC_MspDeInit(ADC_HandleTypeDef* adcHandle) HAL_GPIO_DeInit(LL_ADC1_GPIO_Port, LL_ADC1_Pin); - /* ADC1 DMA DeInit */ - HAL_DMA_DeInit(adcHandle->DMA_Handle); /* USER CODE BEGIN ADC1_MspDeInit 1 */ /* USER CODE END ADC1_MspDeInit 1 */ diff --git a/Core/Src/dma.c b/Core/Src/dma.c deleted file mode 100644 index bfa537c..0000000 --- a/Core/Src/dma.c +++ /dev/null @@ -1,55 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file dma.c - * @brief This file provides code for the configuration - * of all the requested memory to memory DMA transfers. - ****************************************************************************** - * @attention - * - * Copyright (c) 2024 STMicroelectronics. - * All rights reserved. - * - * This software is licensed under terms that can be found in the LICENSE file - * in the root directory of this software component. - * If no LICENSE file comes with this software, it is provided AS-IS. - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Includes ------------------------------------------------------------------*/ -#include "dma.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/*----------------------------------------------------------------------------*/ -/* Configure DMA */ -/*----------------------------------------------------------------------------*/ - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/** - * Enable DMA controller clock - */ -void MX_DMA_Init(void) -{ - - /* DMA controller clock enable */ - __HAL_RCC_DMA2_CLK_ENABLE(); - - /* DMA interrupt init */ - /* DMA2_Stream0_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(DMA2_Stream0_IRQn, 0, 0); - HAL_NVIC_EnableIRQ(DMA2_Stream0_IRQn); - -} - -/* USER CODE BEGIN 2 */ - -/* USER CODE END 2 */ - diff --git a/Core/Src/main.cpp b/Core/Src/main.cpp index aa0d4e1..9687c1e 100644 --- a/Core/Src/main.cpp +++ b/Core/Src/main.cpp @@ -19,7 +19,6 @@ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "adc.h" -#include "dma.h" #include "spi.h" #include "tim.h" #include "usart.h" @@ -122,7 +121,6 @@ int main(void) /* Initialize all configured peripherals */ MX_GPIO_Init(); - MX_DMA_Init(); MX_USART3_UART_Init(); MX_ADC1_Init(); MX_TIM1_Init(); @@ -140,8 +138,6 @@ int main(void) gyroInit(&gyro); initInterrupt(); updateBattery(); - uint16_t adc_Value[4]; - HAL_ADC_Start_DMA(&hadc1, (uint32_t*)adc_Value, 4); /* USER CODE END 2 */ /* Infinite loop */ @@ -149,9 +145,9 @@ int main(void) while (1){ // ledBlink.toggle(); // photo_trans_sensor.getWallSensorData(); - printf("LL_ADC =%d, RF_ADC =%d, LF_ADC =%d, RR_ADC =%d\n\r", adc_Value[0], adc_Value[1], adc_Value[2], adc_Value[3]); - // robot_controller.mainControl(); - // HAL_Delay(MotorParam::RATE); + // printf("LL_ADC =%d, RF_ADC =%d, LF_ADC =%d, RR_ADC =%d\n\r", ADCParam::adc_val[0], ADCParam::adc_val[1], ADCParam::adc_val[2], ADCParam::adc_val[3]); + robot_controller.mainControl(); + HAL_Delay(MotorParam::RATE); // printf("encoder_l: %lf, encoder_r: %lf\n\r", encoder_l.rotation_speed, encoder_r.rotation_speed); /* USER CODE END WHILE */ diff --git a/Core/Src/params.cpp b/Core/Src/params.cpp index e7c6aae..5151f88 100644 --- a/Core/Src/params.cpp +++ b/Core/Src/params.cpp @@ -23,4 +23,8 @@ namespace Battery { namespace Mode { uint8_t current_mode = 0; +} + +namespace ADCParam { + uint16_t adc_val[4] = {0}; } \ No newline at end of file diff --git a/Core/Src/photo_trans.cpp b/Core/Src/photo_trans.cpp index 134d29f..3b43dca 100644 --- a/Core/Src/photo_trans.cpp +++ b/Core/Src/photo_trans.cpp @@ -1,23 +1,59 @@ #include "../../Core/Inc/photo_trans.hpp" -void PhotoTransSensor::getWallSensorData() { - uint16_t a[4]; - GPIO_TypeDef* LED_PORTS[4] = {LL_LED_GPIO_Port, RF_LED_GPIO_Port, LF_LED_GPIO_Port, RR_LED_GPIO_Port}; - uint16_t LED_PINS[4] = {LL_LED_Pin, RF_LED_Pin, LF_LED_Pin, RR_LED_Pin}; - for(int i=0; i<4; i++){ - HAL_GPIO_WritePin(LED_PORTS[i], LED_PINS[i], GPIO_PIN_SET); - for(int i=0; i<100; i++) {} - if(HAL_ADC_Start(&hadc1) == HAL_OK){ - HAL_ADC_PollForConversion(&hadc1, 1); - a[i] = HAL_ADC_GetValue(&hadc1); - HAL_GPIO_WritePin(LED_PORTS[i], LED_PINS[i], GPIO_PIN_RESET); - HAL_Delay(1); - } +PhotoTransSensor photo_trans_sensor; + +extern "C" { + void readADC(int i){ + photo_trans_sensor.updateADC(i); } - - printf("LL_ADC =%d, RF_ADC =%d, LF_ADC =%d, RR_ADC =%d\n\r", a[0], a[1], a[2], a[3]); } +void PhotoTransSensor::updateADC(int i){ + // LED点灯 + HAL_GPIO_WritePin(this->LED_PORTS[i], this->LED_PINS[i], GPIO_PIN_SET); + for(int j=0; j<200; j++) {} + this->configureADCChannel(this->adc_channels[i]); + if (HAL_ADC_Start(&hadc1) == HAL_OK) { + // 受光データ取得 + HAL_ADC_PollForConversion(&hadc1, 1); + this->adc_val[i] = HAL_ADC_GetValue(&hadc1); + // LED消灯 + HAL_GPIO_WritePin(this->LED_PORTS[i], this->LED_PINS[i], GPIO_PIN_RESET); + } +} + +// ADCチャネルを動的に設定 +void PhotoTransSensor::configureADCChannel(uint32_t channel) { + ADC_ChannelConfTypeDef sConfig = {0}; + sConfig.Channel = channel; + sConfig.Rank = 1; // RANKは常に1つだけ設定する + sConfig.SamplingTime = ADC_SAMPLETIME_15CYCLES; + + if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK) { + Error_Handler(); + } +} + +uint16_t PhotoTransSensor::getCurrentADC(int i) const { + return this->adc_val[i]; +} + +// void PhotoTransSensor::getWallSensorData() { +// uint16_t a[4]; +// for(int i=0; i<4; i++){ +// HAL_GPIO_WritePin(LED_PORTS[i], LED_PINS[i], GPIO_PIN_SET); +// for(int i=0; i<100; i++) {} +// if(HAL_ADC_Start(&hadc1) == HAL_OK){ +// HAL_ADC_PollForConversion(&hadc1, 1); +// a[i] = HAL_ADC_GetValue(&hadc1); +// HAL_GPIO_WritePin(LED_PORTS[i], LED_PINS[i], GPIO_PIN_RESET); +// HAL_Delay(1); +// } +// } + +// printf("LL_ADC =%d, RF_ADC =%d, LF_ADC =%d, RR_ADC =%d\n\r", a[0], a[1], a[2], a[3]); +// } + // IN15: LF_ADC // IN13: RF_ADC // IN11: RR_ADC diff --git a/Core/Src/robot_controller.cpp b/Core/Src/robot_controller.cpp index 6c15029..2abb342 100644 --- a/Core/Src/robot_controller.cpp +++ b/Core/Src/robot_controller.cpp @@ -1,6 +1,7 @@ #include "robot_controller.hpp" extern ModeManager mode_manager; +extern PhotoTransSensor photo_trans_sensor; extern Motor motor_l; extern Motor motor_r; extern Log vel_log; @@ -121,6 +122,12 @@ void RobotController::mainControl(){ // motor_l.Stop(); // return; // } + for(int i=0; i<4; i++){ + auto adc_val = photo_trans_sensor.getCurrentADC(i); + printf("adc_val[%d]: %d\n\r", i, adc_val); + } + printf("Finished 1 loop\n\r"); + HAL_Delay(200); // モード更新し、終了 current_mode = mode_manager.getCurrentMode(); return; diff --git a/Core/Src/stm32f4xx_it.c b/Core/Src/stm32f4xx_it.c index 35544e6..b6f00bf 100644 --- a/Core/Src/stm32f4xx_it.c +++ b/Core/Src/stm32f4xx_it.c @@ -29,6 +29,7 @@ extern void pwmControl(); extern void updateModeManager(); extern void updateLog(); extern void ledSensorBlink(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pinx); +extern void readADC(int i); /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ @@ -50,7 +51,8 @@ extern void ledSensorBlink(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pinx); /* USER CODE BEGIN PV */ Encoder encoder_r; Encoder encoder_l; -Gyro gyro; +Gyro gyro; +int adc_index = 0; /* USER CODE END PV */ /* Private function prototypes -----------------------------------------------*/ @@ -64,7 +66,6 @@ Gyro gyro; /* USER CODE END 0 */ /* External variables --------------------------------------------------------*/ -extern DMA_HandleTypeDef hdma_adc1; extern TIM_HandleTypeDef htim1; extern TIM_HandleTypeDef htim4; extern TIM_HandleTypeDef htim5; @@ -287,37 +288,17 @@ void TIM5_IRQHandler(void) void TIM7_IRQHandler(void) { /* USER CODE BEGIN TIM7_IRQn 0 */ - // HAL_GPIO_WritePin(RR_LED_GPIO_Port, RR_LED_Pin, GPIO_PIN_SET); //LEDを点灯 - // HAL_Delay(100); - // HAL_GPIO_WritePin(RR_LED_GPIO_Port, RR_LED_Pin, GPIO_PIN_RESET); //LEDを点灯 - // HAL_Delay(100); - - // ledSensorBlink(RR_LED_GPIO_Port, RR_LED_Pin); - // ledSensorBlink(RF_LED_GPIO_Port, RF_LED_Pin); - // ledSensorBlink(LL_LED_GPIO_Port, LL_LED_Pin); - // ledSensorBlink(LF_LED_GPIO_Port, LF_LED_Pin); /* USER CODE END TIM7_IRQn 0 */ HAL_TIM_IRQHandler(&htim7); /* USER CODE BEGIN TIM7_IRQn 1 */ + int current_index = adc_index%4; + readADC(current_index); + adc_index++; /* USER CODE END TIM7_IRQn 1 */ } -/** - * @brief This function handles DMA2 stream0 global interrupt. - */ -void DMA2_Stream0_IRQHandler(void) -{ - /* USER CODE BEGIN DMA2_Stream0_IRQn 0 */ - - /* USER CODE END DMA2_Stream0_IRQn 0 */ - HAL_DMA_IRQHandler(&hdma_adc1); - /* USER CODE BEGIN DMA2_Stream0_IRQn 1 */ - - /* USER CODE END DMA2_Stream0_IRQn 1 */ -} - /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ diff --git a/Core/Src/tim.c b/Core/Src/tim.c index b1a2241..756dde8 100644 --- a/Core/Src/tim.c +++ b/Core/Src/tim.c @@ -289,7 +289,7 @@ void MX_TIM7_Init(void) /* USER CODE END TIM7_Init 1 */ htim7.Instance = TIM7; - htim7.Init.Prescaler = 8400-1; + htim7.Init.Prescaler = 1000-1; htim7.Init.CounterMode = TIM_COUNTERMODE_UP; htim7.Init.Period = 10000-1; htim7.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; diff --git a/micro_tang.ioc b/micro_tang.ioc index 8f13ce8..dd5f06c 100644 --- a/micro_tang.ioc +++ b/micro_tang.ioc @@ -1,23 +1,14 @@ #MicroXplorer Configuration settings - do not modify ADC1.Channel-1\#ChannelRegularConversion=ADC_CHANNEL_9 -ADC1.Channel-2\#ChannelRegularConversion=ADC_CHANNEL_13 -ADC1.Channel-3\#ChannelRegularConversion=ADC_CHANNEL_15 -ADC1.Channel-4\#ChannelRegularConversion=ADC_CHANNEL_11 -ADC1.ContinuousConvMode=ENABLE -ADC1.DMAContinuousRequests=ENABLE +ADC1.ContinuousConvMode=DISABLE +ADC1.DMAContinuousRequests=DISABLE ADC1.DiscontinuousConvMode=DISABLE -ADC1.EOCSelection=ADC_EOC_SEQ_CONV -ADC1.IPParameters=master,NbrOfConversionFlag,Channel-1\#ChannelRegularConversion,SamplingTime-1\#ChannelRegularConversion,ScanConvMode,DiscontinuousConvMode,EOCSelection,NbrOfConversion,Rank-2\#ChannelRegularConversion,Channel-2\#ChannelRegularConversion,SamplingTime-2\#ChannelRegularConversion,Rank-3\#ChannelRegularConversion,Channel-3\#ChannelRegularConversion,SamplingTime-3\#ChannelRegularConversion,Rank-4\#ChannelRegularConversion,Channel-4\#ChannelRegularConversion,SamplingTime-4\#ChannelRegularConversion,ContinuousConvMode,DMAContinuousRequests -ADC1.NbrOfConversion=4 +ADC1.EOCSelection=ADC_EOC_SINGLE_CONV +ADC1.IPParameters=master,NbrOfConversionFlag,Channel-1\#ChannelRegularConversion,SamplingTime-1\#ChannelRegularConversion,ScanConvMode,DiscontinuousConvMode,EOCSelection,NbrOfConversion,ContinuousConvMode,DMAContinuousRequests +ADC1.NbrOfConversion=1 ADC1.NbrOfConversionFlag=1 -ADC1.Rank-2\#ChannelRegularConversion=2 -ADC1.Rank-3\#ChannelRegularConversion=3 -ADC1.Rank-4\#ChannelRegularConversion=4 ADC1.SamplingTime-1\#ChannelRegularConversion=ADC_SAMPLETIME_28CYCLES -ADC1.SamplingTime-2\#ChannelRegularConversion=ADC_SAMPLETIME_28CYCLES -ADC1.SamplingTime-3\#ChannelRegularConversion=ADC_SAMPLETIME_3CYCLES -ADC1.SamplingTime-4\#ChannelRegularConversion=ADC_SAMPLETIME_3CYCLES -ADC1.ScanConvMode=ENABLE +ADC1.ScanConvMode=DISABLE ADC1.master=1 ADC2.Channel-1\#ChannelRegularConversion=ADC_CHANNEL_2 ADC2.IPParameters=Rank-1\#ChannelRegularConversion,Channel-1\#ChannelRegularConversion,SamplingTime-1\#ChannelRegularConversion,NbrOfConversionFlag @@ -27,18 +18,6 @@ ADC2.SamplingTime-1\#ChannelRegularConversion=ADC_SAMPLETIME_3CYCLES CAD.formats= CAD.pinconfig= CAD.provider= -Dma.ADC1.0.Direction=DMA_PERIPH_TO_MEMORY -Dma.ADC1.0.FIFOMode=DMA_FIFOMODE_DISABLE -Dma.ADC1.0.Instance=DMA2_Stream0 -Dma.ADC1.0.MemDataAlignment=DMA_MDATAALIGN_HALFWORD -Dma.ADC1.0.MemInc=DMA_MINC_ENABLE -Dma.ADC1.0.Mode=DMA_CIRCULAR -Dma.ADC1.0.PeriphDataAlignment=DMA_PDATAALIGN_HALFWORD -Dma.ADC1.0.PeriphInc=DMA_PINC_DISABLE -Dma.ADC1.0.Priority=DMA_PRIORITY_LOW -Dma.ADC1.0.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority,FIFOMode -Dma.Request0=ADC1 -Dma.RequestsNb=1 File.Version=6 GPIO.groupedBy=Group By Peripherals KeepUserPlacement=false @@ -46,21 +25,20 @@ Mcu.CPN=STM32F405RGT6 Mcu.Family=STM32F4 Mcu.IP0=ADC1 Mcu.IP1=ADC2 -Mcu.IP10=TIM4 -Mcu.IP11=TIM5 -Mcu.IP12=TIM7 -Mcu.IP13=TIM9 -Mcu.IP14=TIM12 -Mcu.IP15=USART3 -Mcu.IP2=DMA -Mcu.IP3=NVIC -Mcu.IP4=RCC -Mcu.IP5=SPI2 -Mcu.IP6=SYS -Mcu.IP7=TIM1 -Mcu.IP8=TIM2 -Mcu.IP9=TIM3 -Mcu.IPNb=16 +Mcu.IP10=TIM5 +Mcu.IP11=TIM7 +Mcu.IP12=TIM9 +Mcu.IP13=TIM12 +Mcu.IP14=USART3 +Mcu.IP2=NVIC +Mcu.IP3=RCC +Mcu.IP4=SPI2 +Mcu.IP5=SYS +Mcu.IP6=TIM1 +Mcu.IP7=TIM2 +Mcu.IP8=TIM3 +Mcu.IP9=TIM4 +Mcu.IPNb=15 Mcu.Name=STM32F405RGTx Mcu.Package=LQFP64 Mcu.Pin0=PC0 @@ -108,7 +86,6 @@ Mcu.UserName=STM32F405RGTx MxCube.Version=6.10.0 MxDb.Version=DB.6.0.100 NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false -NVIC.DMA2_Stream0_IRQn=true\:0\:0\:false\:false\:true\:false\:true\:true NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false NVIC.ForceEnableDMAVector=true NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false @@ -271,7 +248,7 @@ ProjectManager.ToolChainLocation= ProjectManager.UAScriptAfterPath=/home/hashimoto/STM32CubeIDE/workspace_1.14.0/micro_tang/scripts/after.py ProjectManager.UAScriptBeforePath=/home/hashimoto/STM32CubeIDE/workspace_1.14.0/micro_tang/scripts/before.py ProjectManager.UnderRoot=true -ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_DMA_Init-DMA-false-HAL-true,4-MX_USART3_UART_Init-USART3-false-HAL-true,5-MX_ADC1_Init-ADC1-false-HAL-true,6-MX_TIM1_Init-TIM1-false-HAL-true,7-MX_TIM2_Init-TIM2-false-HAL-true,8-MX_TIM4_Init-TIM4-false-HAL-true,9-MX_TIM3_Init-TIM3-false-HAL-true,10-MX_SPI2_Init-SPI2-false-HAL-true,11-MX_ADC2_Init-ADC2-false-HAL-true,12-MX_TIM5_Init-TIM5-false-HAL-true,13-MX_TIM9_Init-TIM9-false-HAL-true,14-MX_TIM12_Init-TIM12-false-HAL-true,15-MX_TIM7_Init-TIM7-false-HAL-true +ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_USART3_UART_Init-USART3-false-HAL-true,4-MX_ADC1_Init-ADC1-false-HAL-true,5-MX_TIM1_Init-TIM1-false-HAL-true,6-MX_TIM2_Init-TIM2-false-HAL-true,7-MX_TIM4_Init-TIM4-false-HAL-true,8-MX_TIM3_Init-TIM3-false-HAL-true,9-MX_SPI2_Init-SPI2-false-HAL-true,10-MX_ADC2_Init-ADC2-false-HAL-true,11-MX_TIM5_Init-TIM5-false-HAL-true,12-MX_TIM9_Init-TIM9-false-HAL-true,13-MX_TIM12_Init-TIM12-false-HAL-true,14-MX_TIM7_Init-TIM7-false-HAL-true RCC.48MHZClocksFreq_Value=84000000 RCC.AHBFreq_Value=168000000 RCC.APB1CLKDivider=RCC_HCLK_DIV4 @@ -357,7 +334,7 @@ TIM5.Period=84-1 TIM5.Prescaler=1000-1 TIM7.IPParameters=Prescaler,Period TIM7.Period=10000-1 -TIM7.Prescaler=8400-1 +TIM7.Prescaler=1000-1 TIM9.IPParameters=Prescaler,Period TIM9.Period=10000-1 TIM9.Prescaler=1680-1