Compare commits

..

3 Commits

Author SHA1 Message Date
Clément Grennerat
73f2ea0ce1 Revert switch to parallel interface 2025-09-14 17:17:59 +02:00
Clément Grennerat
d6bf59644a Trying to fix timing issues 2025-09-14 17:14:33 +02:00
Clément Grennerat
6132478e3d Trying to fix timing issues 2025-09-14 16:59:20 +02:00
9 changed files with 320 additions and 343 deletions

View File

@ -1,8 +1,8 @@
[PreviousLibFiles] [PreviousLibFiles]
LibFiles=Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_usart.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/Src/stm32f1xx_hal_uart.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/Inc/stm32f1xx_hal_uart.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_usart.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/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.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; LibFiles=Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_spi.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_spi.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_uart.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_usart.h;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_spi.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_uart.c;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_spi.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_spi.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_uart.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_usart.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.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] [PreviousUsedCubeIDEFiles]
SourceFiles=Core/Src/main.c;Core/Src/stm32f1xx_it.c;Core/Src/stm32f1xx_hal_msp.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/system_stm32f1xx.c;Core/Src/system_stm32f1xx.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/system_stm32f1xx.c;Core/Src/system_stm32f1xx.c;;; SourceFiles=Core/Src/main.c;Core/Src/stm32f1xx_it.c;Core/Src/stm32f1xx_hal_msp.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_spi.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/system_stm32f1xx.c;Core/Src/system_stm32f1xx.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_spi.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.c;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/system_stm32f1xx.c;Core/Src/system_stm32f1xx.c;;;
HeaderPath=/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Inc;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Inc/Legacy;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/CMSIS/Device/ST/STM32F1xx/Include;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/CMSIS/Include;Core/Inc; HeaderPath=/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Inc;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Inc/Legacy;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/CMSIS/Device/ST/STM32F1xx/Include;/Users/clement/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/CMSIS/Include;Core/Inc;
CDefines=USE_HAL_DRIVER;STM32F103xB;USE_HAL_DRIVER;USE_HAL_DRIVER; CDefines=USE_HAL_DRIVER;STM32F103xB;USE_HAL_DRIVER;USE_HAL_DRIVER;

View File

@ -85,6 +85,11 @@
<type>1</type> <type>1</type>
<locationURI>PARENT-4-PROJECT_LOC/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c</locationURI> <locationURI>PARENT-4-PROJECT_LOC/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c</locationURI>
</link> </link>
<link>
<name>Drivers/STM32F1xx_HAL_Driver/stm32f1xx_hal_spi.c</name>
<type>1</type>
<locationURI>PARENT-4-PROJECT_LOC/STM32Cube/Repository/STM32Cube_FW_F1_V1.8.6/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_spi.c</locationURI>
</link>
<link> <link>
<name>Drivers/STM32F1xx_HAL_Driver/stm32f1xx_hal_uart.c</name> <name>Drivers/STM32F1xx_HAL_Driver/stm32f1xx_hal_uart.c</name>
<type>1</type> <type>1</type>

View File

@ -26,16 +26,6 @@
#include "stm32f1xx.h" #include "stm32f1xx.h"
#include "main.h" #include "main.h"
// Control pins (replace with your actual definitions if needed)
#define MCU_CS_LOW() MCU_CS_GPIO_Port->BRR = MCU_CS_Pin
#define MCU_CS_HIGH() MCU_CS_GPIO_Port->BSRR = MCU_CS_Pin
#define MCU_WR_LOW() MCU_WR_GPIO_Port->BRR = MCU_WR_Pin
#define MCU_WR_HIGH() MCU_WR_GPIO_Port->BSRR = MCU_WR_Pin
#define MCU_RS_LOW() DCX_GPIO_Port->BRR = DCX_Pin // Command mode
#define MCU_RS_HIGH() DCX_GPIO_Port->BSRR = DCX_Pin // Data mode
#define MCU_RD_LOW() DRDX_GPIO_Port->BRR = DRDX_Pin
#define MCU_RD_HIGH() DRDX_GPIO_Port->BSRR = DRDX_Pin
#define SPI1_BASEDR_ADR SPI1_BASE //adresse du reg SPI3 DR pour acces 8 bits (defs std permet accès 16bits seulement) #define SPI1_BASEDR_ADR SPI1_BASE //adresse du reg SPI3 DR pour acces 8 bits (defs std permet accès 16bits seulement)
#define LCD_SCREEN_HEIGHT 282 // ST7365 is 320 (centered, offset = 19) #define LCD_SCREEN_HEIGHT 282 // ST7365 is 320 (centered, offset = 19)

View File

@ -75,10 +75,6 @@ void Error_Handler(void);
#define DTE_GPIO_Port GPIOA #define DTE_GPIO_Port GPIOA
#define DCX_Pin GPIO_PIN_3 #define DCX_Pin GPIO_PIN_3
#define DCX_GPIO_Port GPIOA #define DCX_GPIO_Port GPIOA
#define MCU_CS_Pin GPIO_PIN_4
#define MCU_CS_GPIO_Port GPIOA
#define MCU_WR_Pin GPIO_PIN_5
#define MCU_WR_GPIO_Port GPIOA
#define DB1_Pin GPIO_PIN_0 #define DB1_Pin GPIO_PIN_0
#define DB1_GPIO_Port GPIOB #define DB1_GPIO_Port GPIOB
#define DB3_Pin GPIO_PIN_1 #define DB3_Pin GPIO_PIN_1
@ -101,8 +97,8 @@ void Error_Handler(void);
#define IM2_GPIO_Port GPIOA #define IM2_GPIO_Port GPIOA
#define IM1_Pin GPIO_PIN_9 #define IM1_Pin GPIO_PIN_9
#define IM1_GPIO_Port GPIOA #define IM1_GPIO_Port GPIOA
#define DB14_Pin GPIO_PIN_10 #define PB14_Pin GPIO_PIN_10
#define DB14_GPIO_Port GPIOA #define PB14_GPIO_Port GPIOA
#define A11_Pin GPIO_PIN_11 #define A11_Pin GPIO_PIN_11
#define A11_GPIO_Port GPIOA #define A11_GPIO_Port GPIOA
#define A12_Pin GPIO_PIN_12 #define A12_Pin GPIO_PIN_12

View File

@ -62,7 +62,7 @@
/*#define HAL_MMC_MODULE_ENABLED */ /*#define HAL_MMC_MODULE_ENABLED */
/*#define HAL_SDRAM_MODULE_ENABLED */ /*#define HAL_SDRAM_MODULE_ENABLED */
/*#define HAL_SMARTCARD_MODULE_ENABLED */ /*#define HAL_SMARTCARD_MODULE_ENABLED */
/*#define HAL_SPI_MODULE_ENABLED */ #define HAL_SPI_MODULE_ENABLED
/*#define HAL_SRAM_MODULE_ENABLED */ /*#define HAL_SRAM_MODULE_ENABLED */
/*#define HAL_TIM_MODULE_ENABLED */ /*#define HAL_TIM_MODULE_ENABLED */
#define HAL_UART_MODULE_ENABLED #define HAL_UART_MODULE_ENABLED

View File

@ -32,173 +32,39 @@
volatile uint16_t LCD_HEIGHT = LCD_SCREEN_HEIGHT; volatile uint16_t LCD_HEIGHT = LCD_SCREEN_HEIGHT;
volatile uint16_t LCD_WIDTH = LCD_SCREEN_WIDTH; volatile uint16_t LCD_WIDTH = LCD_SCREEN_WIDTH;
/* SPI3 & GPIOs init function */
// Set all 16 data pins (DB0-DB15) based on a 16-bit value //void LCD_SPI_Init(void) {
//void SetDataPins(uint16_t value) { ////__HAL_RCC_SPI3_CLK_ENABLE();
// GPIOA->BSRR = (value & (1 << 0) ? DB0_Pin : (DB0_Pin << 16)) | // DB0 (GPIOA) // RCC->APB1ENR1 |= RCC_APB1ENR1_SPI3EN;// SPI3 clock enable
// (value & (1 << 14) ? DB14_Pin : (DB14_Pin << 16)); // DB14 (GPIOA) // RCC->AHB2ENR |= RCC_AHB2ENR_GPIOCEN;// GPIOC clock enable
// GPIOB->BSRR = (value & (1 << 1) ? DB1_Pin : (DB1_Pin << 16)) | // DB1 (GPIOB)
// (value & (1 << 3) ? DB3_Pin : (DB3_Pin << 16)) | // DB3 (GPIOB)
// (value & (1 << 5) ? DB5_Pin : (DB5_Pin << 16)) | // DB5 (GPIOB)
// (value & (1 << 7) ? DB7_Pin : (DB7_Pin << 16)) | // DB7 (GPIOB)
// (value & (1 << 9) ? DB9_Pin : (DB9_Pin << 16)) | // DB9 (GPIOB)
// (value & (1 << 11) ? DB11_Pin : (DB11_Pin << 16)) | // DB11 (GPIOB)
// (value & (1 << 12) ? DB12_Pin : (DB12_Pin << 16)) | // DB12 (GPIOB)
// (value & (1 << 13) ? DB13_Pin : (DB13_Pin << 16)) | // DB13 (GPIOB)
// (value & (1 << 15) ? DB15_Pin : (DB15_Pin << 16)); // DB15 (GPIOB)
// //
// GPIOD->BSRR = (value & (1 << 2) ? DB2_Pin : (DB2_Pin << 16)) | // DB2 (GPIOD) // /** CS & DC GPIO signals configuration
// (value & (1 << 4) ? DB4_Pin : (DB4_Pin << 16)); // DB4 (GPIOD) // PC8 ------> LCD_CS_PIN
// PC11 ------> LCD_DC_PIN
// */
// GPIOC->BSRR = LCD_CS_PIN | (LCD_DC_PIN << 16);//CS à 1 et DC à 0
// GPIOC->MODER |= (1 << 16) | (1 << 22);//GPIO out
// GPIOC->MODER &= ~((1 << 17) | (1 << 23));//mise à 0
// GPIOC->OTYPER &= (GPIO_OTYPER_OT8 | GPIO_OTYPER_OT11);//PC8 & 11 en PP
// GPIOC->OSPEEDR |= (3 << 16) | (3 << 22);//High speed
//
// /**SPI3 GPIO Configuration
// PC10 ------> SPI3_SCK
// PC12 ------> SPI3_MOSI */
// GPIOC->AFR[1] |= (6 << 8) | (6 << 16);//PC10 en AF6 : SPI3_SCK, PC12 en AF6 : SPI3_MOSI
// GPIOC->AFR[1] &= 0xFFF6F6FF;//Mise à 0
// GPIOC->MODER |= (2 << 20) | (2 << 24);//MODE AF
// GPIOC->MODER &= 0xFEEFFFFF;//Mise à 0
// GPIOC->OTYPER &= (GPIO_OTYPER_OT10 | GPIO_OTYPER_OT12);//PC10 & 12 en PP
// GPIOC->OSPEEDR |= (3 << 24) | (3 << 20);//High speed
//
// /*Configure module SPI3*/
// SPI3->CR1 = SPI_CR1_SSM | SPI_CR1_SSI;//CS soft, SSI à 1 sinon decl. mode fault
// SPI3->CR1 |= SPI_CR1_MSTR;// 0 sauf SPE et mode Master, BR = 0 => /2=> Fsck=40M
// SPI3->CR2 = 0x0700 | SPI_CR2_FRXTH;// | SPI_CR2_NSSP; //mode 8 bits, ITs disabled, no DMA, FRXTH doit être à 1 en 8 bits
// SPI3->CR1 |= SPI_CR1_SPE;
// //
// GPIOC->BSRR = (value & (1 << 6) ? DB6_Pin : (DB6_Pin << 16)) | // DB6 (GPIOC)
// (value & (1 << 8) ? DB8_Pin : (DB8_Pin << 16)) | // DB8 (GPIOC)
// (value & (1 << 10) ? DB10_Pin : (DB10_Pin << 16)); // DB10 (GPIOC)
//} //}
//void SetDataPins(uint16_t value) {
// // Reset all data pins to 0 first (using BRR)
// GPIOA->BRR = DB0_Pin | DB14_Pin; // Reset DB0, DB14 (GPIOA)
// GPIOB->BRR = DB1_Pin | DB3_Pin | DB5_Pin | DB7_Pin | DB9_Pin |
// DB11_Pin | DB12_Pin | DB13_Pin | DB15_Pin; // Reset DB1, DB3, DB5, DB7, DB9, DB11, DB12, DB13, DB15 (GPIOB)
// GPIOD->BRR = DB2_Pin | DB4_Pin; // Reset DB2, DB4 (GPIOD)
// GPIOC->BRR = DB6_Pin | DB8_Pin | DB10_Pin; // Reset DB6, DB8, DB10 (GPIOC)
//
// // Set pins to 1 if their corresponding bit in 'value' is 1 (using BSRR)
// if (value & (1 << 0)) GPIOA->BSRR = DB0_Pin; // DB0 (GPIOA)
// if (value & (1 << 1)) GPIOB->BSRR = DB1_Pin; // DB1 (GPIOB)
// if (value & (1 << 2)) GPIOD->BSRR = DB2_Pin; // DB2 (GPIOD)
// if (value & (1 << 3)) GPIOB->BSRR = DB3_Pin; // DB3 (GPIOB)
// if (value & (1 << 4)) GPIOD->BSRR = DB4_Pin; // DB4 (GPIOD)
// if (value & (1 << 5)) GPIOB->BSRR = DB5_Pin; // DB5 (GPIOB)
// if (value & (1 << 6)) GPIOC->BSRR = DB6_Pin; // DB6 (GPIOC)
// if (value & (1 << 7)) GPIOB->BSRR = DB7_Pin; // DB7 (GPIOB)
// if (value & (1 << 8)) GPIOC->BSRR = DB8_Pin; // DB8 (GPIOC)
// if (value & (1 << 9)) GPIOB->BSRR = DB9_Pin; // DB9 (GPIOB)
// if (value & (1 << 10)) GPIOC->BSRR = DB10_Pin; // DB10 (GPIOC)
// if (value & (1 << 11)) GPIOB->BSRR = DB11_Pin; // DB11 (GPIOB)
// if (value & (1 << 12)) GPIOB->BSRR = DB12_Pin; // DB12 (GPIOB)
// if (value & (1 << 13)) GPIOB->BSRR = DB13_Pin; // DB13 (GPIOB)
// if (value & (1 << 14)) GPIOA->BSRR = DB14_Pin; // DB14 (GPIOA)
// if (value & (1 << 15)) GPIOB->BSRR = DB15_Pin; // DB15 (GPIOB)
//}
typedef struct {
GPIO_TypeDef* port;
uint16_t pin;
} DataPin;
// Map each data bit (DB0-DB15) to its GPIO port and pin
const DataPin dataPins[16] = {
{DB0_GPIO_Port, DB0_Pin}, // DB0
{DB1_GPIO_Port, DB1_Pin}, // DB1
{DB2_GPIO_Port, DB2_Pin}, // DB2
{DB3_GPIO_Port, DB3_Pin}, // DB3
{DB4_GPIO_Port, DB4_Pin}, // DB4
{DB5_GPIO_Port, DB5_Pin}, // DB5
{DB6_GPIO_Port, DB6_Pin}, // DB6
{DB7_GPIO_Port, DB7_Pin}, // DB7
{DB8_GPIO_Port, DB8_Pin}, // DB8
{DB9_GPIO_Port, DB9_Pin}, // DB9
{DB10_GPIO_Port, DB10_Pin}, // DB10
{DB11_GPIO_Port, DB11_Pin}, // DB11
{DB12_GPIO_Port, DB12_Pin}, // DB12
{DB13_GPIO_Port, DB13_Pin}, // DB13
{DB14_GPIO_Port, DB14_Pin}, // DB14
{DB15_GPIO_Port, DB15_Pin} // DB15
};
void SetDataPins(uint16_t value) {
for (int i = 0; i < 16; i++) {
// Check if the i-th bit in 'value' is set
GPIO_PinState state = (value & (1 << i)) ? GPIO_PIN_SET : GPIO_PIN_RESET;
// Write the state to the corresponding GPIO pin
HAL_GPIO_WritePin(dataPins[i].port, dataPins[i].pin, state);
}
}
//void ScreenWriteCmd(uint16_t command) {
// MCU_RS_LOW();
// MCU_CS_LOW();
// SetDataPins(command);
// __NOP();
//
// MCU_WR_LOW();
// __NOP(); __NOP(); __NOP(); __NOP();
// MCU_WR_HIGH();
// __NOP(); __NOP(); __NOP(); __NOP();
//
// MCU_CS_HIGH();
//}
//void ScreenWriteData(uint16_t data) {
// MCU_RS_HIGH();
// MCU_CS_LOW();
// SetDataPins(data);
// __NOP();
//
// MCU_WR_LOW();
// __NOP(); __NOP(); __NOP(); __NOP();
// MCU_WR_HIGH();
// __NOP(); __NOP(); __NOP(); __NOP();
//
// MCU_CS_HIGH();
//}
// Write Command (optimized for timing)
void ScreenWriteCmd(uint16_t command) {
// 1. Set RS to command mode (t_AS = 10 ns)
MCU_RS_LOW();
__NOP(); // 1 NOP = ~15.625 ns > 10 ns
// 2. Assert CS (t_AS = 10 ns)
MCU_CS_LOW();
__NOP(); // 1 NOP = ~15.625 ns > 10 ns
// 3. Set data pins (t_DSW = 10 ns)
SetDataPins(command);
__NOP(); // 1 NOP = ~15.625 ns > 10 ns
// 4. Pulse WR low (PWLW = 50 ns)
MCU_WR_LOW();
__NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); // 4 NOPs = ~62.5 ns > 50 ns
__NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP();
MCU_WR_HIGH();
__NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP();
// 5. Hold time (t_H = 15 ns)
__NOP(); __NOP(); __NOP(); __NOP(); // 4 NOPs
// 6. Deassert CS (t_AH = 5 ns)
MCU_CS_HIGH();
}
// Write Data (same timing as command)
void ScreenWriteData(uint16_t data) {
// 1. Set RS to data mode (t_AS = 10 ns)
MCU_RS_HIGH();
__NOP(); // 1 NOP
// 2. Assert CS (t_AS = 10 ns)
MCU_CS_LOW();
__NOP(); // 1 NOP
// 3. Set data pins (t_DSW = 10 ns)
SetDataPins(data);
__NOP(); // 1 NOP
// 4. Pulse WR low (PWLW = 50 ns)
MCU_WR_LOW();
__NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); // 4 NOPs
__NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP();
MCU_WR_HIGH();
__NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP();
// 5. Hold time (t_H = 15 ns)
__NOP(); __NOP(); __NOP(); __NOP(); // 4 NOPs
// 6. Deassert CS (t_AH = 5 ns)
MCU_CS_HIGH();
}
/* Send command (char) to LCD via SPI bus */ /* Send command (char) to LCD via SPI bus */
void LCD_Write_Command(uint8_t Command) { void LCD_Write_Command(uint8_t Command) {
while ((SPI1->SR & SPI_SR_BSY) != 0); while ((SPI1->SR & SPI_SR_BSY) != 0);
@ -227,76 +93,109 @@ void LCD_Write_Data16(uint16_t data) {
/* Set the frame to draw into and sends a write into frame command */ /* Set the frame to draw into and sends a write into frame command */
void LCD_Set_Address(uint16_t X1, uint16_t Y1, uint16_t X2, uint16_t Y2) { void LCD_Set_Address(uint16_t X1, uint16_t Y1, uint16_t X2, uint16_t Y2) {
ScreenWriteCmd(0x2A); LCD_Write_Command(0x2A);
ScreenWriteData(X1 + 10); LCD_Write_Data16(X1 + 10);
ScreenWriteData(X2 + 10); LCD_Write_Data16(X2 + 10);
ScreenWriteCmd(0x2B); LCD_Write_Command(0x2B);
ScreenWriteData(Y1 + 19); LCD_Write_Data16(Y1 + 19);
ScreenWriteData(Y2 + 19); LCD_Write_Data16(Y2 + 19);
ScreenWriteCmd(0x2C); LCD_Write_Command(0x2C);
} }
//void LCD_Set_Rotation(uint8_t Rotation) {
//
// uint8_t screen_rotation = Rotation;
//
// LCD_Write_Command(0x36);
//
// switch (screen_rotation)
// case SCREEN_VERTICAL_1:
// LCD_Write_Data(0x40 | 0x08);
// LCD_WIDTH = 240;
// LCD_HEIGHT = 320;
// break;
// case SCREEN_HORIZONTAL_1:
// LCD_Write_Data(0x20 | 0x08);
// LCD_WIDTH = 320;
// LCD_HEIGHT = 240;
// break;
// case SCREEN_VERTICAL_2:
// LCD_Write_Data(0x80 | 0x08);
// LCD_WIDTH = 240;
// LCD_HEIGHT = 320;
// break;
// case SCREEN_HORIZONTAL_2:
// LCD_Write_Data(0x40 | 0x80 | 0x20 | 0x08);
// LCD_WIDTH = 320;
// LCD_HEIGHT = 240;
// break;
// default:
// break;
//}
void LCD_HardwareReset() { void LCD_HardwareReset() {
HAL_GPIO_WritePin(DRESET_GPIO_Port, DRESET_Pin, GPIO_PIN_SET); HAL_GPIO_WritePin(DRESET_GPIO_Port, DRESET_Pin, GPIO_PIN_SET);
HAL_Delay(1); HAL_Delay(1);
HAL_GPIO_WritePin(DRESET_GPIO_Port, DRESET_Pin, GPIO_PIN_RESET); HAL_GPIO_WritePin(DRESET_GPIO_Port, DRESET_Pin, GPIO_PIN_RESET);
HAL_Delay(20); HAL_Delay(20);
HAL_GPIO_WritePin(DRESET_GPIO_Port, DRESET_Pin, GPIO_PIN_SET); HAL_GPIO_WritePin(DRESET_GPIO_Port, DRESET_Pin, GPIO_PIN_SET);
HAL_Delay(200); HAL_Delay(150);
} }
void LCD_Init(void) { void LCD_Init(void) {
MCU_RD_HIGH();
LCD_HardwareReset(); LCD_HardwareReset();
// enable spi1
SPI1->CR1 |= SPI_CR1_SPE;// NSS (CS) pin is automatically pulled low
HAL_Delay(300);
// Software reset // Software reset
ScreenWriteCmd(0x01); // 1 LCD_Write_Command(0x01);
HAL_Delay(150); HAL_Delay(150);
// Color mode: 16bit/pixels // Color mode: 16bit/pixels
ScreenWriteCmd(0x3A); LCD_Write_Command(0x3A);
ScreenWriteData(0x55); LCD_Write_Data(0x55);
HAL_Delay(10); HAL_Delay(150);
// Enable color inversion (INVON) // Enable color inversion (INVON)
//ScreenWriteCmd(0x21); // 0100001 LCD_Write_Command(0x21);
// 1010001
// Configure orientation stuff // Configure orientation stuff
//ScreenWriteCmd(0x36); LCD_Write_Command(0x36);
//ScreenWriteData(0b10110100); LCD_Write_Data(0b10110100);
// Exit sleep // Exit sleep
ScreenWriteCmd(0x11); LCD_Write_Command(0x11);
HAL_Delay(120); HAL_Delay(150);
// Turn on display // Turn on display
ScreenWriteCmd(0x29); LCD_Write_Command(0x29);
HAL_Delay(100); HAL_Delay(400);
// Fill white // Fill white
LCD_Fill_Screen(RED); LCD_Fill_Screen(WHITE);
// Draw colors columns // Draw colors columns
// LCD_Set_Address(30, 30, LCD_SCREEN_WIDTH - 30, LCD_SCREEN_HEIGHT - 30); LCD_Set_Address(30, 30, LCD_SCREEN_WIDTH - 30, LCD_SCREEN_HEIGHT - 30);
// uint32_t size = (LCD_SCREEN_WIDTH - 59) * 20; uint32_t size = (LCD_SCREEN_WIDTH - 59) * 20;
// LCD_Draw_Colour_Burst(BLACK, size); LCD_Draw_Colour_Burst(BLACK, size);
// LCD_Draw_Colour_Burst(WHITE, size); LCD_Draw_Colour_Burst(WHITE, size);
// LCD_Draw_Colour_Burst(BLUE, size); LCD_Draw_Colour_Burst(BLUE, size);
// LCD_Draw_Colour_Burst(GREEN, size); LCD_Draw_Colour_Burst(GREEN, size);
// LCD_Draw_Colour_Burst(RED, size); LCD_Draw_Colour_Burst(RED, size);
// LCD_Draw_Colour_Burst(BLACK, 4 * size); LCD_Draw_Colour_Burst(BLACK, 4 * size);
// Draw rectangles in the angles // Draw rectangles in the angles
// LCD_Draw_Rectangle(1, 1, 20, 20, RED); LCD_Draw_Rectangle(1, 1, 20, 20, RED);
// LCD_Draw_Rectangle(LCD_SCREEN_WIDTH - 21, 1, 20, 20, GREEN); LCD_Draw_Rectangle(LCD_SCREEN_WIDTH - 21, 1, 20, 20, GREEN);
// LCD_Draw_Rectangle(LCD_SCREEN_WIDTH - 21, LCD_SCREEN_HEIGHT - 21, 20, 20, LCD_Draw_Rectangle(LCD_SCREEN_WIDTH - 21, LCD_SCREEN_HEIGHT - 21, 20, 20,
// MAGENTA); MAGENTA);
// LCD_Draw_Rectangle(1, LCD_SCREEN_HEIGHT - 21, 20, 20, BLUE); LCD_Draw_Rectangle(1, LCD_SCREEN_HEIGHT - 21, 20, 20, BLUE);
// STARTING ROTATION // STARTING ROTATION
//LCD_Set_Rotation(SCREEN_HORIZONTAL_1); //LCD_Set_Rotation(SCREEN_HORIZONTAL_1);
@ -305,14 +204,14 @@ void LCD_Init(void) {
//INTERNAL FUNCTION OF LIBRARY //INTERNAL FUNCTION OF LIBRARY
/*Sends block colour information to LCD*/ /*Sends block colour information to LCD*/
void LCD_Draw_Colour_Burst(uint16_t color, uint32_t size) { void LCD_Draw_Colour_Burst(uint16_t color, uint32_t size) {
//while ((SPI1->SR & SPI_SR_BSY) != 0);// Wait until SPI is not busy while ((SPI1->SR & SPI_SR_BSY) != 0);// Wait until SPI is not busy
// DATA; DATA
;
for (uint32_t j = 0; j < size; j++) { for (uint32_t j = 0; j < size; j++) {
ScreenWriteData(color); while ((SPI1->SR & SPI_SR_TXE) == 0);// Waiting for TX register to be available.
// while ((SPI1->SR & SPI_SR_TXE) == 0);// Waiting for TX register to be available. SPI1->DR = (color >> 8) & 0xFF;
// SPI1->DR = (color >> 8) & 0xFF; while ((SPI1->SR & SPI_SR_TXE) == 0);// Waiting for TX register to be available.
// while ((SPI1->SR & SPI_SR_TXE) == 0);// Waiting for TX register to be available. SPI1->DR = color & 0xFF;
// SPI1->DR = color & 0xFF;
} }
} }

View File

@ -40,6 +40,8 @@
/* USER CODE END PM */ /* USER CODE END PM */
/* Private variables ---------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/
SPI_HandleTypeDef hspi1;
UART_HandleTypeDef huart1; UART_HandleTypeDef huart1;
/* USER CODE BEGIN PV */ /* USER CODE BEGIN PV */
@ -49,6 +51,7 @@ UART_HandleTypeDef huart1;
/* Private function prototypes -----------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/
void SystemClock_Config(void); void SystemClock_Config(void);
static void MX_GPIO_Init(void); static void MX_GPIO_Init(void);
static void MX_SPI1_Init(void);
static void MX_USART1_UART_Init(void); static void MX_USART1_UART_Init(void);
/* USER CODE BEGIN PFP */ /* USER CODE BEGIN PFP */
@ -88,6 +91,7 @@ int main(void)
/* Initialize all configured peripherals */ /* Initialize all configured peripherals */
MX_GPIO_Init(); MX_GPIO_Init();
MX_SPI1_Init();
MX_USART1_UART_Init(); MX_USART1_UART_Init();
/* USER CODE BEGIN 2 */ /* USER CODE BEGIN 2 */
@ -98,8 +102,9 @@ int main(void)
while (1) while (1)
{ {
LCD_Init(); LCD_Init();
HAL_Delay(1000); HAL_Delay(10000);
__NOP(); HAL_Delay(10);
/* USER CODE END WHILE */ /* USER CODE END WHILE */
/* USER CODE BEGIN 3 */ /* USER CODE BEGIN 3 */
@ -145,6 +150,44 @@ void SystemClock_Config(void)
} }
} }
/**
* @brief SPI1 Initialization Function
* @param None
* @retval None
*/
static void MX_SPI1_Init(void)
{
/* USER CODE BEGIN SPI1_Init 0 */
/* USER CODE END SPI1_Init 0 */
/* USER CODE BEGIN SPI1_Init 1 */
/* USER CODE END SPI1_Init 1 */
/* SPI1 parameter configuration*/
hspi1.Instance = SPI1;
hspi1.Init.Mode = SPI_MODE_MASTER;
hspi1.Init.Direction = SPI_DIRECTION_2LINES;
hspi1.Init.DataSize = SPI_DATASIZE_8BIT;
hspi1.Init.CLKPolarity = SPI_POLARITY_LOW;
hspi1.Init.CLKPhase = SPI_PHASE_1EDGE;
hspi1.Init.NSS = SPI_NSS_HARD_OUTPUT;
hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_4;
hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB;
hspi1.Init.TIMode = SPI_TIMODE_DISABLE;
hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
hspi1.Init.CRCPolynomial = 10;
if (HAL_SPI_Init(&hspi1) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN SPI1_Init 2 */
/* USER CODE END SPI1_Init 2 */
}
/** /**
* @brief USART1 Initialization Function * @brief USART1 Initialization Function
* @param None * @param None
@ -203,42 +246,37 @@ static void MX_GPIO_Init(void)
HAL_GPIO_WritePin(GPIOD, DB4_Pin|DB2_Pin, GPIO_PIN_RESET); HAL_GPIO_WritePin(GPIOD, DB4_Pin|DB2_Pin, GPIO_PIN_RESET);
/*Configure GPIO pin Output Level */ /*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(GPIOA, DB0_Pin|DRESET_Pin|DCX_Pin|MCU_CS_Pin HAL_GPIO_WritePin(GPIOA, DB0_Pin|DRESET_Pin|DCX_Pin|PB14_Pin, GPIO_PIN_RESET);
|MCU_WR_Pin|IM2_Pin|DB14_Pin, GPIO_PIN_RESET);
/*Configure GPIO pin Output Level */ /*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(GPIOB, DB1_Pin|DB3_Pin|DB5_Pin|DB7_Pin HAL_GPIO_WritePin(GPIOB, DB1_Pin|DB3_Pin|DB5_Pin|DB7_Pin
|DB9_Pin|DB11_Pin|DB13_Pin|DB15_Pin |DB9_Pin|DB11_Pin|DB13_Pin|DB15_Pin
|IM0_Pin|DRDX_Pin|DB12_Pin, GPIO_PIN_RESET); |DRDX_Pin|DB12_Pin, GPIO_PIN_RESET);
/*Configure GPIO pin Output Level */ /*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(IM1_GPIO_Port, IM1_Pin, GPIO_PIN_SET); HAL_GPIO_WritePin(IM0_GPIO_Port, IM0_Pin, GPIO_PIN_SET);
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(GPIOA, IM2_Pin|IM1_Pin, GPIO_PIN_SET);
/*Configure GPIO pins : DB10_Pin DB8_Pin DB6_Pin */ /*Configure GPIO pins : DB10_Pin DB8_Pin DB6_Pin */
GPIO_InitStruct.Pin = DB10_Pin|DB8_Pin|DB6_Pin; GPIO_InitStruct.Pin = DB10_Pin|DB8_Pin|DB6_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
/*Configure GPIO pins : DB4_Pin DB2_Pin */ /*Configure GPIO pins : DB4_Pin DB2_Pin */
GPIO_InitStruct.Pin = DB4_Pin|DB2_Pin; GPIO_InitStruct.Pin = DB4_Pin|DB2_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct); HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
/*Configure GPIO pins : DB0_Pin DCX_Pin MCU_CS_Pin MCU_WR_Pin /*Configure GPIO pins : DB0_Pin DRESET_Pin DCX_Pin IM2_Pin
DB14_Pin */ IM1_Pin PB14_Pin */
GPIO_InitStruct.Pin = DB0_Pin|DCX_Pin|MCU_CS_Pin|MCU_WR_Pin GPIO_InitStruct.Pin = DB0_Pin|DRESET_Pin|DCX_Pin|IM2_Pin
|DB14_Pin; |IM1_Pin|PB14_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
/*Configure GPIO pins : DRESET_Pin IM2_Pin IM1_Pin */
GPIO_InitStruct.Pin = DRESET_Pin|IM2_Pin|IM1_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
@ -250,29 +288,16 @@ static void MX_GPIO_Init(void)
GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
/*Configure GPIO pins : PA6 PA7 */
GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
/*Configure GPIO pins : DB1_Pin DB3_Pin DB5_Pin DB7_Pin /*Configure GPIO pins : DB1_Pin DB3_Pin DB5_Pin DB7_Pin
DB9_Pin DB11_Pin DB13_Pin DB15_Pin DB9_Pin DB11_Pin DB13_Pin DB15_Pin
DRDX_Pin DB12_Pin */ IM0_Pin DRDX_Pin DB12_Pin */
GPIO_InitStruct.Pin = DB1_Pin|DB3_Pin|DB5_Pin|DB7_Pin GPIO_InitStruct.Pin = DB1_Pin|DB3_Pin|DB5_Pin|DB7_Pin
|DB9_Pin|DB11_Pin|DB13_Pin|DB15_Pin |DB9_Pin|DB11_Pin|DB13_Pin|DB15_Pin
|DRDX_Pin|DB12_Pin; |IM0_Pin|DRDX_Pin|DB12_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
/*Configure GPIO pin : IM0_Pin */
GPIO_InitStruct.Pin = IM0_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(IM0_GPIO_Port, &GPIO_InitStruct); HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
/*Configure peripheral I/O remapping */ /*Configure peripheral I/O remapping */
__HAL_AFIO_REMAP_PD01_ENABLE(); __HAL_AFIO_REMAP_PD01_ENABLE();

View File

@ -1,4 +1,4 @@
/* USER CODE BEGIN Header */ /* USER CODE BEGIN */
/** /**
****************************************************************************** ******************************************************************************
* @file stm32f1xx_hal_msp.c * @file stm32f1xx_hal_msp.c
@ -16,56 +16,56 @@
* *
****************************************************************************** ******************************************************************************
*/ */
/* USER CODE END Header */ /* USER CODE END */
/* Includes ------------------------------------------------------------------*/ /* Includes ------------------------------------------------------------------*/
#include "main.h" #include "main.h"
/* USER CODE BEGIN Includes */ /* USER CODE BEGIN */
/* USER CODE END Includes */ /* USER CODE END */
/* Private typedef -----------------------------------------------------------*/ /* Private typedef -----------------------------------------------------------*/
/* USER CODE BEGIN TD */ /* USER CODE BEGIN */
/* USER CODE END TD */ /* USER CODE END */
/* Private define ------------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN Define */ /* USER CODE BEGIN */
/* USER CODE END Define */ /* USER CODE END */
/* Private macro -------------------------------------------------------------*/ /* Private macro -------------------------------------------------------------*/
/* USER CODE BEGIN Macro */ /* USER CODE BEGIN */
/* USER CODE END Macro */ /* USER CODE END */
/* Private variables ---------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/
/* USER CODE BEGIN PV */ /* USER CODE BEGIN */
/* USER CODE END PV */ /* USER CODE END */
/* Private function prototypes -----------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/
/* USER CODE BEGIN PFP */ /* USER CODE BEGIN */
/* USER CODE END PFP */ /* USER CODE END */
/* External functions --------------------------------------------------------*/ /* External functions --------------------------------------------------------*/
/* USER CODE BEGIN ExternalFunctions */ /* USER CODE BEGIN */
/* USER CODE END ExternalFunctions */ /* USER CODE END */
/* USER CODE BEGIN 0 */ /* USER CODE BEGIN */
/* USER CODE END 0 */ /* USER CODE END */
/** /**
* Initializes the Global MSP. * Initializes the Global MSP.
*/ */
void HAL_MspInit(void) void HAL_MspInit(void)
{ {
/* USER CODE BEGIN MspInit 0 */ /* USER CODE BEGIN */
/* USER CODE END MspInit 0 */ /* USER CODE END */
__HAL_RCC_AFIO_CLK_ENABLE(); __HAL_RCC_AFIO_CLK_ENABLE();
__HAL_RCC_PWR_CLK_ENABLE(); __HAL_RCC_PWR_CLK_ENABLE();
@ -76,9 +76,82 @@ void HAL_MspInit(void)
*/ */
__HAL_AFIO_REMAP_SWJ_NOJTAG(); __HAL_AFIO_REMAP_SWJ_NOJTAG();
/* USER CODE BEGIN MspInit 1 */ /* USER CODE BEGIN */
/* USER CODE END */
}
/**
* @brief SPI MSP Initialization
* This function configures the hardware resources used in this example
* @param hspi: SPI handle pointer
* @retval None
*/
void HAL_SPI_MspInit(SPI_HandleTypeDef* hspi)
{
GPIO_InitTypeDef GPIO_InitStruct = {0};
if(hspi->Instance==SPI1)
{
/* USER CODE BEGIN */
/* USER CODE END */
/* Peripheral clock enable */
__HAL_RCC_SPI1_CLK_ENABLE();
__HAL_RCC_GPIOA_CLK_ENABLE();
/**SPI1 GPIO Configuration
PA4 ------> SPI1_NSS
PA5 ------> SPI1_SCK
PA6 ------> SPI1_MISO
PA7 ------> SPI1_MOSI
*/
GPIO_InitStruct.Pin = GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_7;
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_6;
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
/* USER CODE BEGIN */
/* USER CODE END */
}
}
/**
* @brief SPI MSP De-Initialization
* This function freeze the hardware resources used in this example
* @param hspi: SPI handle pointer
* @retval None
*/
void HAL_SPI_MspDeInit(SPI_HandleTypeDef* hspi)
{
if(hspi->Instance==SPI1)
{
/* USER CODE BEGIN */
/* USER CODE END */
/* Peripheral clock disable */
__HAL_RCC_SPI1_CLK_DISABLE();
/**SPI1 GPIO Configuration
PA4 ------> SPI1_NSS
PA5 ------> SPI1_SCK
PA6 ------> SPI1_MISO
PA7 ------> SPI1_MOSI
*/
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7);
/* USER CODE BEGIN */
/* USER CODE END */
}
/* USER CODE END MspInit 1 */
} }
/** /**
@ -92,9 +165,9 @@ void HAL_UART_MspInit(UART_HandleTypeDef* huart)
GPIO_InitTypeDef GPIO_InitStruct = {0}; GPIO_InitTypeDef GPIO_InitStruct = {0};
if(huart->Instance==USART1) if(huart->Instance==USART1)
{ {
/* USER CODE BEGIN USART1_MspInit 0 */ /* USER CODE BEGIN */
/* USER CODE END USART1_MspInit 0 */ /* USER CODE END */
/* Peripheral clock enable */ /* Peripheral clock enable */
__HAL_RCC_USART1_CLK_ENABLE(); __HAL_RCC_USART1_CLK_ENABLE();
@ -115,9 +188,9 @@ void HAL_UART_MspInit(UART_HandleTypeDef* huart)
__HAL_AFIO_REMAP_USART1_ENABLE(); __HAL_AFIO_REMAP_USART1_ENABLE();
/* USER CODE BEGIN USART1_MspInit 1 */ /* USER CODE BEGIN */
/* USER CODE END USART1_MspInit 1 */ /* USER CODE END */
} }
@ -133,9 +206,9 @@ void HAL_UART_MspDeInit(UART_HandleTypeDef* huart)
{ {
if(huart->Instance==USART1) if(huart->Instance==USART1)
{ {
/* USER CODE BEGIN USART1_MspDeInit 0 */ /* USER CODE BEGIN */
/* USER CODE END USART1_MspDeInit 0 */ /* USER CODE END */
/* Peripheral clock disable */ /* Peripheral clock disable */
__HAL_RCC_USART1_CLK_DISABLE(); __HAL_RCC_USART1_CLK_DISABLE();
@ -145,13 +218,13 @@ void HAL_UART_MspDeInit(UART_HandleTypeDef* huart)
*/ */
HAL_GPIO_DeInit(GPIOB, GPIO_PIN_6|GPIO_PIN_7); HAL_GPIO_DeInit(GPIOB, GPIO_PIN_6|GPIO_PIN_7);
/* USER CODE BEGIN USART1_MspDeInit 1 */ /* USER CODE BEGIN */
/* USER CODE END USART1_MspDeInit 1 */ /* USER CODE END */
} }
} }
/* USER CODE BEGIN 1 */ /* USER CODE BEGIN */
/* USER CODE END 1 */ /* USER CODE END */

View File

@ -9,9 +9,10 @@ Mcu.CPN=STM32F103CBT6
Mcu.Family=STM32F1 Mcu.Family=STM32F1
Mcu.IP0=NVIC Mcu.IP0=NVIC
Mcu.IP1=RCC Mcu.IP1=RCC
Mcu.IP2=SYS Mcu.IP2=SPI1
Mcu.IP3=USART1 Mcu.IP3=SYS
Mcu.IPNb=4 Mcu.IP4=USART1
Mcu.IPNb=5
Mcu.Name=STM32F103C(8-B)Tx Mcu.Name=STM32F103C(8-B)Tx
Mcu.Package=LQFP48 Mcu.Package=LQFP48
Mcu.Pin0=PC13-TAMPER-RTC Mcu.Pin0=PC13-TAMPER-RTC
@ -66,18 +67,16 @@ NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4
NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC.SysTick_IRQn=true\:15\:0\:false\:false\:true\:false\:true\:false NVIC.SysTick_IRQn=true\:15\:0\:false\:false\:true\:false\:true\:false
NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
PA0-WKUP.GPIOParameters=GPIO_Speed,GPIO_Label PA0-WKUP.GPIOParameters=GPIO_Label
PA0-WKUP.GPIO_Label=DB0 PA0-WKUP.GPIO_Label=DB0
PA0-WKUP.GPIO_Speed=GPIO_SPEED_FREQ_HIGH
PA0-WKUP.Locked=true PA0-WKUP.Locked=true
PA0-WKUP.Signal=GPIO_Output PA0-WKUP.Signal=GPIO_Output
PA1.GPIOParameters=GPIO_Label PA1.GPIOParameters=GPIO_Label
PA1.GPIO_Label=DRESET PA1.GPIO_Label=DRESET
PA1.Locked=true PA1.Locked=true
PA1.Signal=GPIO_Output PA1.Signal=GPIO_Output
PA10.GPIOParameters=GPIO_Speed,GPIO_Label PA10.GPIOParameters=GPIO_Label
PA10.GPIO_Label=DB14 PA10.GPIO_Label=PB14
PA10.GPIO_Speed=GPIO_SPEED_FREQ_HIGH
PA10.Locked=true PA10.Locked=true
PA10.Signal=GPIO_Output PA10.Signal=GPIO_Output
PA11.GPIOParameters=GPIO_Label PA11.GPIOParameters=GPIO_Label
@ -98,30 +97,27 @@ PA2.GPIOParameters=GPIO_Label
PA2.GPIO_Label=DTE PA2.GPIO_Label=DTE
PA2.Locked=true PA2.Locked=true
PA2.Signal=GPIO_Input PA2.Signal=GPIO_Input
PA3.GPIOParameters=GPIO_Speed,GPIO_Label PA3.GPIOParameters=GPIO_Label
PA3.GPIO_Label=DCX PA3.GPIO_Label=DCX
PA3.GPIO_Speed=GPIO_SPEED_FREQ_HIGH
PA3.Locked=true PA3.Locked=true
PA3.Signal=GPIO_Output PA3.Signal=GPIO_Output
PA4.GPIOParameters=GPIO_Speed,GPIO_Label
PA4.GPIO_Label=MCU_CS
PA4.GPIO_Speed=GPIO_SPEED_FREQ_HIGH
PA4.Locked=true PA4.Locked=true
PA4.Signal=GPIO_Output PA4.Mode=NSS_Signal_Hard_Output
PA5.GPIOParameters=GPIO_Speed,GPIO_Label PA4.Signal=SPI1_NSS
PA5.GPIO_Label=MCU_WR
PA5.GPIO_Speed=GPIO_SPEED_FREQ_HIGH
PA5.Locked=true PA5.Locked=true
PA5.Signal=GPIO_Output PA5.Mode=Full_Duplex_Master
PA5.Signal=SPI1_SCK
PA6.Locked=true PA6.Locked=true
PA6.Mode=Full_Duplex_Master
PA6.Signal=SPI1_MISO PA6.Signal=SPI1_MISO
PA7.Locked=true PA7.Locked=true
PA7.Mode=Full_Duplex_Master
PA7.Signal=SPI1_MOSI PA7.Signal=SPI1_MOSI
PA8.GPIOParameters=GPIO_Speed,PinState,GPIO_Label PA8.GPIOParameters=GPIO_Speed,PinState,GPIO_Label
PA8.GPIO_Label=IM2 PA8.GPIO_Label=IM2
PA8.GPIO_Speed=GPIO_SPEED_FREQ_LOW PA8.GPIO_Speed=GPIO_SPEED_FREQ_LOW
PA8.Locked=true PA8.Locked=true
PA8.PinState=GPIO_PIN_RESET PA8.PinState=GPIO_PIN_SET
PA8.Signal=GPIO_Output PA8.Signal=GPIO_Output
PA9.GPIOParameters=GPIO_Speed,PinState,GPIO_Label PA9.GPIOParameters=GPIO_Speed,PinState,GPIO_Label
PA9.GPIO_Label=IM1 PA9.GPIO_Label=IM1
@ -129,56 +125,47 @@ PA9.GPIO_Speed=GPIO_SPEED_FREQ_LOW
PA9.Locked=true PA9.Locked=true
PA9.PinState=GPIO_PIN_SET PA9.PinState=GPIO_PIN_SET
PA9.Signal=GPIO_Output PA9.Signal=GPIO_Output
PB0.GPIOParameters=GPIO_Speed,GPIO_Label PB0.GPIOParameters=GPIO_Label
PB0.GPIO_Label=DB1 PB0.GPIO_Label=DB1
PB0.GPIO_Speed=GPIO_SPEED_FREQ_HIGH
PB0.Locked=true PB0.Locked=true
PB0.Signal=GPIO_Output PB0.Signal=GPIO_Output
PB1.GPIOParameters=GPIO_Speed,GPIO_Label PB1.GPIOParameters=GPIO_Label
PB1.GPIO_Label=DB3 PB1.GPIO_Label=DB3
PB1.GPIO_Speed=GPIO_SPEED_FREQ_HIGH
PB1.Locked=true PB1.Locked=true
PB1.Signal=GPIO_Output PB1.Signal=GPIO_Output
PB10.GPIOParameters=GPIO_Speed,GPIO_Label PB10.GPIOParameters=GPIO_Label
PB10.GPIO_Label=DB7 PB10.GPIO_Label=DB7
PB10.GPIO_Speed=GPIO_SPEED_FREQ_HIGH
PB10.Locked=true PB10.Locked=true
PB10.Signal=GPIO_Output PB10.Signal=GPIO_Output
PB11.GPIOParameters=GPIO_Speed,GPIO_Label PB11.GPIOParameters=GPIO_Label
PB11.GPIO_Label=DB9 PB11.GPIO_Label=DB9
PB11.GPIO_Speed=GPIO_SPEED_FREQ_HIGH
PB11.Locked=true PB11.Locked=true
PB11.Signal=GPIO_Output PB11.Signal=GPIO_Output
PB12.GPIOParameters=GPIO_Speed,GPIO_Label PB12.GPIOParameters=GPIO_Label
PB12.GPIO_Label=DB11 PB12.GPIO_Label=DB11
PB12.GPIO_Speed=GPIO_SPEED_FREQ_HIGH
PB12.Locked=true PB12.Locked=true
PB12.Signal=GPIO_Output PB12.Signal=GPIO_Output
PB13.GPIOParameters=GPIO_Speed,GPIO_Label PB13.GPIOParameters=GPIO_Label
PB13.GPIO_Label=DB13 PB13.GPIO_Label=DB13
PB13.GPIO_Speed=GPIO_SPEED_FREQ_HIGH
PB13.Locked=true PB13.Locked=true
PB13.Signal=GPIO_Output PB13.Signal=GPIO_Output
PB14.GPIOParameters=GPIO_Speed,GPIO_Label PB14.GPIOParameters=GPIO_Label
PB14.GPIO_Label=DB15 PB14.GPIO_Label=DB15
PB14.GPIO_Speed=GPIO_SPEED_FREQ_HIGH
PB14.Locked=true PB14.Locked=true
PB14.Signal=GPIO_Output PB14.Signal=GPIO_Output
PB15.GPIOParameters=PinState,GPIO_Label PB15.GPIOParameters=PinState,GPIO_Label
PB15.GPIO_Label=IM0 PB15.GPIO_Label=IM0
PB15.Locked=true PB15.Locked=true
PB15.PinState=GPIO_PIN_RESET PB15.PinState=GPIO_PIN_SET
PB15.Signal=GPIO_Output PB15.Signal=GPIO_Output
PB2.GPIOParameters=GPIO_Speed,GPIO_Label PB2.GPIOParameters=GPIO_Label
PB2.GPIO_Label=DB5 PB2.GPIO_Label=DB5
PB2.GPIO_Speed=GPIO_SPEED_FREQ_HIGH
PB2.Locked=true PB2.Locked=true
PB2.Signal=GPIO_Output PB2.Signal=GPIO_Output
PB3.Locked=true PB3.Locked=true
PB3.Signal=SYS_JTDO-TRACESWO PB3.Signal=SYS_JTDO-TRACESWO
PB5.GPIOParameters=GPIO_Speed,GPIO_Label PB5.GPIOParameters=GPIO_Label
PB5.GPIO_Label=DRDX PB5.GPIO_Label=DRDX
PB5.GPIO_Speed=GPIO_SPEED_FREQ_HIGH
PB5.Locked=true PB5.Locked=true
PB5.Signal=GPIO_Output PB5.Signal=GPIO_Output
PB6.Locked=true PB6.Locked=true
@ -187,34 +174,28 @@ PB6.Signal=USART1_TX
PB7.Locked=true PB7.Locked=true
PB7.Mode=Asynchronous PB7.Mode=Asynchronous
PB7.Signal=USART1_RX PB7.Signal=USART1_RX
PB9.GPIOParameters=GPIO_Speed,GPIO_Label PB9.GPIOParameters=GPIO_Label
PB9.GPIO_Label=DB12 PB9.GPIO_Label=DB12
PB9.GPIO_Speed=GPIO_SPEED_FREQ_HIGH
PB9.Locked=true PB9.Locked=true
PB9.Signal=GPIO_Output PB9.Signal=GPIO_Output
PC13-TAMPER-RTC.GPIOParameters=GPIO_Speed,GPIO_Label PC13-TAMPER-RTC.GPIOParameters=GPIO_Label
PC13-TAMPER-RTC.GPIO_Label=DB10 PC13-TAMPER-RTC.GPIO_Label=DB10
PC13-TAMPER-RTC.GPIO_Speed=GPIO_SPEED_FREQ_HIGH
PC13-TAMPER-RTC.Locked=true PC13-TAMPER-RTC.Locked=true
PC13-TAMPER-RTC.Signal=GPIO_Output PC13-TAMPER-RTC.Signal=GPIO_Output
PC14-OSC32_IN.GPIOParameters=GPIO_Speed,GPIO_Label PC14-OSC32_IN.GPIOParameters=GPIO_Label
PC14-OSC32_IN.GPIO_Label=DB8 PC14-OSC32_IN.GPIO_Label=DB8
PC14-OSC32_IN.GPIO_Speed=GPIO_SPEED_FREQ_HIGH
PC14-OSC32_IN.Locked=true PC14-OSC32_IN.Locked=true
PC14-OSC32_IN.Signal=GPIO_Output PC14-OSC32_IN.Signal=GPIO_Output
PC15-OSC32_OUT.GPIOParameters=GPIO_Speed,GPIO_Label PC15-OSC32_OUT.GPIOParameters=GPIO_Label
PC15-OSC32_OUT.GPIO_Label=DB6 PC15-OSC32_OUT.GPIO_Label=DB6
PC15-OSC32_OUT.GPIO_Speed=GPIO_SPEED_FREQ_HIGH
PC15-OSC32_OUT.Locked=true PC15-OSC32_OUT.Locked=true
PC15-OSC32_OUT.Signal=GPIO_Output PC15-OSC32_OUT.Signal=GPIO_Output
PD0-OSC_IN.GPIOParameters=GPIO_Speed,GPIO_Label PD0-OSC_IN.GPIOParameters=GPIO_Label
PD0-OSC_IN.GPIO_Label=DB4 PD0-OSC_IN.GPIO_Label=DB4
PD0-OSC_IN.GPIO_Speed=GPIO_SPEED_FREQ_HIGH
PD0-OSC_IN.Locked=true PD0-OSC_IN.Locked=true
PD0-OSC_IN.Signal=GPIO_Output PD0-OSC_IN.Signal=GPIO_Output
PD1-OSC_OUT.GPIOParameters=GPIO_Speed,GPIO_Label PD1-OSC_OUT.GPIOParameters=GPIO_Label
PD1-OSC_OUT.GPIO_Label=DB2 PD1-OSC_OUT.GPIO_Label=DB2
PD1-OSC_OUT.GPIO_Speed=GPIO_SPEED_FREQ_HIGH
PD1-OSC_OUT.Locked=true PD1-OSC_OUT.Locked=true
PD1-OSC_OUT.Signal=GPIO_Output PD1-OSC_OUT.Signal=GPIO_Output
PinOutPanel.RotationAngle=-90 PinOutPanel.RotationAngle=-90
@ -249,7 +230,7 @@ ProjectManager.ToolChainLocation=
ProjectManager.UAScriptAfterPath= ProjectManager.UAScriptAfterPath=
ProjectManager.UAScriptBeforePath= ProjectManager.UAScriptBeforePath=
ProjectManager.UnderRoot=true 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 ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_SPI1_Init-SPI1-false-HAL-true,4-MX_USART1_UART_Init-USART1-false-HAL-true
RCC.ADCFreqValue=32000000 RCC.ADCFreqValue=32000000
RCC.AHBFreq_Value=64000000 RCC.AHBFreq_Value=64000000
RCC.APB1CLKDivider=RCC_HCLK_DIV2 RCC.APB1CLKDivider=RCC_HCLK_DIV2
@ -269,6 +250,14 @@ RCC.SYSCLKFreq_VALUE=64000000
RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK
RCC.TimSysFreq_Value=64000000 RCC.TimSysFreq_Value=64000000
RCC.USBFreq_Value=64000000 RCC.USBFreq_Value=64000000
SPI1.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_4
SPI1.CalculateBaudRate=16.0 MBits/s
SPI1.DataSize=SPI_DATASIZE_8BIT
SPI1.Direction=SPI_DIRECTION_2LINES
SPI1.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate,VirtualNSS,BaudRatePrescaler,DataSize
SPI1.Mode=SPI_MODE_MASTER
SPI1.VirtualNSS=VM_NSSHARD
SPI1.VirtualType=VM_MASTER
USART1.IPParameters=VirtualMode USART1.IPParameters=VirtualMode
USART1.VirtualMode=VM_ASYNC USART1.VirtualMode=VM_ASYNC
VP_SYS_VS_Systick.Mode=SysTick VP_SYS_VS_Systick.Mode=SysTick