diff --git a/.idea/editor.xml b/.idea/editor.xml
index 5fff85e..b0d69ef 100644
--- a/.idea/editor.xml
+++ b/.idea/editor.xml
@@ -240,5 +240,244 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 71f67dd..c66a02a 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,6 +7,7 @@
+
{
"useNewFormat": true
@@ -28,10 +29,56 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -126,7 +173,7 @@
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm",
- "settings.editor.selected.configurable": "preferences.pluginManager",
+ "settings.editor.selected.configurable": "editor.preferences.fonts.default",
"vue.rearranger.settings.migration": "true"
}
}
@@ -136,6 +183,11 @@
+
+
+
+
+
@@ -169,7 +221,9 @@
-
+
+
+
@@ -195,7 +249,15 @@
1742416201898
-
+
+
+ 1742503072799
+
+
+
+ 1742503072799
+
+
@@ -210,6 +272,11 @@
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.mxproject b/.mxproject
index 9b7ae1f..7386641 100644
--- a/.mxproject
+++ b/.mxproject
@@ -1,33 +1,33 @@
[PreviousLibFiles]
-LibFiles=Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_i2c.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_i2c.h;Drivers\STM32F1xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_def.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_bus.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_rcc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_system.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_utils.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio_ex.h;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio_ex.c;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_gpio.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_dma.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_cortex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_cortex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_pwr.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_pwr.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_exti.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_exti.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_spi.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_spi.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_uart.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_usart.h;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_i2c.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc_ex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_dma.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_cortex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_pwr.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash_ex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_exti.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_spi.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_uart.c;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_i2c.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_i2c.h;Drivers\STM32F1xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_def.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_bus.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_rcc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_system.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_utils.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio_ex.h;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio_ex.c;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_gpio.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_dma.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_cortex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_cortex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_pwr.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_pwr.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_exti.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_exti.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_spi.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_spi.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_uart.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_usart.h;Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f103x6.h;Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f1xx.h;Drivers\CMSIS\Device\ST\STM32F1xx\Include\system_stm32f1xx.h;Drivers\CMSIS\Device\ST\STM32F1xx\Include\system_stm32f1xx.h;Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\system_stm32f1xx.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/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_i2c.h;Drivers/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_bus.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_rcc.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_system.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_utils.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_gpio.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_dma.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_cortex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_cortex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_pwr.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_exti.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_exti.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_spi.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_spi.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_usart.h;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_spi.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.c;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_i2c.h;Drivers/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_bus.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_rcc.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_system.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_utils.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_gpio.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_dma.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_cortex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_cortex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_pwr.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_exti.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_exti.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_spi.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_spi.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_usart.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103x6.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h;Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/system_stm32f1xx.c;Drivers/CMSIS/Include/core_cm7.h;Drivers/CMSIS/Include/tz_context.h;Drivers/CMSIS/Include/core_cm3.h;Drivers/CMSIS/Include/cmsis_compiler.h;Drivers/CMSIS/Include/cmsis_armclang.h;Drivers/CMSIS/Include/mpu_armv7.h;Drivers/CMSIS/Include/cmsis_armcc.h;Drivers/CMSIS/Include/core_cm4.h;Drivers/CMSIS/Include/core_cm0.h;Drivers/CMSIS/Include/cmsis_iccarm.h;Drivers/CMSIS/Include/core_armv8mml.h;Drivers/CMSIS/Include/core_sc000.h;Drivers/CMSIS/Include/core_cm1.h;Drivers/CMSIS/Include/mpu_armv8.h;Drivers/CMSIS/Include/core_sc300.h;Drivers/CMSIS/Include/cmsis_gcc.h;Drivers/CMSIS/Include/cmsis_version.h;Drivers/CMSIS/Include/core_cm23.h;Drivers/CMSIS/Include/core_cm33.h;Drivers/CMSIS/Include/core_cm0plus.h;Drivers/CMSIS/Include/core_armv8mbl.h;
[PreviousUsedCubeIDEFiles]
-SourceFiles=Core\Src\main.c;Core\Src\gpio.c;Core\Src\i2c.c;Core\Src\spi.c;Core\Src\usart.c;Core\Src\stm32f1xx_it.c;Core\Src\stm32f1xx_hal_msp.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio_ex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_i2c.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc_ex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_dma.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_cortex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_pwr.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash_ex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_exti.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_spi.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_uart.c;Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\system_stm32f1xx.c;Core\Src\system_stm32f1xx.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio_ex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_i2c.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc_ex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_dma.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_cortex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_pwr.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash_ex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_exti.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_spi.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_uart.c;Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\system_stm32f1xx.c;Core\Src\system_stm32f1xx.c;;;
-HeaderPath=Drivers\STM32F1xx_HAL_Driver\Inc;Drivers\STM32F1xx_HAL_Driver\Inc\Legacy;Drivers\CMSIS\Device\ST\STM32F1xx\Include;Drivers\CMSIS\Include;Core\Inc;
+SourceFiles=Core/Src/main.c;Core/Src/gpio.c;Core/Src/i2c.c;Core/Src/spi.c;Core/Src/usart.c;Core/Src/stm32f1xx_it.c;Core/Src/stm32f1xx_hal_msp.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_spi.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.c;Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/system_stm32f1xx.c;Core/Src/system_stm32f1xx.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_spi.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.c;Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/system_stm32f1xx.c;Core/Src/system_stm32f1xx.c;;;
+HeaderPath=Drivers/STM32F1xx_HAL_Driver/Inc;Drivers/STM32F1xx_HAL_Driver/Inc/Legacy;Drivers/CMSIS/Device/ST/STM32F1xx/Include;Drivers/CMSIS/Include;Core/Inc;
CDefines=USE_HAL_DRIVER;STM32F103x6;USE_HAL_DRIVER;USE_HAL_DRIVER;
[PreviousGenFiles]
AdvancedFolderStructure=true
HeaderFileListSize=7
-HeaderFiles#0=..\Core\Inc\gpio.h
-HeaderFiles#1=..\Core\Inc\i2c.h
-HeaderFiles#2=..\Core\Inc\spi.h
-HeaderFiles#3=..\Core\Inc\usart.h
-HeaderFiles#4=..\Core\Inc\stm32f1xx_it.h
-HeaderFiles#5=..\Core\Inc\stm32f1xx_hal_conf.h
-HeaderFiles#6=..\Core\Inc\main.h
+HeaderFiles#0=../Core/Inc/gpio.h
+HeaderFiles#1=../Core/Inc/i2c.h
+HeaderFiles#2=../Core/Inc/spi.h
+HeaderFiles#3=../Core/Inc/usart.h
+HeaderFiles#4=../Core/Inc/stm32f1xx_it.h
+HeaderFiles#5=../Core/Inc/stm32f1xx_hal_conf.h
+HeaderFiles#6=../Core/Inc/main.h
HeaderFolderListSize=1
-HeaderPath#0=..\Core\Inc
+HeaderPath#0=../Core/Inc
HeaderFiles=;
SourceFileListSize=7
-SourceFiles#0=..\Core\Src\gpio.c
-SourceFiles#1=..\Core\Src\i2c.c
-SourceFiles#2=..\Core\Src\spi.c
-SourceFiles#3=..\Core\Src\usart.c
-SourceFiles#4=..\Core\Src\stm32f1xx_it.c
-SourceFiles#5=..\Core\Src\stm32f1xx_hal_msp.c
-SourceFiles#6=..\Core\Src\main.c
+SourceFiles#0=../Core/Src/gpio.c
+SourceFiles#1=../Core/Src/i2c.c
+SourceFiles#2=../Core/Src/spi.c
+SourceFiles#3=../Core/Src/usart.c
+SourceFiles#4=../Core/Src/stm32f1xx_it.c
+SourceFiles#5=../Core/Src/stm32f1xx_hal_msp.c
+SourceFiles#6=../Core/Src/main.c
SourceFolderListSize=1
-SourcePath#0=..\Core\Src
+SourcePath#0=../Core/Src
SourceFiles=;
diff --git a/Core/Inc/main.h b/Core/Inc/main.h
index 0ad1fd2..57d6cb9 100644
--- a/Core/Inc/main.h
+++ b/Core/Inc/main.h
@@ -59,8 +59,6 @@ void Error_Handler(void);
/* Private defines -----------------------------------------------------------*/
#define LED0_Pin GPIO_PIN_13
#define LED0_GPIO_Port GPIOC
-#define RC522_CS_Pin GPIO_PIN_3
-#define RC522_CS_GPIO_Port GPIOA
#define RC522_RST_Pin GPIO_PIN_4
#define RC522_RST_GPIO_Port GPIOA
#define RC522_SCK_Pin GPIO_PIN_5
@@ -69,11 +67,26 @@ void Error_Handler(void);
#define RC522_MISO_GPIO_Port GPIOA
#define RC522_MOSI_Pin GPIO_PIN_7
#define RC522_MOSI_GPIO_Port GPIOA
-#define LED_BTN1_Pin GPIO_PIN_8
-#define LED_BTN1_GPIO_Port GPIOB
-#define BTN1_Pin GPIO_PIN_9
-#define BTN1_GPIO_Port GPIOB
-#define BTN1_EXTI_IRQn EXTI9_5_IRQn
+#define RC522_CS_Pin GPIO_PIN_0
+#define RC522_CS_GPIO_Port GPIOB
+#define KEY4_Pin GPIO_PIN_13
+#define KEY4_GPIO_Port GPIOB
+#define KEY4_EXTI_IRQn EXTI15_10_IRQn
+#define KEY3_Pin GPIO_PIN_14
+#define KEY3_GPIO_Port GPIOB
+#define KEY3_EXTI_IRQn EXTI15_10_IRQn
+#define KEY2_Pin GPIO_PIN_15
+#define KEY2_GPIO_Port GPIOB
+#define KEY2_EXTI_IRQn EXTI15_10_IRQn
+#define KEY1_Pin GPIO_PIN_8
+#define KEY1_GPIO_Port GPIOA
+#define KEY1_EXTI_IRQn EXTI9_5_IRQn
+#define RELAY1_Pin GPIO_PIN_7
+#define RELAY1_GPIO_Port GPIOB
+#define OLED_SCL_Pin GPIO_PIN_8
+#define OLED_SCL_GPIO_Port GPIOB
+#define OLED_SDA_Pin GPIO_PIN_9
+#define OLED_SDA_GPIO_Port GPIOB
/* USER CODE BEGIN Private defines */
diff --git a/Core/Inc/stm32f1xx_it.h b/Core/Inc/stm32f1xx_it.h
index b81b60b..6762be3 100644
--- a/Core/Inc/stm32f1xx_it.h
+++ b/Core/Inc/stm32f1xx_it.h
@@ -56,6 +56,7 @@ void DebugMon_Handler(void);
void PendSV_Handler(void);
void SysTick_Handler(void);
void EXTI9_5_IRQHandler(void);
+void EXTI15_10_IRQHandler(void);
/* USER CODE BEGIN EFP */
/* USER CODE END EFP */
diff --git a/Core/Inc/usart.h b/Core/Inc/usart.h
index 10c6193..737091e 100644
--- a/Core/Inc/usart.h
+++ b/Core/Inc/usart.h
@@ -34,11 +34,14 @@ extern "C" {
extern UART_HandleTypeDef huart1;
+extern UART_HandleTypeDef huart2;
+
/* USER CODE BEGIN Private defines */
/* USER CODE END Private defines */
void MX_USART1_UART_Init(void);
+void MX_USART2_UART_Init(void);
/* USER CODE BEGIN Prototypes */
diff --git a/Core/Src/gpio.c b/Core/Src/gpio.c
index 2e389b2..8b3a1b9 100644
--- a/Core/Src/gpio.c
+++ b/Core/Src/gpio.c
@@ -51,13 +51,13 @@ void MX_GPIO_Init(void)
__HAL_RCC_GPIOB_CLK_ENABLE();
/*Configure GPIO pin Output Level */
- HAL_GPIO_WritePin(LED0_GPIO_Port, LED0_Pin, GPIO_PIN_SET);
+ HAL_GPIO_WritePin(LED0_GPIO_Port, LED0_Pin, GPIO_PIN_RESET);
/*Configure GPIO pin Output Level */
- HAL_GPIO_WritePin(GPIOA, RC522_CS_Pin|RC522_RST_Pin, GPIO_PIN_RESET);
+ HAL_GPIO_WritePin(RC522_RST_GPIO_Port, RC522_RST_Pin, GPIO_PIN_RESET);
/*Configure GPIO pin Output Level */
- HAL_GPIO_WritePin(LED_BTN1_GPIO_Port, LED_BTN1_Pin, GPIO_PIN_RESET);
+ HAL_GPIO_WritePin(GPIOB, RC522_CS_Pin|RELAY1_Pin, GPIO_PIN_RESET);
/*Configure GPIO pin : LED0_Pin */
GPIO_InitStruct.Pin = LED0_Pin;
@@ -66,30 +66,39 @@ void MX_GPIO_Init(void)
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(LED0_GPIO_Port, &GPIO_InitStruct);
- /*Configure GPIO pins : RC522_CS_Pin RC522_RST_Pin */
- GPIO_InitStruct.Pin = RC522_CS_Pin|RC522_RST_Pin;
+ /*Configure GPIO pin : RC522_RST_Pin */
+ GPIO_InitStruct.Pin = RC522_RST_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+ HAL_GPIO_Init(RC522_RST_GPIO_Port, &GPIO_InitStruct);
- /*Configure GPIO pin : LED_BTN1_Pin */
- GPIO_InitStruct.Pin = LED_BTN1_Pin;
+ /*Configure GPIO pins : RC522_CS_Pin RELAY1_Pin */
+ GPIO_InitStruct.Pin = RC522_CS_Pin|RELAY1_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
- HAL_GPIO_Init(LED_BTN1_GPIO_Port, &GPIO_InitStruct);
+ HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
- /*Configure GPIO pin : BTN1_Pin */
- GPIO_InitStruct.Pin = BTN1_Pin;
+ /*Configure GPIO pins : KEY4_Pin KEY3_Pin KEY2_Pin */
+ GPIO_InitStruct.Pin = KEY4_Pin|KEY3_Pin|KEY2_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING;
GPIO_InitStruct.Pull = GPIO_PULLUP;
- HAL_GPIO_Init(BTN1_GPIO_Port, &GPIO_InitStruct);
+ HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
+
+ /*Configure GPIO pin : KEY1_Pin */
+ GPIO_InitStruct.Pin = KEY1_Pin;
+ GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING;
+ GPIO_InitStruct.Pull = GPIO_PULLUP;
+ HAL_GPIO_Init(KEY1_GPIO_Port, &GPIO_InitStruct);
/* EXTI interrupt init*/
- HAL_NVIC_SetPriority(EXTI9_5_IRQn, 1, 0);
+ HAL_NVIC_SetPriority(EXTI9_5_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(EXTI9_5_IRQn);
+ HAL_NVIC_SetPriority(EXTI15_10_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(EXTI15_10_IRQn);
+
}
/* USER CODE BEGIN 2 */
diff --git a/Core/Src/i2c.c b/Core/Src/i2c.c
index 3f45582..f2cf27b 100644
--- a/Core/Src/i2c.c
+++ b/Core/Src/i2c.c
@@ -68,15 +68,17 @@ void HAL_I2C_MspInit(I2C_HandleTypeDef* i2cHandle)
__HAL_RCC_GPIOB_CLK_ENABLE();
/**I2C1 GPIO Configuration
- PB6 ------> I2C1_SCL
- PB7 ------> I2C1_SDA
+ PB8 ------> I2C1_SCL
+ PB9 ------> I2C1_SDA
*/
- GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7;
+ GPIO_InitStruct.Pin = OLED_SCL_Pin|OLED_SDA_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
+ __HAL_AFIO_REMAP_I2C1_ENABLE();
+
/* I2C1 clock enable */
__HAL_RCC_I2C1_CLK_ENABLE();
/* USER CODE BEGIN I2C1_MspInit 1 */
@@ -97,12 +99,12 @@ void HAL_I2C_MspDeInit(I2C_HandleTypeDef* i2cHandle)
__HAL_RCC_I2C1_CLK_DISABLE();
/**I2C1 GPIO Configuration
- PB6 ------> I2C1_SCL
- PB7 ------> I2C1_SDA
+ PB8 ------> I2C1_SCL
+ PB9 ------> I2C1_SDA
*/
- HAL_GPIO_DeInit(GPIOB, GPIO_PIN_6);
+ HAL_GPIO_DeInit(OLED_SCL_GPIO_Port, OLED_SCL_Pin);
- HAL_GPIO_DeInit(GPIOB, GPIO_PIN_7);
+ HAL_GPIO_DeInit(OLED_SDA_GPIO_Port, OLED_SDA_Pin);
/* USER CODE BEGIN I2C1_MspDeInit 1 */
diff --git a/Core/Src/main.c b/Core/Src/main.c
index fba0af5..e1f94c8 100644
--- a/Core/Src/main.c
+++ b/Core/Src/main.c
@@ -105,6 +105,7 @@ int main(void)
MX_I2C1_Init();
MX_USART1_UART_Init();
MX_SPI1_Init();
+ MX_USART2_UART_Init();
/* USER CODE BEGIN 2 */
// Retarget uart
RetargetInit(&huart1);
@@ -118,7 +119,6 @@ int main(void)
OLED_Clear();
OLED_ShowString(0,0,"scanning...",12);
- printf("[icpile] dev\r\n");
/* USER CODE END 2 */
/* Infinite loop */
@@ -129,7 +129,7 @@ int main(void)
if (!rf_status) {
rf_status = PCD_ERR;
- HAL_GPIO_WritePin(LED_BTN1_GPIO_Port, LED_BTN1_Pin, GPIO_PIN_SET);
+ HAL_GPIO_WritePin(LED0_GPIO_Port, LED0_Pin, GPIO_PIN_SET);
rf_status = PCD_AntiColl(rf_card_id);
}
@@ -194,7 +194,7 @@ int main(void)
{
printf("Read card failed\r\n");
}
- HAL_GPIO_WritePin(LED_BTN1_GPIO_Port, LED_BTN1_Pin, GPIO_PIN_RESET);
+ HAL_GPIO_WritePin(LED0_GPIO_Port, LED0_Pin, GPIO_PIN_RESET);
HAL_Delay(3000);
}
/* USER CODE END WHILE */
@@ -246,7 +246,7 @@ void SystemClock_Config(void)
/* USER CODE BEGIN 4 */
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
- if(GPIO_Pin == BTN1_Pin)
+ if(GPIO_Pin == KEY1_Pin)
{
OLED_Clear();
}
diff --git a/Core/Src/retarget.c b/Core/Src/retarget.c
index 4a031d3..bdca88a 100644
--- a/Core/Src/retarget.c
+++ b/Core/Src/retarget.c
@@ -12,38 +12,38 @@
#define STDOUT_FILENO 1
#define STDERR_FILENO 2
-UART_HandleTypeDef *gHuart;
+UART_HandleTypeDef* gHuart;
-void RetargetInit(UART_HandleTypeDef *huart)
+void RetargetInit(UART_HandleTypeDef* huart)
{
gHuart = huart;
-
- /* Disable I/O buffering for STDOUT stream, so that
- * chars are sent out as soon as they are printed. */
- setvbuf(stdout, NULL, _IONBF, 0);
+
+ /* Disable I/O buffering for STDOUT stream, so that
+ * chars are sent out as soon as they are printed. */
+ setvbuf(stdout, NULL, _IONBF, 0);
}
int _isatty(int fd)
{
if (fd >= STDIN_FILENO && fd <= STDERR_FILENO)
return 1;
-
- errno = EBADF;
+
+ errno = EBADF;
return 0;
}
-int _write(int fd, char *ptr, int len)
+int _write(int fd, char* ptr, int len)
{
HAL_StatusTypeDef hstatus;
-
- if (fd == STDOUT_FILENO || fd == STDERR_FILENO)
- {
- hstatus = HAL_UART_Transmit(gHuart, (uint8_t *) ptr, len, HAL_MAX_DELAY);
- if (hstatus == HAL_OK)
- return len;
- else
- return EIO;
- }
+
+ if (fd == STDOUT_FILENO || fd == STDERR_FILENO)
+ {
+ hstatus = HAL_UART_Transmit(gHuart, (uint8_t*)ptr, len, HAL_MAX_DELAY);
+ if (hstatus == HAL_OK)
+ return len;
+ else
+ return EIO;
+ }
errno = EBADF;
return -1;
}
@@ -52,47 +52,47 @@ int _close(int fd)
{
if (fd >= STDIN_FILENO && fd <= STDERR_FILENO)
return 0;
-
- errno = EBADF;
+
+ errno = EBADF;
return -1;
}
int _lseek(int fd, int ptr, int dir)
{
- (void) fd;
- (void) ptr;
- (void) dir;
-
- errno = EBADF;
- return -1;
-}
+ (void)fd;
+ (void)ptr;
+ (void)dir;
-int _read(int fd, char *ptr, int len)
-{
- HAL_StatusTypeDef hstatus;
-
- if (fd == STDIN_FILENO)
- {
- hstatus = HAL_UART_Receive(gHuart, (uint8_t *) ptr, 1, HAL_MAX_DELAY);
- if (hstatus == HAL_OK)
- return 1;
- else
- return EIO;
- }
errno = EBADF;
return -1;
}
-int _fstat(int fd, struct stat *st)
+int _read(int fd, char* ptr, int len)
+{
+ HAL_StatusTypeDef hstatus;
+
+ if (fd == STDIN_FILENO)
+ {
+ hstatus = HAL_UART_Receive(gHuart, (uint8_t*)ptr, 1, HAL_MAX_DELAY);
+ if (hstatus == HAL_OK)
+ return 1;
+ else
+ return EIO;
+ }
+ errno = EBADF;
+ return -1;
+}
+
+int _fstat(int fd, struct stat* st)
{
if (fd >= STDIN_FILENO && fd <= STDERR_FILENO)
{
st->st_mode = S_IFCHR;
return 0;
}
-
- errno = EBADF;
+
+ errno = EBADF;
return 0;
}
-#endif //#if !defined(OS_USE_SEMIHOSTING)
\ No newline at end of file
+#endif //#if !defined(OS_USE_SEMIHOSTING)
diff --git a/Core/Src/stm32f1xx_it.c b/Core/Src/stm32f1xx_it.c
index f81d3d3..23e65f1 100644
--- a/Core/Src/stm32f1xx_it.c
+++ b/Core/Src/stm32f1xx_it.c
@@ -206,12 +206,28 @@ void EXTI9_5_IRQHandler(void)
/* USER CODE BEGIN EXTI9_5_IRQn 0 */
/* USER CODE END EXTI9_5_IRQn 0 */
- HAL_GPIO_EXTI_IRQHandler(BTN1_Pin);
+ HAL_GPIO_EXTI_IRQHandler(KEY1_Pin);
/* USER CODE BEGIN EXTI9_5_IRQn 1 */
/* USER CODE END EXTI9_5_IRQn 1 */
}
+/**
+ * @brief This function handles EXTI line[15:10] interrupts.
+ */
+void EXTI15_10_IRQHandler(void)
+{
+ /* USER CODE BEGIN EXTI15_10_IRQn 0 */
+
+ /* USER CODE END EXTI15_10_IRQn 0 */
+ HAL_GPIO_EXTI_IRQHandler(KEY4_Pin);
+ HAL_GPIO_EXTI_IRQHandler(KEY3_Pin);
+ HAL_GPIO_EXTI_IRQHandler(KEY2_Pin);
+ /* USER CODE BEGIN EXTI15_10_IRQn 1 */
+
+ /* USER CODE END EXTI15_10_IRQn 1 */
+}
+
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
diff --git a/Core/Src/usart.c b/Core/Src/usart.c
index e96da31..35f9d63 100644
--- a/Core/Src/usart.c
+++ b/Core/Src/usart.c
@@ -25,6 +25,7 @@
/* USER CODE END 0 */
UART_HandleTypeDef huart1;
+UART_HandleTypeDef huart2;
/* USART1 init function */
@@ -54,6 +55,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 */
+
}
void HAL_UART_MspInit(UART_HandleTypeDef* uartHandle)
@@ -87,6 +117,33 @@ 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_GPIOA_CLK_ENABLE();
+ /**USART2 GPIO Configuration
+ PA2 ------> USART2_TX
+ PA3 ------> USART2_RX
+ */
+ GPIO_InitStruct.Pin = GPIO_PIN_2;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+
+ GPIO_InitStruct.Pin = GPIO_PIN_3;
+ GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+
+ /* USER CODE BEGIN USART2_MspInit 1 */
+
+ /* USER CODE END USART2_MspInit 1 */
+ }
}
void HAL_UART_MspDeInit(UART_HandleTypeDef* uartHandle)
@@ -110,6 +167,24 @@ 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
+ PA2 ------> USART2_TX
+ PA3 ------> USART2_RX
+ */
+ HAL_GPIO_DeInit(GPIOA, GPIO_PIN_2|GPIO_PIN_3);
+
+ /* USER CODE BEGIN USART2_MspDeInit 1 */
+
+ /* USER CODE END USART2_MspDeInit 1 */
+ }
}
/* USER CODE BEGIN 1 */
diff --git a/IntelliChargingPile.ioc b/IntelliChargingPile.ioc
index ee992c4..80cf38f 100644
--- a/IntelliChargingPile.ioc
+++ b/IntelliChargingPile.ioc
@@ -13,27 +13,33 @@ Mcu.IP2=RCC
Mcu.IP3=SPI1
Mcu.IP4=SYS
Mcu.IP5=USART1
-Mcu.IPNb=6
+Mcu.IP6=USART2
+Mcu.IPNb=7
Mcu.Name=STM32F103C(4-6)Tx
Mcu.Package=LQFP48
Mcu.Pin0=PC13-TAMPER-RTC
Mcu.Pin1=PD0-OSC_IN
-Mcu.Pin10=PA13
-Mcu.Pin11=PA14
-Mcu.Pin12=PB6
-Mcu.Pin13=PB7
-Mcu.Pin14=PB8
-Mcu.Pin15=PB9
-Mcu.Pin16=VP_SYS_VS_Systick
+Mcu.Pin10=PB13
+Mcu.Pin11=PB14
+Mcu.Pin12=PB15
+Mcu.Pin13=PA8
+Mcu.Pin14=PA9
+Mcu.Pin15=PA10
+Mcu.Pin16=PA13
+Mcu.Pin17=PA14
+Mcu.Pin18=PB7
+Mcu.Pin19=PB8
Mcu.Pin2=PD1-OSC_OUT
-Mcu.Pin3=PA3
-Mcu.Pin4=PA4
-Mcu.Pin5=PA5
-Mcu.Pin6=PA6
-Mcu.Pin7=PA7
-Mcu.Pin8=PA9
-Mcu.Pin9=PA10
-Mcu.PinsNb=17
+Mcu.Pin20=PB9
+Mcu.Pin21=VP_SYS_VS_Systick
+Mcu.Pin3=PA2
+Mcu.Pin4=PA3
+Mcu.Pin5=PA4
+Mcu.Pin6=PA5
+Mcu.Pin7=PA6
+Mcu.Pin8=PA7
+Mcu.Pin9=PB0
+Mcu.PinsNb=22
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32F103C6Tx
@@ -41,7 +47,8 @@ MxCube.Version=6.14.0
MxDb.Version=DB.6.0.140
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
-NVIC.EXTI9_5_IRQn=true\:1\:0\:true\:false\:true\:true\:true\:true
+NVIC.EXTI15_10_IRQn=true\:0\:0\:true\:false\:true\:true\:true\:true
+NVIC.EXTI9_5_IRQn=true\:0\:0\:true\:false\:true\:true\:true\:true
NVIC.ForceEnableDMAVector=true
NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
@@ -57,10 +64,10 @@ PA13.Mode=Serial_Wire
PA13.Signal=SYS_JTMS-SWDIO
PA14.Mode=Serial_Wire
PA14.Signal=SYS_JTCK-SWCLK
-PA3.GPIOParameters=GPIO_Label
-PA3.GPIO_Label=RC522_CS
-PA3.Locked=true
-PA3.Signal=GPIO_Output
+PA2.Mode=Asynchronous
+PA2.Signal=USART2_TX
+PA3.Mode=Asynchronous
+PA3.Signal=USART2_RX
PA4.GPIOParameters=GPIO_Label
PA4.GPIO_Label=RC522_RST
PA4.Locked=true
@@ -77,28 +84,53 @@ PA7.GPIOParameters=GPIO_Label
PA7.GPIO_Label=RC522_MOSI
PA7.Mode=Full_Duplex_Master
PA7.Signal=SPI1_MOSI
+PA8.GPIOParameters=GPIO_PuPd,GPIO_Label,GPIO_ModeDefaultEXTI
+PA8.GPIO_Label=KEY1
+PA8.GPIO_ModeDefaultEXTI=GPIO_MODE_IT_FALLING
+PA8.GPIO_PuPd=GPIO_PULLUP
+PA8.Locked=true
+PA8.Signal=GPXTI8
PA9.Mode=Asynchronous
PA9.Signal=USART1_TX
-PB6.Locked=true
-PB6.Mode=I2C
-PB6.Signal=I2C1_SCL
+PB0.GPIOParameters=GPIO_Label
+PB0.GPIO_Label=RC522_CS
+PB0.Locked=true
+PB0.Signal=GPIO_Output
+PB13.GPIOParameters=GPIO_PuPd,GPIO_Label,GPIO_ModeDefaultEXTI
+PB13.GPIO_Label=KEY4
+PB13.GPIO_ModeDefaultEXTI=GPIO_MODE_IT_FALLING
+PB13.GPIO_PuPd=GPIO_PULLUP
+PB13.Locked=true
+PB13.Signal=GPXTI13
+PB14.GPIOParameters=GPIO_PuPd,GPIO_Label,GPIO_ModeDefaultEXTI
+PB14.GPIO_Label=KEY3
+PB14.GPIO_ModeDefaultEXTI=GPIO_MODE_IT_FALLING
+PB14.GPIO_PuPd=GPIO_PULLUP
+PB14.Locked=true
+PB14.Signal=GPXTI14
+PB15.GPIOParameters=GPIO_PuPd,GPIO_Label,GPIO_ModeDefaultEXTI
+PB15.GPIO_Label=KEY2
+PB15.GPIO_ModeDefaultEXTI=GPIO_MODE_IT_FALLING
+PB15.GPIO_PuPd=GPIO_PULLUP
+PB15.Locked=true
+PB15.Signal=GPXTI15
+PB7.GPIOParameters=GPIO_Label
+PB7.GPIO_Label=RELAY1
PB7.Locked=true
-PB7.Mode=I2C
-PB7.Signal=I2C1_SDA
+PB7.Signal=GPIO_Output
PB8.GPIOParameters=GPIO_Label
-PB8.GPIO_Label=LED_BTN1
+PB8.GPIO_Label=OLED_SCL
PB8.Locked=true
-PB8.Signal=GPIO_Output
-PB9.GPIOParameters=GPIO_PuPd,GPIO_Label,GPIO_ModeDefaultEXTI
-PB9.GPIO_Label=BTN1
-PB9.GPIO_ModeDefaultEXTI=GPIO_MODE_IT_FALLING
-PB9.GPIO_PuPd=GPIO_PULLUP
+PB8.Mode=I2C
+PB8.Signal=I2C1_SCL
+PB9.GPIOParameters=GPIO_Label
+PB9.GPIO_Label=OLED_SDA
PB9.Locked=true
-PB9.Signal=GPXTI9
-PC13-TAMPER-RTC.GPIOParameters=PinState,GPIO_Label
+PB9.Mode=I2C
+PB9.Signal=I2C1_SDA
+PC13-TAMPER-RTC.GPIOParameters=GPIO_Label
PC13-TAMPER-RTC.GPIO_Label=LED0
PC13-TAMPER-RTC.Locked=true
-PC13-TAMPER-RTC.PinState=GPIO_PIN_SET
PC13-TAMPER-RTC.Signal=GPIO_Output
PD0-OSC_IN.Mode=HSE-External-Oscillator
PD0-OSC_IN.Signal=RCC_OSC_IN
@@ -136,7 +168,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_I2C1_Init-I2C1-false-HAL-true,4-MX_USART1_UART_Init-USART1-false-HAL-true,5-MX_SPI1_Init-SPI1-false-HAL-true
+ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_I2C1_Init-I2C1-false-HAL-true,4-MX_USART1_UART_Init-USART1-false-HAL-true,5-MX_SPI1_Init-SPI1-false-HAL-true,6-MX_USART2_UART_Init-USART2-false-HAL-true
RCC.ADCFreqValue=36000000
RCC.AHBFreq_Value=72000000
RCC.APB1CLKDivider=RCC_HCLK_DIV2
@@ -158,8 +190,14 @@ RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK
RCC.TimSysFreq_Value=72000000
RCC.USBFreq_Value=72000000
RCC.VCOOutput2Freq_Value=8000000
-SH.GPXTI9.0=GPIO_EXTI9
-SH.GPXTI9.ConfNb=1
+SH.GPXTI13.0=GPIO_EXTI13
+SH.GPXTI13.ConfNb=1
+SH.GPXTI14.0=GPIO_EXTI14
+SH.GPXTI14.ConfNb=1
+SH.GPXTI15.0=GPIO_EXTI15
+SH.GPXTI15.ConfNb=1
+SH.GPXTI8.0=GPIO_EXTI8
+SH.GPXTI8.ConfNb=1
SPI1.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_4
SPI1.CalculateBaudRate=18.0 MBits/s
SPI1.Direction=SPI_DIRECTION_2LINES
@@ -168,6 +206,8 @@ SPI1.Mode=SPI_MODE_MASTER
SPI1.VirtualType=VM_MASTER
USART1.IPParameters=VirtualMode
USART1.VirtualMode=VM_ASYNC
+USART2.IPParameters=VirtualMode
+USART2.VirtualMode=VM_ASYNC
VP_SYS_VS_Systick.Mode=SysTick
VP_SYS_VS_Systick.Signal=SYS_VS_Systick
board=custom
diff --git a/stlinkv2.cfg b/stlinkv2.cfg
index 132eb05..32fd9f7 100644
--- a/stlinkv2.cfg
+++ b/stlinkv2.cfg
@@ -1,8 +1,11 @@
# choose st-link/j-link/dap-link etc.
-#adapter driver cmsis-dap
-#transport select swd
-source [find interface/stlink-hla.cfg]
-transport select hla_swd
+
+adapter driver cmsis-dap
+transport select swd
+
+# source [find interface/stlink-hla.cfg]
+# transport select hla_swd
+
source [find target/stm32f1x.cfg]
# download speed = 10MHz
adapter speed 10000
\ No newline at end of file