diff --git a/.cproject b/.cproject
index 9a062ae..e971721 100644
--- a/.cproject
+++ b/.cproject
@@ -30,7 +30,7 @@
-
+
-
+
@@ -222,7 +222,7 @@
-
+
@@ -243,10 +243,10 @@
-
+
-
+
\ No newline at end of file
diff --git a/.mxproject b/.mxproject
index 2ea9b3c..06ab073 100644
--- a/.mxproject
+++ b/.mxproject
@@ -2,44 +2,46 @@
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_can.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_crc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_crc.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_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;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_can.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_crc.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_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;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_can.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_crc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_crc.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_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;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;
[PreviousUsedCubeIDEFiles]
-SourceFiles=Core\Src\main.c;Core\Src\gpio.c;Core\Src\freertos.c;Core\Src\adc.c;Core\Src\can.c;Core\Src\crc.c;Core\Src\i2c.c;Core\Src\rng.c;Core\Src\spi.c;Core\Src\tim.c;Core\Src\usart.c;Core\Src\stm32f4xx_it.c;Core\Src\stm32f4xx_hal_msp.c;Core\Src\stm32f4xx_hal_timebase_tim.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_can.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_crc.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_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;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_can.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_crc.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_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;Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c;Core\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;
+SourceFiles=Core\Src\main.c;Core\Src\gpio.c;Core\Src\freertos.c;Core\Src\adc.c;Core\Src\can.c;Core\Src\crc.c;Core\Src\dma.c;Core\Src\i2c.c;Core\Src\rng.c;Core\Src\spi.c;Core\Src\tim.c;Core\Src\usart.c;Core\Src\stm32f4xx_it.c;Core\Src\stm32f4xx_hal_msp.c;Core\Src\stm32f4xx_hal_timebase_tim.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_can.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_crc.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_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;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_can.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_crc.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_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;Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c;Core\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;
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;Drivers\CMSIS\Device\ST\STM32F4xx\Include;Drivers\CMSIS\Include;Core\Inc;
CDefines=USE_HAL_DRIVER;STM32F407xx;USE_HAL_DRIVER;USE_HAL_DRIVER;
[PreviousGenFiles]
AdvancedFolderStructure=true
-HeaderFileListSize=13
+HeaderFileListSize=14
HeaderFiles#0=..\Core\Inc\gpio.h
HeaderFiles#1=..\Core\Inc\FreeRTOSConfig.h
HeaderFiles#2=..\Core\Inc\adc.h
HeaderFiles#3=..\Core\Inc\can.h
HeaderFiles#4=..\Core\Inc\crc.h
-HeaderFiles#5=..\Core\Inc\i2c.h
-HeaderFiles#6=..\Core\Inc\rng.h
-HeaderFiles#7=..\Core\Inc\spi.h
-HeaderFiles#8=..\Core\Inc\tim.h
-HeaderFiles#9=..\Core\Inc\usart.h
-HeaderFiles#10=..\Core\Inc\stm32f4xx_it.h
-HeaderFiles#11=..\Core\Inc\stm32f4xx_hal_conf.h
-HeaderFiles#12=..\Core\Inc\main.h
+HeaderFiles#5=..\Core\Inc\dma.h
+HeaderFiles#6=..\Core\Inc\i2c.h
+HeaderFiles#7=..\Core\Inc\rng.h
+HeaderFiles#8=..\Core\Inc\spi.h
+HeaderFiles#9=..\Core\Inc\tim.h
+HeaderFiles#10=..\Core\Inc\usart.h
+HeaderFiles#11=..\Core\Inc\stm32f4xx_it.h
+HeaderFiles#12=..\Core\Inc\stm32f4xx_hal_conf.h
+HeaderFiles#13=..\Core\Inc\main.h
HeaderFolderListSize=1
HeaderPath#0=..\Core\Inc
HeaderFiles=;
-SourceFileListSize=14
+SourceFileListSize=15
SourceFiles#0=..\Core\Src\gpio.c
SourceFiles#1=..\Core\Src\freertos.c
SourceFiles#2=..\Core\Src\adc.c
SourceFiles#3=..\Core\Src\can.c
SourceFiles#4=..\Core\Src\crc.c
-SourceFiles#5=..\Core\Src\i2c.c
-SourceFiles#6=..\Core\Src\rng.c
-SourceFiles#7=..\Core\Src\spi.c
-SourceFiles#8=..\Core\Src\tim.c
-SourceFiles#9=..\Core\Src\usart.c
-SourceFiles#10=..\Core\Src\stm32f4xx_it.c
-SourceFiles#11=..\Core\Src\stm32f4xx_hal_msp.c
-SourceFiles#12=..\Core\Src\stm32f4xx_hal_timebase_tim.c
-SourceFiles#13=..\Core\Src\main.c
+SourceFiles#5=..\Core\Src\dma.c
+SourceFiles#6=..\Core\Src\i2c.c
+SourceFiles#7=..\Core\Src\rng.c
+SourceFiles#8=..\Core\Src\spi.c
+SourceFiles#9=..\Core\Src\tim.c
+SourceFiles#10=..\Core\Src\usart.c
+SourceFiles#11=..\Core\Src\stm32f4xx_it.c
+SourceFiles#12=..\Core\Src\stm32f4xx_hal_msp.c
+SourceFiles#13=..\Core\Src\stm32f4xx_hal_timebase_tim.c
+SourceFiles#14=..\Core\Src\main.c
SourceFolderListSize=1
SourcePath#0=..\Core\Src
SourceFiles=;
diff --git a/.project b/.project
index 93ac7c2..a7e0697 100644
--- a/.project
+++ b/.project
@@ -1,6 +1,6 @@
- a8000_temperature_ctl
+ a8000_cliptip_module
diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml
index 48cb063..c699a89 100644
--- a/.settings/language.settings.xml
+++ b/.settings/language.settings.xml
@@ -5,7 +5,7 @@
-
+
@@ -16,7 +16,7 @@
-
+
diff --git a/Core/Inc/stm32f4xx_it.h b/Core/Inc/stm32f4xx_it.h
index 21bc8b3..33e932d 100644
--- a/Core/Inc/stm32f4xx_it.h
+++ b/Core/Inc/stm32f4xx_it.h
@@ -52,11 +52,14 @@ void MemManage_Handler(void);
void BusFault_Handler(void);
void UsageFault_Handler(void);
void DebugMon_Handler(void);
+void DMA1_Stream5_IRQHandler(void);
+void DMA1_Stream6_IRQHandler(void);
void CAN1_TX_IRQHandler(void);
void CAN1_RX0_IRQHandler(void);
void CAN1_RX1_IRQHandler(void);
void CAN1_SCE_IRQHandler(void);
void TIM1_TRG_COM_TIM11_IRQHandler(void);
+void USART2_IRQHandler(void);
void USART3_IRQHandler(void);
void TIM6_DAC_IRQHandler(void);
void TIM7_IRQHandler(void);
diff --git a/Core/Inc/usart.h b/Core/Inc/usart.h
index 7b84d11..600bc69 100644
--- a/Core/Inc/usart.h
+++ b/Core/Inc/usart.h
@@ -34,6 +34,8 @@ extern "C" {
extern UART_HandleTypeDef huart1;
+extern UART_HandleTypeDef huart2;
+
extern UART_HandleTypeDef huart3;
/* USER CODE BEGIN Private defines */
@@ -41,6 +43,7 @@ extern UART_HandleTypeDef huart3;
/* USER CODE END Private defines */
void MX_USART1_UART_Init(void);
+void MX_USART2_UART_Init(void);
void MX_USART3_UART_Init(void);
/* USER CODE BEGIN Prototypes */
diff --git a/Core/Src/gpio.c b/Core/Src/gpio.c
index 087071b..eea319d 100644
--- a/Core/Src/gpio.c
+++ b/Core/Src/gpio.c
@@ -104,11 +104,11 @@ void MX_GPIO_Init(void)
/*Configure GPIO pins : PD8 PD9 PD10 PD11
PD12 PD13 PD14 PD15
PD0 PD1 PD2 PD3
- PD4 PD5 PD6 PD7 */
+ PD4 PD7 */
GPIO_InitStruct.Pin = GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_11
|GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15
|GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3
- |GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7;
+ |GPIO_PIN_4|GPIO_PIN_7;
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
diff --git a/Core/Src/main.c b/Core/Src/main.c
index cc9193a..af75621 100644
--- a/Core/Src/main.c
+++ b/Core/Src/main.c
@@ -22,6 +22,7 @@
#include "adc.h"
#include "can.h"
#include "crc.h"
+#include "dma.h"
#include "i2c.h"
#include "rng.h"
#include "spi.h"
@@ -98,6 +99,7 @@ int main(void)
/* Initialize all configured peripherals */
MX_GPIO_Init();
+ MX_DMA_Init();
MX_USART1_UART_Init();
MX_TIM3_Init();
MX_CRC_Init();
@@ -111,6 +113,7 @@ int main(void)
MX_I2C1_Init();
MX_ADC1_Init();
MX_TIM2_Init();
+ MX_USART2_UART_Init();
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
diff --git a/Core/Src/stm32f4xx_it.c b/Core/Src/stm32f4xx_it.c
index 9b07d37..434e434 100644
--- a/Core/Src/stm32f4xx_it.c
+++ b/Core/Src/stm32f4xx_it.c
@@ -59,6 +59,9 @@ extern CAN_HandleTypeDef hcan1;
extern TIM_HandleTypeDef htim1;
extern TIM_HandleTypeDef htim6;
extern TIM_HandleTypeDef htim7;
+extern DMA_HandleTypeDef hdma_usart2_rx;
+extern DMA_HandleTypeDef hdma_usart2_tx;
+extern UART_HandleTypeDef huart2;
extern UART_HandleTypeDef huart3;
extern TIM_HandleTypeDef htim11;
@@ -165,6 +168,34 @@ void DebugMon_Handler(void)
/******************************************************************************/
/**
+ * @brief This function handles DMA1 stream5 global interrupt.
+ */
+void DMA1_Stream5_IRQHandler(void)
+{
+ /* USER CODE BEGIN DMA1_Stream5_IRQn 0 */
+
+ /* USER CODE END DMA1_Stream5_IRQn 0 */
+ HAL_DMA_IRQHandler(&hdma_usart2_rx);
+ /* USER CODE BEGIN DMA1_Stream5_IRQn 1 */
+
+ /* USER CODE END DMA1_Stream5_IRQn 1 */
+}
+
+/**
+ * @brief This function handles DMA1 stream6 global interrupt.
+ */
+void DMA1_Stream6_IRQHandler(void)
+{
+ /* USER CODE BEGIN DMA1_Stream6_IRQn 0 */
+
+ /* USER CODE END DMA1_Stream6_IRQn 0 */
+ HAL_DMA_IRQHandler(&hdma_usart2_tx);
+ /* USER CODE BEGIN DMA1_Stream6_IRQn 1 */
+
+ /* USER CODE END DMA1_Stream6_IRQn 1 */
+}
+
+/**
* @brief This function handles CAN1 TX interrupts.
*/
void CAN1_TX_IRQHandler(void)
@@ -236,6 +267,20 @@ void TIM1_TRG_COM_TIM11_IRQHandler(void)
}
/**
+ * @brief This function handles USART2 global interrupt.
+ */
+void USART2_IRQHandler(void)
+{
+ /* USER CODE BEGIN USART2_IRQn 0 */
+
+ /* USER CODE END USART2_IRQn 0 */
+ HAL_UART_IRQHandler(&huart2);
+ /* USER CODE BEGIN USART2_IRQn 1 */
+
+ /* USER CODE END USART2_IRQn 1 */
+}
+
+/**
* @brief This function handles USART3 global interrupt.
*/
void USART3_IRQHandler(void)
diff --git a/Core/Src/usart.c b/Core/Src/usart.c
index bf00911..58c311d 100644
--- a/Core/Src/usart.c
+++ b/Core/Src/usart.c
@@ -25,7 +25,10 @@
/* USER CODE END 0 */
UART_HandleTypeDef huart1;
+UART_HandleTypeDef huart2;
UART_HandleTypeDef huart3;
+DMA_HandleTypeDef hdma_usart2_rx;
+DMA_HandleTypeDef hdma_usart2_tx;
/* USART1 init function */
@@ -56,6 +59,35 @@ void MX_USART1_UART_Init(void)
/* USER CODE END USART1_Init 2 */
}
+/* USART2 init function */
+
+void MX_USART2_UART_Init(void)
+{
+
+ /* USER CODE BEGIN USART2_Init 0 */
+
+ /* USER CODE END USART2_Init 0 */
+
+ /* USER CODE BEGIN USART2_Init 1 */
+
+ /* USER CODE END USART2_Init 1 */
+ huart2.Instance = USART2;
+ huart2.Init.BaudRate = 115200;
+ huart2.Init.WordLength = UART_WORDLENGTH_8B;
+ huart2.Init.StopBits = UART_STOPBITS_1;
+ huart2.Init.Parity = UART_PARITY_NONE;
+ huart2.Init.Mode = UART_MODE_TX_RX;
+ huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE;
+ huart2.Init.OverSampling = UART_OVERSAMPLING_16;
+ if (HAL_UART_Init(&huart2) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /* USER CODE BEGIN USART2_Init 2 */
+
+ /* USER CODE END USART2_Init 2 */
+
+}
/* USART3 init function */
void MX_USART3_UART_Init(void)
@@ -114,6 +146,70 @@ void HAL_UART_MspInit(UART_HandleTypeDef* uartHandle)
/* USER CODE END USART1_MspInit 1 */
}
+ else if(uartHandle->Instance==USART2)
+ {
+ /* USER CODE BEGIN USART2_MspInit 0 */
+
+ /* USER CODE END USART2_MspInit 0 */
+ /* USART2 clock enable */
+ __HAL_RCC_USART2_CLK_ENABLE();
+
+ __HAL_RCC_GPIOD_CLK_ENABLE();
+ /**USART2 GPIO Configuration
+ PD5 ------> USART2_TX
+ PD6 ------> USART2_RX
+ */
+ GPIO_InitStruct.Pin = GPIO_PIN_5|GPIO_PIN_6;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
+ GPIO_InitStruct.Alternate = GPIO_AF7_USART2;
+ HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
+
+ /* USART2 DMA Init */
+ /* USART2_RX Init */
+ hdma_usart2_rx.Instance = DMA1_Stream5;
+ hdma_usart2_rx.Init.Channel = DMA_CHANNEL_4;
+ hdma_usart2_rx.Init.Direction = DMA_PERIPH_TO_MEMORY;
+ hdma_usart2_rx.Init.PeriphInc = DMA_PINC_DISABLE;
+ hdma_usart2_rx.Init.MemInc = DMA_MINC_ENABLE;
+ hdma_usart2_rx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
+ hdma_usart2_rx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
+ hdma_usart2_rx.Init.Mode = DMA_NORMAL;
+ hdma_usart2_rx.Init.Priority = DMA_PRIORITY_LOW;
+ hdma_usart2_rx.Init.FIFOMode = DMA_FIFOMODE_DISABLE;
+ if (HAL_DMA_Init(&hdma_usart2_rx) != HAL_OK)
+ {
+ Error_Handler();
+ }
+
+ __HAL_LINKDMA(uartHandle,hdmarx,hdma_usart2_rx);
+
+ /* USART2_TX Init */
+ hdma_usart2_tx.Instance = DMA1_Stream6;
+ hdma_usart2_tx.Init.Channel = DMA_CHANNEL_4;
+ hdma_usart2_tx.Init.Direction = DMA_MEMORY_TO_PERIPH;
+ hdma_usart2_tx.Init.PeriphInc = DMA_PINC_DISABLE;
+ hdma_usart2_tx.Init.MemInc = DMA_MINC_ENABLE;
+ hdma_usart2_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
+ hdma_usart2_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
+ hdma_usart2_tx.Init.Mode = DMA_NORMAL;
+ hdma_usart2_tx.Init.Priority = DMA_PRIORITY_LOW;
+ hdma_usart2_tx.Init.FIFOMode = DMA_FIFOMODE_DISABLE;
+ if (HAL_DMA_Init(&hdma_usart2_tx) != HAL_OK)
+ {
+ Error_Handler();
+ }
+
+ __HAL_LINKDMA(uartHandle,hdmatx,hdma_usart2_tx);
+
+ /* USART2 interrupt Init */
+ HAL_NVIC_SetPriority(USART2_IRQn, 5, 0);
+ HAL_NVIC_EnableIRQ(USART2_IRQn);
+ /* USER CODE BEGIN USART2_MspInit 1 */
+
+ /* USER CODE END USART2_MspInit 1 */
+ }
else if(uartHandle->Instance==USART3)
{
/* USER CODE BEGIN USART3_MspInit 0 */
@@ -164,6 +260,30 @@ void HAL_UART_MspDeInit(UART_HandleTypeDef* uartHandle)
/* USER CODE END USART1_MspDeInit 1 */
}
+ else if(uartHandle->Instance==USART2)
+ {
+ /* USER CODE BEGIN USART2_MspDeInit 0 */
+
+ /* USER CODE END USART2_MspDeInit 0 */
+ /* Peripheral clock disable */
+ __HAL_RCC_USART2_CLK_DISABLE();
+
+ /**USART2 GPIO Configuration
+ PD5 ------> USART2_TX
+ PD6 ------> USART2_RX
+ */
+ HAL_GPIO_DeInit(GPIOD, GPIO_PIN_5|GPIO_PIN_6);
+
+ /* USART2 DMA DeInit */
+ HAL_DMA_DeInit(uartHandle->hdmarx);
+ HAL_DMA_DeInit(uartHandle->hdmatx);
+
+ /* USART2 interrupt Deinit */
+ HAL_NVIC_DisableIRQ(USART2_IRQn);
+ /* USER CODE BEGIN USART2_MspDeInit 1 */
+
+ /* USER CODE END USART2_MspDeInit 1 */
+ }
else if(uartHandle->Instance==USART3)
{
/* USER CODE BEGIN USART3_MspDeInit 0 */
diff --git a/README.md b/README.md
index f9b0e1c..fe07e76 100644
--- a/README.md
+++ b/README.md
@@ -13,7 +13,7 @@ ref:https://iflytop1.feishu.cn/wiki/PbUHwG2o6ikWagkmsiqcTFwAnjp
#define ID3 PC3
#define ID4 PC4
-// 调试串口
+// 调试串口zwsd@192.168.1.3:project_boditech_vidas_a8000_v2/a8000_cliptip_module.git
#define DEBUG_UART huart1
// 调试指示灯
#define DEBUG_LIGHT_GPIO PE2
diff --git a/a8000_temperature_ctl.cfg b/a8000_cliptip_module.cfg
similarity index 100%
rename from a8000_temperature_ctl.cfg
rename to a8000_cliptip_module.cfg
diff --git a/a8000_temperature_ctl.ioc b/a8000_cliptip_module.ioc
similarity index 78%
rename from a8000_temperature_ctl.ioc
rename to a8000_cliptip_module.ioc
index 9f47017..874efda 100644
--- a/a8000_temperature_ctl.ioc
+++ b/a8000_cliptip_module.ioc
@@ -21,6 +21,29 @@ CAN1.RFLM=ENABLE
CAN1.SJW=CAN_SJW_3TQ
CAN1.TTCM=ENABLE
CAN1.TXFP=DISABLE
+Dma.Request0=USART2_RX
+Dma.Request1=USART2_TX
+Dma.RequestsNb=2
+Dma.USART2_RX.0.Direction=DMA_PERIPH_TO_MEMORY
+Dma.USART2_RX.0.FIFOMode=DMA_FIFOMODE_DISABLE
+Dma.USART2_RX.0.Instance=DMA1_Stream5
+Dma.USART2_RX.0.MemDataAlignment=DMA_MDATAALIGN_BYTE
+Dma.USART2_RX.0.MemInc=DMA_MINC_ENABLE
+Dma.USART2_RX.0.Mode=DMA_NORMAL
+Dma.USART2_RX.0.PeriphDataAlignment=DMA_PDATAALIGN_BYTE
+Dma.USART2_RX.0.PeriphInc=DMA_PINC_DISABLE
+Dma.USART2_RX.0.Priority=DMA_PRIORITY_LOW
+Dma.USART2_RX.0.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority,FIFOMode
+Dma.USART2_TX.1.Direction=DMA_MEMORY_TO_PERIPH
+Dma.USART2_TX.1.FIFOMode=DMA_FIFOMODE_DISABLE
+Dma.USART2_TX.1.Instance=DMA1_Stream6
+Dma.USART2_TX.1.MemDataAlignment=DMA_MDATAALIGN_BYTE
+Dma.USART2_TX.1.MemInc=DMA_MINC_ENABLE
+Dma.USART2_TX.1.Mode=DMA_NORMAL
+Dma.USART2_TX.1.PeriphDataAlignment=DMA_PDATAALIGN_BYTE
+Dma.USART2_TX.1.PeriphInc=DMA_PINC_DISABLE
+Dma.USART2_TX.1.Priority=DMA_PRIORITY_LOW
+Dma.USART2_TX.1.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority,FIFOMode
FREERTOS.FootprintOK=true
FREERTOS.IPParameters=Tasks01,FootprintOK,configUSE_NEWLIB_REENTRANT,configUSE_RECURSIVE_MUTEXES,configUSE_COUNTING_SEMAPHORES,configRECORD_STACK_HIGH_ADDRESS,configENABLE_FPU
FREERTOS.Tasks01=defaultTask,-3,1024,StartDefaultTask,As weak,NULL,Dynamic,NULL,NULL
@@ -38,22 +61,24 @@ Mcu.CPN=STM32F407VET6
Mcu.Family=STM32F4
Mcu.IP0=ADC1
Mcu.IP1=CAN1
-Mcu.IP10=TIM1
-Mcu.IP11=TIM2
-Mcu.IP12=TIM3
-Mcu.IP13=TIM6
-Mcu.IP14=TIM7
-Mcu.IP15=USART1
-Mcu.IP16=USART3
+Mcu.IP10=SYS
+Mcu.IP11=TIM1
+Mcu.IP12=TIM2
+Mcu.IP13=TIM3
+Mcu.IP14=TIM6
+Mcu.IP15=TIM7
+Mcu.IP16=USART1
+Mcu.IP17=USART2
+Mcu.IP18=USART3
Mcu.IP2=CRC
-Mcu.IP3=FREERTOS
-Mcu.IP4=I2C1
-Mcu.IP5=NVIC
-Mcu.IP6=RCC
-Mcu.IP7=RNG
-Mcu.IP8=SPI1
-Mcu.IP9=SYS
-Mcu.IPNb=17
+Mcu.IP3=DMA
+Mcu.IP4=FREERTOS
+Mcu.IP5=I2C1
+Mcu.IP6=NVIC
+Mcu.IP7=RCC
+Mcu.IP8=RNG
+Mcu.IP9=SPI1
+Mcu.IPNb=19
Mcu.Name=STM32F407V(E-G)Tx
Mcu.Package=LQFP100
Mcu.Pin0=PH0-OSC_IN
@@ -72,24 +97,26 @@ Mcu.Pin2=PC0
Mcu.Pin20=PA12
Mcu.Pin21=PA13
Mcu.Pin22=PA14
-Mcu.Pin23=PB6
-Mcu.Pin24=PB7
-Mcu.Pin25=VP_CRC_VS_CRC
-Mcu.Pin26=VP_FREERTOS_VS_CMSIS_V1
-Mcu.Pin27=VP_RNG_VS_RNG
-Mcu.Pin28=VP_SYS_VS_tim11
-Mcu.Pin29=VP_TIM1_VS_ClockSourceINT
+Mcu.Pin23=PD5
+Mcu.Pin24=PD6
+Mcu.Pin25=PB6
+Mcu.Pin26=PB7
+Mcu.Pin27=VP_CRC_VS_CRC
+Mcu.Pin28=VP_FREERTOS_VS_CMSIS_V1
+Mcu.Pin29=VP_RNG_VS_RNG
Mcu.Pin3=PA1
-Mcu.Pin30=VP_TIM3_VS_ClockSourceINT
-Mcu.Pin31=VP_TIM6_VS_ClockSourceINT
-Mcu.Pin32=VP_TIM7_VS_ClockSourceINT
+Mcu.Pin30=VP_SYS_VS_tim11
+Mcu.Pin31=VP_TIM1_VS_ClockSourceINT
+Mcu.Pin32=VP_TIM3_VS_ClockSourceINT
+Mcu.Pin33=VP_TIM6_VS_ClockSourceINT
+Mcu.Pin34=VP_TIM7_VS_ClockSourceINT
Mcu.Pin4=PA2
Mcu.Pin5=PA3
Mcu.Pin6=PA5
Mcu.Pin7=PA6
Mcu.Pin8=PA7
Mcu.Pin9=PC4
-Mcu.PinsNb=33
+Mcu.PinsNb=35
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32F407VETx
@@ -100,6 +127,8 @@ NVIC.CAN1_RX0_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true
NVIC.CAN1_RX1_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true
NVIC.CAN1_SCE_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true
NVIC.CAN1_TX_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true
+NVIC.DMA1_Stream5_IRQn=true\:5\:0\:false\:false\:true\:true\:false\:true\:true
+NVIC.DMA1_Stream6_IRQn=true\:5\:0\:false\:false\:true\:true\:false\:true\:true
NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
NVIC.ForceEnableDMAVector=true
NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
@@ -117,6 +146,7 @@ NVIC.TIM6_DAC_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true
NVIC.TIM7_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true
NVIC.TimeBase=TIM1_TRG_COM_TIM11_IRQn
NVIC.TimeBaseIP=TIM11
+NVIC.USART2_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true
NVIC.USART3_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true
NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
PA1.Locked=true
@@ -165,6 +195,10 @@ PC4.Signal=GPXTI4
PC9.Locked=true
PC9.Mode=Clock-out-2
PC9.Signal=RCC_MCO_2
+PD5.Mode=Asynchronous
+PD5.Signal=USART2_TX
+PD6.Mode=Asynchronous
+PD6.Signal=USART2_RX
PE13.Signal=S_TIM1_CH3
PE9.Locked=true
PE9.Signal=S_TIM1_CH1
@@ -193,8 +227,8 @@ ProjectManager.MainLocation=Core/Src
ProjectManager.NoMain=false
ProjectManager.PreviousToolchain=STM32CubeIDE
ProjectManager.ProjectBuild=false
-ProjectManager.ProjectFileName=a8000_temperature_ctl.ioc
-ProjectManager.ProjectName=a8000_temperature_ctl
+ProjectManager.ProjectFileName=a8000_cliptip_module.ioc
+ProjectManager.ProjectName=a8000_cliptip_module
ProjectManager.ProjectStructure=
ProjectManager.RegisterCallBack=
ProjectManager.StackSize=0x1000
@@ -203,7 +237,7 @@ ProjectManager.ToolChainLocation=
ProjectManager.UAScriptAfterPath=
ProjectManager.UAScriptBeforePath=
ProjectManager.UnderRoot=true
-ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_USART1_UART_Init-USART1-false-HAL-true,4-MX_TIM3_Init-TIM3-false-HAL-true,5-MX_CRC_Init-CRC-false-HAL-true,6-MX_RNG_Init-RNG-false-HAL-true,7-MX_TIM7_Init-TIM7-false-HAL-true,8-MX_SPI1_Init-SPI1-false-HAL-true,9-MX_TIM6_Init-TIM6-false-HAL-true,10-MX_TIM1_Init-TIM1-false-HAL-true,11-MX_CAN1_Init-CAN1-false-HAL-true,12-MX_USART3_UART_Init-USART3-false-HAL-true,13-MX_I2C1_Init-I2C1-false-HAL-true,14-MX_ADC1_Init-ADC1-false-HAL-true,15-MX_TIM2_Init-TIM2-false-HAL-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_USART1_UART_Init-USART1-false-HAL-true,5-MX_TIM3_Init-TIM3-false-HAL-true,6-MX_CRC_Init-CRC-false-HAL-true,7-MX_RNG_Init-RNG-false-HAL-true,8-MX_TIM7_Init-TIM7-false-HAL-true,9-MX_SPI1_Init-SPI1-false-HAL-true,10-MX_TIM6_Init-TIM6-false-HAL-true,11-MX_TIM1_Init-TIM1-false-HAL-true,12-MX_CAN1_Init-CAN1-false-HAL-true,13-MX_USART3_UART_Init-USART3-false-HAL-true,14-MX_I2C1_Init-I2C1-false-HAL-true,15-MX_ADC1_Init-ADC1-false-HAL-true,16-MX_TIM2_Init-TIM2-false-HAL-true,17-MX_USART2_UART_Init-USART2-false-HAL-true
RCC.48MHZClocksFreq_Value=48000000
RCC.AHBFreq_Value=144000000
RCC.APB1CLKDivider=RCC_HCLK_DIV4
@@ -287,6 +321,8 @@ TIM7.Prescaler=81
USART1.BaudRate=1000000
USART1.IPParameters=VirtualMode,BaudRate
USART1.VirtualMode=VM_ASYNC
+USART2.IPParameters=VirtualMode
+USART2.VirtualMode=VM_ASYNC
USART3.BaudRate=9600
USART3.IPParameters=VirtualMode,BaudRate
USART3.VirtualMode=VM_ASYNC
diff --git a/a8000_temperature_ctl.launch b/a8000_cliptip_module.launch
similarity index 96%
rename from a8000_temperature_ctl.launch
rename to a8000_cliptip_module.launch
index 337918f..40be9f4 100644
--- a/a8000_temperature_ctl.launch
+++ b/a8000_cliptip_module.launch
@@ -12,7 +12,7 @@
-
+
@@ -37,7 +37,7 @@
-
+
@@ -47,7 +47,7 @@
-
+
@@ -82,13 +82,13 @@
-
-
+
+
-
+
diff --git a/sdk b/sdk
index c3bc465..af685a1 160000
--- a/sdk
+++ b/sdk
@@ -1 +1 @@
-Subproject commit c3bc4650b57bfa179a136532d3c40c7a2c682eee
+Subproject commit af685a17a8fd229ca4773a9c62949db89369c55f
diff --git a/usrc/main.cpp b/usrc/main.cpp
index cfadae8..33dca7b 100644
--- a/usrc/main.cpp
+++ b/usrc/main.cpp
@@ -9,12 +9,17 @@
//
#include "sdk\components\flash\znvs.hpp"
//
+#include "sdk/components/step_motor_ctrl_module/step_motor_ctrl_module.hpp"
+#include "sdk\components\pipette_module\pipette_ctrl_module_v2.hpp"
+#include "sdk\components\sensors\m3078\m3078_code_scaner.hpp"
#include "sdk\components\sensors\tmp117\tmp117.hpp"
#include "sdk\components\ti\drv8710.hpp"
+#include "sdk\components\tmc\ic\ztmc5130.hpp"
#include "sdk\components\water_cooling_temperature_control_module\pwm_ctrl_module.hpp"
#include "sdk\components\water_cooling_temperature_control_module\water_cooling_temperature_control_module.hpp"
#include "sdk\components\water_cooling_temperature_control_module\water_cooling_temperature_control_module_factory.cpp"
#include "sdk\components\water_cooling_temperature_control_module\water_cooling_temperature_control_module_factory.hpp"
+// #include "M3078CodeScanner"
#define TAG "main"
using namespace iflytop;
@@ -24,27 +29,78 @@ extern void umain();
extern "C" {
void StartDefaultTask(void const* argument) { umain(); }
}
-
+extern "C" {
+extern DMA_HandleTypeDef hdma_usart2_rx;
+extern DMA_HandleTypeDef hdma_usart2_tx;
+}
static ZCanCmder g_zcanCmder;
static ZIProtocolParser g_ziProtocolParser;
+//
+static TMC5130 g_motor;
+static StepMotorCtrlModule g_stepMotorCtrlModule;
+//
+static PipetteModule g_pipetteModule;
+// USART4_TX
-uint8_t getId() {
- static bool init = false;
- static ZGPIO ID0;
- static ZGPIO ID1;
- static ZGPIO ID2;
- static ZGPIO ID3;
- static ZGPIO ID4;
- if (!init) {
- ID0.initAsInput(ID0_IO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
- ID1.initAsInput(ID1_IO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
- ID2.initAsInput(ID2_IO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
- ID3.initAsInput(ID3_IO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
- ID4.initAsInput(ID4_IO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
- init = true;
+void init_and_reg_motor() {
+ osDelay(1000);
+ {
+ TMC5130::cfg_t cfg = {
+ .spi = &TMC_MOTOR_SPI, //
+ .csgpio = MOTOR0_CSN, //
+ .ennPin = MOTOR0_ENN, //
+ .spi_mode_select = MOTOR1_SPI_MODE_SELECT, //
+ };
+ g_motor.initialize(&cfg);
+ g_motor.setMotorShaft(false);
+ ZLOGI(TAG, "motora initialize 5160:%x ", g_motor.readICVersion());
}
- uint8_t id = ID0.getState() * 1 + ID1.getState() * 2 + ID2.getState() * 4 + ID3.getState() * 8 + ID4.getState() * 16;
- return id;
+
+ g_motor.setAcceleration(100);
+ g_motor.setDeceleration(100);
+ g_motor.setIHOLD_IRUN(0, 8, 10);
+
+ static ZGPIO input[10];
+ input[0].initAsInput(PD1 /*REFL*/, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
+ input[1].initAsInput(PD2 /*REFR*/, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
+ input[2].initAsInput(PD3 /*DIAG0*/, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
+ input[3].initAsInput(PD4 /*DIAG1*/, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
+
+ g_stepMotorCtrlModule.initialize(BOARD_ID * 10 + 1, &g_motor, input, ZARRAY_SIZE(input), MOTOR_CFG_FLASH_MARK);
+ g_ziProtocolParser.registerModule(&g_stepMotorCtrlModule);
+}
+
+void init_and_reg_cliptip_module() {
+ // # RS232输出压力流
+ // /1U2!0R\r
+ // # 设置移液枪最大行程100,防止设备误操作导致吸入液体到设备中
+ // /1u1,100R\r
+ PipetteModule::config_t cfg = {
+ .limit_ul = 100,
+ };
+
+ PipetteModule::hardward_config_t hardwarecfg = {
+ .uart = &huart2,
+ .hdma_rx = &hdma_usart2_rx,
+ .hdma_tx = &hdma_usart2_tx,
+ };
+ g_pipetteModule.initialize(BOARD_ID * 10 + 2, &cfg, &hardwarecfg);
+ g_ziProtocolParser.registerModule(&g_pipetteModule);
+}
+
+void init_and_reg_m3078() { //
+ static M3078CodeScanner codescanner;
+ static M3078CodeScanner::hardware_config_t cfg = {
+ .uart = &huart2,
+ .hdma_rx = nullptr,
+ .hdma_tx = nullptr,
+
+ .codeReadOkPin = PinNull,
+ .rstPin = PinNull,
+ .triggerPin = PD15,
+ };
+ codescanner.initialize(BOARD_ID * 10 + 3, &cfg);
+ g_ziProtocolParser.registerModule(&codescanner);
}
void umain() {
@@ -59,17 +115,8 @@ void umain() {
zos_cfg_t zoscfg;
zos_init(&zoscfg);
- uint8_t deviceId = getId();
- ZLOGI(TAG, "motorId:%d", deviceId);
-
- if (deviceId == 0) {
- ZLOGE(TAG, "motorId can't be 0");
- chip_set_error();
- while (true) {
- }
- }
+ ZLOGI(TAG, "boardId:%d", BOARD_ID);
-#if 0
/*******************************************************************************
* NVSINIT *
*******************************************************************************/
@@ -80,124 +127,13 @@ void umain() {
ZNVS::ins().alloc_config(MOTOR_CFG_FLASH_MARK, (uint8_t*)&cfg, sizeof(cfg));
}
ZNVS::ins().init_config();
-
-#endif
-
- /*******************************************************************************
- * 风扇配置 *
- *******************************************************************************/
- PWMSpeedCtrlModule::config_t fan0cfg = {
- .fanCtrlTim = &htim2,
- .nfan = 2,
- .fan0Channel = {3, 0, 0, 0},
- .fanFBGpioCfg =
- {
- {.pin = PC10},
- {.pin = PC11},
- },
- .fanPowerGpioCfg =
- {
- {.pin = PC4, .mode = ZGPIO::kMode_nopull, .mirror = false},
- },
- };
- PWMSpeedCtrlModule::config_t fan1cfg = {
- .fanCtrlTim = &htim2,
- .nfan = 2,
- .fan0Channel = {4, 0, 0, 0},
- .fanFBGpioCfg =
- {
- {.pin = PC12},
- {.pin = PC13},
- },
- .fanPowerGpioCfg =
- {
- {.pin = PC5, .mode = ZGPIO::kMode_nopull, .mirror = false},
- },
- };
-
- /*******************************************************************************
- * 水泵配置 *
- *******************************************************************************/
- PWMSpeedCtrlModule::config_t pumpcfg = {
- .fanCtrlTim = &htim2,
- .nfan = 1,
- .fan0Channel = {2, 0, 0, 0},
- .fanFBGpioCfg =
- {
- {.pin = PC3},
- },
- .fanPowerGpioCfg =
- {
- {.pin = PC2, .mode = ZGPIO::kMode_nopull, .mirror = false},
- },
- };
-
- DRV8710::config_t peltier_config0 = {
- .tim = &htim1,
- .in1_chnannel_index = 1,
- .in2 = PE10,
- .nsleep = PB2,
- .nfault = PB3,
- .shaft = false,
- };
-
- DRV8710::config_t peltier_config1 = {
- .tim = &htim1,
- .in1_chnannel_index = 3,
- .in2 = PE14,
- .nsleep = PB13,
- .nfault = PB14,
- .shaft = false,
-
- };
-
- static TMP117 temp[4];
- static PWMSpeedCtrlModule fan0;
- static PWMSpeedCtrlModule fan1;
- static PWMSpeedCtrlModule pump;
- static DRV8710 peltier0;
- static DRV8710 peltier1;
-
- static WaterCoolingTemperatureControlModule waterCoolingTemperatureControlModule;
-
- fan0.initialize(&fan0cfg, true);
- fan1.initialize(&fan1cfg, true);
- pump.initialize(&pumpcfg, false);
- peltier0.initialize(&peltier_config0);
- peltier1.initialize(&peltier_config1);
-
- temp[0].initializate(&hi2c1, TMP117::ID0);
- temp[1].initializate(&hi2c1, TMP117::ID1);
- temp[2].initializate(&hi2c1, TMP117::ID2);
- temp[3].initializate(&hi2c1, TMP117::ID3);
-
- WaterCoolingTemperatureControlModule::config_t temp_ctrl_config;
- waterCoolingTemperatureControlModule.createDefaultConfig(&temp_ctrl_config);
-
- WaterCoolingTemperatureControlModule::hardwared_config_t hardwared_config = //
- {
- .temperature_sensor = {&temp[0], &temp[1], &temp[2], &temp[3]},
- .fanTable = {&fan0, &fan1},
- .pump = &pump,
- .peltier_ctrl = {&peltier0, &peltier1},
- .ext_input =
- {
- {PC6, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true},
- {PC7, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true},
- },
- .ext_output =
- {
- {PD0, ZGPIO::kMode_nopull, false, false},
- } //
- };
-
- waterCoolingTemperatureControlModule.initialize(deviceId, &temp_ctrl_config, &hardwared_config);
-
- auto zcanCmder_cfg = g_zcanCmder.createCFG(deviceId);
+ auto zcanCmder_cfg = g_zcanCmder.createCFG(BOARD_ID);
g_zcanCmder.init(zcanCmder_cfg);
-
g_ziProtocolParser.initialize(&g_zcanCmder);
- g_ziProtocolParser.registerModule(&waterCoolingTemperatureControlModule);
+
+ init_and_reg_motor();
+ init_and_reg_cliptip_module();
+ init_and_reg_m3078();
while (true) {
OSDefaultSchduler::getInstance()->loop();
diff --git a/usrc/project_configs.h b/usrc/project_configs.h
index 8313014..ade27e7 100644
--- a/usrc/project_configs.h
+++ b/usrc/project_configs.h
@@ -2,7 +2,7 @@
#define VERSION "v1.0.0"
#define MANUFACTURER "http://www.iflytop.com/"
-#define PROJECT_NAME "a8000_temperature_ctrl"
+#define PROJECT_NAME "a8000_cliptip_module"
#define DEBUG_UART huart1
#define DEBUG_LIGHT_GPIO PE2
@@ -22,11 +22,13 @@
#define TMC_MOTOR_SPI hspi1
#define TMC5130_MOTOR_NUM 1
#define MOTOR0_CSN PA4
-#define MOTOR0_ENN PB7
-#define MOTOR1_SPI_MODE_SELECT PB4
+#define MOTOR0_ENN PD0
+#define MOTOR1_SPI_MODE_SELECT PinNull
#define MOTOR_CFG_FLASH_MARK "MOTOR_CFG_FLASH_MARK"
+#define BOARD_ID 2
+
#if 0
#define STEPPER_MOTOR_ZERO_SENSOR SENSOR_INT0
#define STEPPER_MOTOR_FORWARD_SENSOR SENSOR_INT8
@@ -39,13 +41,3 @@
#define ID3_IO PD14
#define ID4_IO PD15
-#define SENSOR_INT0 PD0
-#define SENSOR_INT1 PD1
-#define SENSOR_INT2 PD2
-#define SENSOR_INT3 PD3
-#define SENSOR_INT4 PD4
-#define SENSOR_INT5 PD5
-#define SENSOR_INT6 PD6
-#define SENSOR_INT7 PD7
-#define SENSOR_INT8 PD8
-#define SENSOR_INT9 PD9