Compare commits
4 Commits
master
...
back_to_wo
Author | SHA1 | Date | |
---|---|---|---|
ce5fefe33d
|
|||
f315ddaf09
|
|||
d265d8f777
|
|||
7bc0c8fe92
|
@ -20,8 +20,6 @@ my_src/led.o: ../my_src/led.c ../system/include/stm32f1xx/stm32f1xx_hal.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h \
|
||||
/home/wn/workspace-stm32/newcar/hottislib/PontCoopScheduler.h
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal.h:
|
||||
@ -70,8 +68,4 @@ my_src/led.o: ../my_src/led.c ../system/include/stm32f1xx/stm32f1xx_hal.h \
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h:
|
||||
|
||||
/home/wn/workspace-stm32/newcar/hottislib/PontCoopScheduler.h:
|
||||
|
Binary file not shown.
@ -21,9 +21,7 @@ my_src/main2.o: ../my_src/main2.c \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_flash.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h ../my_src/led.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h ../my_src/led.h \
|
||||
../my_src/oled.h
|
||||
|
||||
/home/wn/workspace-stm32/newcar/hottislib/PontCoopScheduler.h:
|
||||
@ -74,10 +72,6 @@ my_src/main2.o: ../my_src/main2.c \
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h:
|
||||
|
||||
../my_src/led.h:
|
||||
|
||||
../my_src/oled.h:
|
||||
|
Binary file not shown.
@ -20,9 +20,7 @@ my_src/oled.o: ../my_src/oled.c ../my_src/oled.h ../my_src/oled-fonts.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_flash.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h
|
||||
|
||||
../my_src/oled.h:
|
||||
|
||||
@ -73,7 +71,3 @@ my_src/oled.o: ../my_src/oled.c ../my_src/oled.h ../my_src/oled-fonts.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h:
|
||||
|
Binary file not shown.
BIN
Debug/newcar.elf
BIN
Debug/newcar.elf
Binary file not shown.
973
Debug/newcar.hex
973
Debug/newcar.hex
File diff suppressed because it is too large
Load Diff
1441
Debug/newcar.map
1441
Debug/newcar.map
File diff suppressed because it is too large
Load Diff
@ -20,8 +20,6 @@ src/main.o: ../src/main.c ../system/include/stm32f1xx/stm32f1xx_hal.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h \
|
||||
/home/wn/workspace-stm32/newcar/my_src/main2.h
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal.h:
|
||||
@ -70,8 +68,4 @@ src/main.o: ../src/main.c ../system/include/stm32f1xx/stm32f1xx_hal.h \
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h:
|
||||
|
||||
/home/wn/workspace-stm32/newcar/my_src/main2.h:
|
||||
|
BIN
Debug/src/main.o
BIN
Debug/src/main.o
Binary file not shown.
@ -20,9 +20,7 @@ src/stm32f1xx_hal_msp.o: ../src/stm32f1xx_hal_msp.c \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_flash.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal.h:
|
||||
|
||||
@ -69,7 +67,3 @@ src/stm32f1xx_hal_msp.o: ../src/stm32f1xx_hal_msp.c \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h:
|
||||
|
Binary file not shown.
@ -21,8 +21,6 @@ src/stm32f1xx_it.o: ../src/stm32f1xx_it.c \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h \
|
||||
../include/stm32f1xx_it.h
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal.h:
|
||||
@ -71,8 +69,4 @@ src/stm32f1xx_it.o: ../src/stm32f1xx_it.c \
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h:
|
||||
|
||||
../include/stm32f1xx_it.h:
|
||||
|
Binary file not shown.
@ -21,9 +21,7 @@ system/src/stm32f1xx/stm32f1xx_hal.o: \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_flash.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal.h:
|
||||
|
||||
@ -70,7 +68,3 @@ system/src/stm32f1xx/stm32f1xx_hal.o: \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h:
|
||||
|
Binary file not shown.
@ -21,9 +21,7 @@ system/src/stm32f1xx/stm32f1xx_hal_cortex.o: \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_flash.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal.h:
|
||||
|
||||
@ -70,7 +68,3 @@ system/src/stm32f1xx/stm32f1xx_hal_cortex.o: \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h:
|
||||
|
Binary file not shown.
@ -21,9 +21,7 @@ system/src/stm32f1xx/stm32f1xx_hal_dma.o: \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_flash.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal.h:
|
||||
|
||||
@ -70,7 +68,3 @@ system/src/stm32f1xx/stm32f1xx_hal_dma.o: \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h:
|
||||
|
Binary file not shown.
@ -21,9 +21,7 @@ system/src/stm32f1xx/stm32f1xx_hal_flash.o: \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_flash.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal.h:
|
||||
|
||||
@ -70,7 +68,3 @@ system/src/stm32f1xx/stm32f1xx_hal_flash.o: \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h:
|
||||
|
Binary file not shown.
@ -21,9 +21,7 @@ system/src/stm32f1xx/stm32f1xx_hal_flash_ex.o: \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_flash.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal.h:
|
||||
|
||||
@ -70,7 +68,3 @@ system/src/stm32f1xx/stm32f1xx_hal_flash_ex.o: \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h:
|
||||
|
Binary file not shown.
@ -21,9 +21,7 @@ system/src/stm32f1xx/stm32f1xx_hal_gpio.o: \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_flash.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal.h:
|
||||
|
||||
@ -70,7 +68,3 @@ system/src/stm32f1xx/stm32f1xx_hal_gpio.o: \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h:
|
||||
|
Binary file not shown.
@ -21,9 +21,7 @@ system/src/stm32f1xx/stm32f1xx_hal_gpio_ex.o: \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_flash.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal.h:
|
||||
|
||||
@ -70,7 +68,3 @@ system/src/stm32f1xx/stm32f1xx_hal_gpio_ex.o: \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h:
|
||||
|
Binary file not shown.
@ -21,9 +21,7 @@ system/src/stm32f1xx/stm32f1xx_hal_pwr.o: \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_flash.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal.h:
|
||||
|
||||
@ -70,7 +68,3 @@ system/src/stm32f1xx/stm32f1xx_hal_pwr.o: \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h:
|
||||
|
Binary file not shown.
@ -21,9 +21,7 @@ system/src/stm32f1xx/stm32f1xx_hal_rcc.o: \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_flash.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal.h:
|
||||
|
||||
@ -70,7 +68,3 @@ system/src/stm32f1xx/stm32f1xx_hal_rcc.o: \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h:
|
||||
|
Binary file not shown.
@ -21,9 +21,7 @@ system/src/stm32f1xx/stm32f1xx_hal_rcc_ex.o: \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_flash.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal.h:
|
||||
|
||||
@ -70,7 +68,3 @@ system/src/stm32f1xx/stm32f1xx_hal_rcc_ex.o: \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h:
|
||||
|
Binary file not shown.
@ -21,9 +21,7 @@ system/src/stm32f1xx/stm32f1xx_hal_spi.o: \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_flash.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal.h:
|
||||
|
||||
@ -70,7 +68,3 @@ system/src/stm32f1xx/stm32f1xx_hal_spi.o: \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h:
|
||||
|
Binary file not shown.
@ -21,9 +21,7 @@ system/src/stm32f1xx/stm32f1xx_hal_spi_ex.o: \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_flash.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal.h:
|
||||
|
||||
@ -70,7 +68,3 @@ system/src/stm32f1xx/stm32f1xx_hal_spi_ex.o: \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h:
|
||||
|
Binary file not shown.
@ -21,9 +21,7 @@ system/src/stm32f1xx/stm32f1xx_hal_tim.o: \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_flash.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal.h:
|
||||
|
||||
@ -70,7 +68,3 @@ system/src/stm32f1xx/stm32f1xx_hal_tim.o: \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h:
|
||||
|
Binary file not shown.
@ -21,9 +21,7 @@ system/src/stm32f1xx/stm32f1xx_hal_tim_ex.o: \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_flash.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_flash_ex.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal.h:
|
||||
|
||||
@ -70,7 +68,3 @@ system/src/stm32f1xx/stm32f1xx_hal_tim_ex.o: \
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_pwr.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_spi.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim.h:
|
||||
|
||||
../system/include/stm32f1xx/stm32f1xx_hal_tim_ex.h:
|
||||
|
Binary file not shown.
@ -43,36 +43,12 @@
|
||||
|
||||
#define LED_Pin GPIO_PIN_13
|
||||
#define LED_GPIO_Port GPIOC
|
||||
#define MOT4_CNT_Pin GPIO_PIN_0
|
||||
#define MOT4_CNT_GPIO_Port GPIOA
|
||||
#define OLED_DC_Pin GPIO_PIN_1
|
||||
#define OLED_DC_GPIO_Port GPIOA
|
||||
#define OLED_RST_Pin GPIO_PIN_2
|
||||
#define OLED_RST_GPIO_Port GPIOA
|
||||
#define OLED_CS_Pin GPIO_PIN_3
|
||||
#define OLED_CS_GPIO_Port GPIOA
|
||||
#define MOT1_DIR_Pin GPIO_PIN_8
|
||||
#define MOT1_DIR_GPIO_Port GPIOE
|
||||
#define MOT1_PWM_Pin GPIO_PIN_9
|
||||
#define MOT1_PWM_GPIO_Port GPIOE
|
||||
#define MOT2_DIR_Pin GPIO_PIN_10
|
||||
#define MOT2_DIR_GPIO_Port GPIOE
|
||||
#define MOT2_PWM_Pin GPIO_PIN_11
|
||||
#define MOT2_PWM_GPIO_Port GPIOE
|
||||
#define MOT3_DIR_Pin GPIO_PIN_12
|
||||
#define MOT3_DIR_GPIO_Port GPIOE
|
||||
#define MOT3_PWM_Pin GPIO_PIN_13
|
||||
#define MOT3_PWM_GPIO_Port GPIOE
|
||||
#define MOT4_PWM_Pin GPIO_PIN_14
|
||||
#define MOT4_PWM_GPIO_Port GPIOE
|
||||
#define MOT4_DIR_Pin GPIO_PIN_15
|
||||
#define MOT4_DIR_GPIO_Port GPIOE
|
||||
#define MOT1_CNT_Pin GPIO_PIN_15
|
||||
#define MOT1_CNT_GPIO_Port GPIOA
|
||||
#define MOT2_CNT_Pin GPIO_PIN_2
|
||||
#define MOT2_CNT_GPIO_Port GPIOD
|
||||
#define MOT3_CNT_Pin GPIO_PIN_0
|
||||
#define MOT3_CNT_GPIO_Port GPIOE
|
||||
/* USER CODE BEGIN Private defines */
|
||||
|
||||
/* USER CODE END Private defines */
|
||||
|
@ -77,7 +77,7 @@
|
||||
/*#define HAL_SMARTCARD_MODULE_ENABLED */
|
||||
#define HAL_SPI_MODULE_ENABLED
|
||||
/*#define HAL_SRAM_MODULE_ENABLED */
|
||||
#define HAL_TIM_MODULE_ENABLED
|
||||
/*#define HAL_TIM_MODULE_ENABLED */
|
||||
/*#define HAL_UART_MODULE_ENABLED */
|
||||
/*#define HAL_USART_MODULE_ENABLED */
|
||||
/*#define HAL_WWDG_MODULE_ENABLED */
|
||||
|
@ -40,12 +40,6 @@
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
SPI_HandleTypeDef hspi1;
|
||||
|
||||
TIM_HandleTypeDef htim1;
|
||||
TIM_HandleTypeDef htim2;
|
||||
TIM_HandleTypeDef htim3;
|
||||
TIM_HandleTypeDef htim4;
|
||||
TIM_HandleTypeDef htim8;
|
||||
|
||||
/* USER CODE BEGIN PV */
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
|
||||
@ -56,14 +50,6 @@ void SystemClock_Config(void);
|
||||
void Error_Handler(void);
|
||||
static void MX_GPIO_Init(void);
|
||||
static void MX_SPI1_Init(void);
|
||||
static void MX_TIM1_Init(void);
|
||||
static void MX_TIM2_Init(void);
|
||||
static void MX_TIM3_Init(void);
|
||||
static void MX_TIM4_Init(void);
|
||||
static void MX_TIM8_Init(void);
|
||||
|
||||
void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);
|
||||
|
||||
|
||||
/* USER CODE BEGIN PFP */
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
@ -92,11 +78,6 @@ int main(void)
|
||||
/* Initialize all configured peripherals */
|
||||
MX_GPIO_Init();
|
||||
MX_SPI1_Init();
|
||||
MX_TIM1_Init();
|
||||
MX_TIM2_Init();
|
||||
MX_TIM3_Init();
|
||||
MX_TIM4_Init();
|
||||
MX_TIM8_Init();
|
||||
|
||||
/* USER CODE BEGIN 2 */
|
||||
|
||||
@ -176,232 +157,6 @@ static void MX_SPI1_Init(void)
|
||||
|
||||
}
|
||||
|
||||
/* TIM1 init function */
|
||||
static void MX_TIM1_Init(void)
|
||||
{
|
||||
|
||||
TIM_ClockConfigTypeDef sClockSourceConfig;
|
||||
TIM_MasterConfigTypeDef sMasterConfig;
|
||||
TIM_BreakDeadTimeConfigTypeDef sBreakDeadTimeConfig;
|
||||
TIM_OC_InitTypeDef sConfigOC;
|
||||
|
||||
htim1.Instance = TIM1;
|
||||
htim1.Init.Prescaler = 0;
|
||||
htim1.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||
htim1.Init.Period = 0;
|
||||
htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
||||
htim1.Init.RepetitionCounter = 0;
|
||||
if (HAL_TIM_Base_Init(&htim1) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL;
|
||||
if (HAL_TIM_ConfigClockSource(&htim1, &sClockSourceConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
if (HAL_TIM_PWM_Init(&htim1) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
|
||||
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
|
||||
if (HAL_TIMEx_MasterConfigSynchronization(&htim1, &sMasterConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
sBreakDeadTimeConfig.OffStateRunMode = TIM_OSSR_DISABLE;
|
||||
sBreakDeadTimeConfig.OffStateIDLEMode = TIM_OSSI_DISABLE;
|
||||
sBreakDeadTimeConfig.LockLevel = TIM_LOCKLEVEL_OFF;
|
||||
sBreakDeadTimeConfig.DeadTime = 0;
|
||||
sBreakDeadTimeConfig.BreakState = TIM_BREAK_DISABLE;
|
||||
sBreakDeadTimeConfig.BreakPolarity = TIM_BREAKPOLARITY_HIGH;
|
||||
sBreakDeadTimeConfig.AutomaticOutput = TIM_AUTOMATICOUTPUT_DISABLE;
|
||||
if (HAL_TIMEx_ConfigBreakDeadTime(&htim1, &sBreakDeadTimeConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
sConfigOC.OCMode = TIM_OCMODE_PWM1;
|
||||
sConfigOC.Pulse = 0;
|
||||
sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH;
|
||||
sConfigOC.OCNPolarity = TIM_OCNPOLARITY_HIGH;
|
||||
sConfigOC.OCFastMode = TIM_OCFAST_DISABLE;
|
||||
sConfigOC.OCIdleState = TIM_OCIDLESTATE_RESET;
|
||||
sConfigOC.OCNIdleState = TIM_OCNIDLESTATE_RESET;
|
||||
if (HAL_TIM_PWM_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_1) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
if (HAL_TIM_PWM_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_2) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
if (HAL_TIM_PWM_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_3) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
if (HAL_TIM_PWM_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_4) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
HAL_TIM_MspPostInit(&htim1);
|
||||
|
||||
}
|
||||
|
||||
/* TIM2 init function */
|
||||
static void MX_TIM2_Init(void)
|
||||
{
|
||||
|
||||
TIM_SlaveConfigTypeDef sSlaveConfig;
|
||||
TIM_MasterConfigTypeDef sMasterConfig;
|
||||
|
||||
htim2.Instance = TIM2;
|
||||
htim2.Init.Prescaler = 0;
|
||||
htim2.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||
htim2.Init.Period = 0;
|
||||
htim2.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
||||
if (HAL_TIM_Base_Init(&htim2) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
sSlaveConfig.SlaveMode = TIM_SLAVEMODE_EXTERNAL1;
|
||||
sSlaveConfig.InputTrigger = TIM_TS_ETRF;
|
||||
sSlaveConfig.TriggerPolarity = TIM_TRIGGERPOLARITY_NONINVERTED;
|
||||
sSlaveConfig.TriggerPrescaler = TIM_TRIGGERPRESCALER_DIV1;
|
||||
sSlaveConfig.TriggerFilter = 0;
|
||||
if (HAL_TIM_SlaveConfigSynchronization(&htim2, &sSlaveConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
|
||||
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
|
||||
if (HAL_TIMEx_MasterConfigSynchronization(&htim2, &sMasterConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* TIM3 init function */
|
||||
static void MX_TIM3_Init(void)
|
||||
{
|
||||
|
||||
TIM_SlaveConfigTypeDef sSlaveConfig;
|
||||
TIM_MasterConfigTypeDef sMasterConfig;
|
||||
|
||||
htim3.Instance = TIM3;
|
||||
htim3.Init.Prescaler = 0;
|
||||
htim3.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||
htim3.Init.Period = 0;
|
||||
htim3.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
||||
if (HAL_TIM_Base_Init(&htim3) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
sSlaveConfig.SlaveMode = TIM_SLAVEMODE_EXTERNAL1;
|
||||
sSlaveConfig.InputTrigger = TIM_TS_ETRF;
|
||||
sSlaveConfig.TriggerPolarity = TIM_TRIGGERPOLARITY_NONINVERTED;
|
||||
sSlaveConfig.TriggerPrescaler = TIM_TRIGGERPRESCALER_DIV1;
|
||||
sSlaveConfig.TriggerFilter = 0;
|
||||
if (HAL_TIM_SlaveConfigSynchronization(&htim3, &sSlaveConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
|
||||
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
|
||||
if (HAL_TIMEx_MasterConfigSynchronization(&htim3, &sMasterConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* TIM4 init function */
|
||||
static void MX_TIM4_Init(void)
|
||||
{
|
||||
|
||||
TIM_SlaveConfigTypeDef sSlaveConfig;
|
||||
TIM_MasterConfigTypeDef sMasterConfig;
|
||||
|
||||
htim4.Instance = TIM4;
|
||||
htim4.Init.Prescaler = 0;
|
||||
htim4.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||
htim4.Init.Period = 0;
|
||||
htim4.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
||||
if (HAL_TIM_Base_Init(&htim4) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
sSlaveConfig.SlaveMode = TIM_SLAVEMODE_EXTERNAL1;
|
||||
sSlaveConfig.InputTrigger = TIM_TS_ETRF;
|
||||
sSlaveConfig.TriggerPolarity = TIM_TRIGGERPOLARITY_NONINVERTED;
|
||||
sSlaveConfig.TriggerPrescaler = TIM_TRIGGERPRESCALER_DIV1;
|
||||
sSlaveConfig.TriggerFilter = 0;
|
||||
if (HAL_TIM_SlaveConfigSynchronization(&htim4, &sSlaveConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
|
||||
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
|
||||
if (HAL_TIMEx_MasterConfigSynchronization(&htim4, &sMasterConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* TIM8 init function */
|
||||
static void MX_TIM8_Init(void)
|
||||
{
|
||||
|
||||
TIM_SlaveConfigTypeDef sSlaveConfig;
|
||||
TIM_MasterConfigTypeDef sMasterConfig;
|
||||
|
||||
htim8.Instance = TIM8;
|
||||
htim8.Init.Prescaler = 0;
|
||||
htim8.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||
htim8.Init.Period = 0;
|
||||
htim8.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
||||
htim8.Init.RepetitionCounter = 0;
|
||||
if (HAL_TIM_Base_Init(&htim8) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
sSlaveConfig.SlaveMode = TIM_SLAVEMODE_EXTERNAL1;
|
||||
sSlaveConfig.InputTrigger = TIM_TS_ETRF;
|
||||
sSlaveConfig.TriggerPolarity = TIM_TRIGGERPOLARITY_NONINVERTED;
|
||||
sSlaveConfig.TriggerPrescaler = TIM_TRIGGERPRESCALER_DIV1;
|
||||
sSlaveConfig.TriggerFilter = 0;
|
||||
if (HAL_TIM_SlaveConfigSynchronization(&htim8, &sSlaveConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
|
||||
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
|
||||
if (HAL_TIMEx_MasterConfigSynchronization(&htim8, &sMasterConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** Configure pins as
|
||||
* Analog
|
||||
* Input
|
||||
@ -417,17 +172,15 @@ static void MX_GPIO_Init(void)
|
||||
/* GPIO Ports Clock Enable */
|
||||
__HAL_RCC_GPIOC_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOA_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOE_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOD_CLK_ENABLE();
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOA, OLED_DC_Pin|OLED_RST_Pin|OLED_CS_Pin, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(GPIOA, OLED_DC_Pin|OLED_RST_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOE, MOT1_DIR_Pin|MOT2_DIR_Pin|MOT3_DIR_Pin|MOT4_DIR_Pin, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(OLED_CS_GPIO_Port, OLED_CS_Pin, GPIO_PIN_SET);
|
||||
|
||||
/*Configure GPIO pin : LED_Pin */
|
||||
GPIO_InitStruct.Pin = LED_Pin;
|
||||
@ -441,12 +194,6 @@ static void MX_GPIO_Init(void)
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : MOT1_DIR_Pin MOT2_DIR_Pin MOT3_DIR_Pin MOT4_DIR_Pin */
|
||||
GPIO_InitStruct.Pin = MOT1_DIR_Pin|MOT2_DIR_Pin|MOT3_DIR_Pin|MOT4_DIR_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
|
||||
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN 4 */
|
||||
|
@ -136,221 +136,6 @@ void HAL_SPI_MspDeInit(SPI_HandleTypeDef* hspi)
|
||||
|
||||
}
|
||||
|
||||
void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* htim_base)
|
||||
{
|
||||
|
||||
GPIO_InitTypeDef GPIO_InitStruct;
|
||||
if(htim_base->Instance==TIM1)
|
||||
{
|
||||
/* USER CODE BEGIN TIM1_MspInit 0 */
|
||||
|
||||
/* USER CODE END TIM1_MspInit 0 */
|
||||
/* Peripheral clock enable */
|
||||
__HAL_RCC_TIM1_CLK_ENABLE();
|
||||
/* USER CODE BEGIN TIM1_MspInit 1 */
|
||||
|
||||
/* USER CODE END TIM1_MspInit 1 */
|
||||
}
|
||||
else if(htim_base->Instance==TIM2)
|
||||
{
|
||||
/* USER CODE BEGIN TIM2_MspInit 0 */
|
||||
|
||||
/* USER CODE END TIM2_MspInit 0 */
|
||||
/* Peripheral clock enable */
|
||||
__HAL_RCC_TIM2_CLK_ENABLE();
|
||||
|
||||
/**TIM2 GPIO Configuration
|
||||
PA15 ------> TIM2_ETR
|
||||
*/
|
||||
GPIO_InitStruct.Pin = MOT1_CNT_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(MOT1_CNT_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
__HAL_AFIO_REMAP_TIM2_PARTIAL_1();
|
||||
|
||||
/* USER CODE BEGIN TIM2_MspInit 1 */
|
||||
|
||||
/* USER CODE END TIM2_MspInit 1 */
|
||||
}
|
||||
else if(htim_base->Instance==TIM3)
|
||||
{
|
||||
/* USER CODE BEGIN TIM3_MspInit 0 */
|
||||
|
||||
/* USER CODE END TIM3_MspInit 0 */
|
||||
/* Peripheral clock enable */
|
||||
__HAL_RCC_TIM3_CLK_ENABLE();
|
||||
|
||||
/**TIM3 GPIO Configuration
|
||||
PD2 ------> TIM3_ETR
|
||||
*/
|
||||
GPIO_InitStruct.Pin = MOT2_CNT_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(MOT2_CNT_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/* USER CODE BEGIN TIM3_MspInit 1 */
|
||||
|
||||
/* USER CODE END TIM3_MspInit 1 */
|
||||
}
|
||||
else if(htim_base->Instance==TIM4)
|
||||
{
|
||||
/* USER CODE BEGIN TIM4_MspInit 0 */
|
||||
|
||||
/* USER CODE END TIM4_MspInit 0 */
|
||||
/* Peripheral clock enable */
|
||||
__HAL_RCC_TIM4_CLK_ENABLE();
|
||||
|
||||
/**TIM4 GPIO Configuration
|
||||
PE0 ------> TIM4_ETR
|
||||
*/
|
||||
GPIO_InitStruct.Pin = MOT3_CNT_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(MOT3_CNT_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/* USER CODE BEGIN TIM4_MspInit 1 */
|
||||
|
||||
/* USER CODE END TIM4_MspInit 1 */
|
||||
}
|
||||
else if(htim_base->Instance==TIM8)
|
||||
{
|
||||
/* USER CODE BEGIN TIM8_MspInit 0 */
|
||||
|
||||
/* USER CODE END TIM8_MspInit 0 */
|
||||
/* Peripheral clock enable */
|
||||
__HAL_RCC_TIM8_CLK_ENABLE();
|
||||
|
||||
/**TIM8 GPIO Configuration
|
||||
PA0-WKUP ------> TIM8_ETR
|
||||
*/
|
||||
GPIO_InitStruct.Pin = MOT4_CNT_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(MOT4_CNT_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/* USER CODE BEGIN TIM8_MspInit 1 */
|
||||
|
||||
/* USER CODE END TIM8_MspInit 1 */
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void HAL_TIM_MspPostInit(TIM_HandleTypeDef* htim)
|
||||
{
|
||||
|
||||
GPIO_InitTypeDef GPIO_InitStruct;
|
||||
if(htim->Instance==TIM1)
|
||||
{
|
||||
/* USER CODE BEGIN TIM1_MspPostInit 0 */
|
||||
|
||||
/* USER CODE END TIM1_MspPostInit 0 */
|
||||
|
||||
/**TIM1 GPIO Configuration
|
||||
PE9 ------> TIM1_CH1
|
||||
PE11 ------> TIM1_CH2
|
||||
PE13 ------> TIM1_CH3
|
||||
PE14 ------> TIM1_CH4
|
||||
*/
|
||||
GPIO_InitStruct.Pin = MOT1_PWM_Pin|MOT2_PWM_Pin|MOT3_PWM_Pin|MOT4_PWM_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
|
||||
|
||||
__HAL_AFIO_REMAP_TIM1_ENABLE();
|
||||
|
||||
/* USER CODE BEGIN TIM1_MspPostInit 1 */
|
||||
|
||||
/* USER CODE END TIM1_MspPostInit 1 */
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* htim_base)
|
||||
{
|
||||
|
||||
if(htim_base->Instance==TIM1)
|
||||
{
|
||||
/* USER CODE BEGIN TIM1_MspDeInit 0 */
|
||||
|
||||
/* USER CODE END TIM1_MspDeInit 0 */
|
||||
/* Peripheral clock disable */
|
||||
__HAL_RCC_TIM1_CLK_DISABLE();
|
||||
/* USER CODE BEGIN TIM1_MspDeInit 1 */
|
||||
|
||||
/* USER CODE END TIM1_MspDeInit 1 */
|
||||
}
|
||||
else if(htim_base->Instance==TIM2)
|
||||
{
|
||||
/* USER CODE BEGIN TIM2_MspDeInit 0 */
|
||||
|
||||
/* USER CODE END TIM2_MspDeInit 0 */
|
||||
/* Peripheral clock disable */
|
||||
__HAL_RCC_TIM2_CLK_DISABLE();
|
||||
|
||||
/**TIM2 GPIO Configuration
|
||||
PA15 ------> TIM2_ETR
|
||||
*/
|
||||
HAL_GPIO_DeInit(MOT1_CNT_GPIO_Port, MOT1_CNT_Pin);
|
||||
|
||||
/* USER CODE BEGIN TIM2_MspDeInit 1 */
|
||||
|
||||
/* USER CODE END TIM2_MspDeInit 1 */
|
||||
}
|
||||
else if(htim_base->Instance==TIM3)
|
||||
{
|
||||
/* USER CODE BEGIN TIM3_MspDeInit 0 */
|
||||
|
||||
/* USER CODE END TIM3_MspDeInit 0 */
|
||||
/* Peripheral clock disable */
|
||||
__HAL_RCC_TIM3_CLK_DISABLE();
|
||||
|
||||
/**TIM3 GPIO Configuration
|
||||
PD2 ------> TIM3_ETR
|
||||
*/
|
||||
HAL_GPIO_DeInit(MOT2_CNT_GPIO_Port, MOT2_CNT_Pin);
|
||||
|
||||
/* USER CODE BEGIN TIM3_MspDeInit 1 */
|
||||
|
||||
/* USER CODE END TIM3_MspDeInit 1 */
|
||||
}
|
||||
else if(htim_base->Instance==TIM4)
|
||||
{
|
||||
/* USER CODE BEGIN TIM4_MspDeInit 0 */
|
||||
|
||||
/* USER CODE END TIM4_MspDeInit 0 */
|
||||
/* Peripheral clock disable */
|
||||
__HAL_RCC_TIM4_CLK_DISABLE();
|
||||
|
||||
/**TIM4 GPIO Configuration
|
||||
PE0 ------> TIM4_ETR
|
||||
*/
|
||||
HAL_GPIO_DeInit(MOT3_CNT_GPIO_Port, MOT3_CNT_Pin);
|
||||
|
||||
/* USER CODE BEGIN TIM4_MspDeInit 1 */
|
||||
|
||||
/* USER CODE END TIM4_MspDeInit 1 */
|
||||
}
|
||||
else if(htim_base->Instance==TIM8)
|
||||
{
|
||||
/* USER CODE BEGIN TIM8_MspDeInit 0 */
|
||||
|
||||
/* USER CODE END TIM8_MspDeInit 0 */
|
||||
/* Peripheral clock disable */
|
||||
__HAL_RCC_TIM8_CLK_DISABLE();
|
||||
|
||||
/**TIM8 GPIO Configuration
|
||||
PA0-WKUP ------> TIM8_ETR
|
||||
*/
|
||||
HAL_GPIO_DeInit(MOT4_CNT_GPIO_Port, MOT4_CNT_Pin);
|
||||
|
||||
/* USER CODE BEGIN TIM8_MspDeInit 1 */
|
||||
|
||||
/* USER CODE END TIM8_MspDeInit 1 */
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN 1 */
|
||||
|
||||
/* USER CODE END 1 */
|
||||
|
@ -6,44 +6,22 @@ Mcu.IP0=NVIC
|
||||
Mcu.IP1=RCC
|
||||
Mcu.IP2=SPI1
|
||||
Mcu.IP3=SYS
|
||||
Mcu.IP4=TIM1
|
||||
Mcu.IP5=TIM2
|
||||
Mcu.IP6=TIM3
|
||||
Mcu.IP7=TIM4
|
||||
Mcu.IP8=TIM8
|
||||
Mcu.IPNb=9
|
||||
Mcu.IPNb=4
|
||||
Mcu.Name=STM32F103V(C-D-E)Tx
|
||||
Mcu.Package=LQFP100
|
||||
Mcu.Pin0=PC13-TAMPER-RTC
|
||||
Mcu.Pin1=OSC_IN
|
||||
Mcu.Pin10=PE8
|
||||
Mcu.Pin11=PE9
|
||||
Mcu.Pin12=PE10
|
||||
Mcu.Pin13=PE11
|
||||
Mcu.Pin14=PE12
|
||||
Mcu.Pin15=PE13
|
||||
Mcu.Pin16=PE14
|
||||
Mcu.Pin17=PE15
|
||||
Mcu.Pin18=PA13
|
||||
Mcu.Pin19=PA14
|
||||
Mcu.Pin10=PA14
|
||||
Mcu.Pin11=VP_SYS_VS_Systick
|
||||
Mcu.Pin2=OSC_OUT
|
||||
Mcu.Pin20=PA15
|
||||
Mcu.Pin21=PD2
|
||||
Mcu.Pin22=PE0
|
||||
Mcu.Pin23=VP_SYS_VS_Systick
|
||||
Mcu.Pin24=VP_TIM1_VS_ClockSourceINT
|
||||
Mcu.Pin25=VP_TIM2_VS_ControllerModeClock
|
||||
Mcu.Pin26=VP_TIM3_VS_ControllerModeClock
|
||||
Mcu.Pin27=VP_TIM4_VS_ControllerModeClock
|
||||
Mcu.Pin28=VP_TIM8_VS_ControllerModeClock
|
||||
Mcu.Pin3=PA0-WKUP
|
||||
Mcu.Pin4=PA1
|
||||
Mcu.Pin5=PA2
|
||||
Mcu.Pin6=PA3
|
||||
Mcu.Pin7=PA5
|
||||
Mcu.Pin8=PA6
|
||||
Mcu.Pin9=PA7
|
||||
Mcu.PinsNb=29
|
||||
Mcu.Pin3=PA1
|
||||
Mcu.Pin4=PA2
|
||||
Mcu.Pin5=PA3
|
||||
Mcu.Pin6=PA5
|
||||
Mcu.Pin7=PA6
|
||||
Mcu.Pin8=PA7
|
||||
Mcu.Pin9=PA13
|
||||
Mcu.PinsNb=12
|
||||
Mcu.UserConstants=
|
||||
Mcu.UserName=STM32F103VCTx
|
||||
MxCube.Version=4.16.1
|
||||
@ -62,9 +40,6 @@ OSC_IN.Mode=HSE-External-Oscillator
|
||||
OSC_IN.Signal=RCC_OSC_IN
|
||||
OSC_OUT.Mode=HSE-External-Oscillator
|
||||
OSC_OUT.Signal=RCC_OSC_OUT
|
||||
PA0-WKUP.GPIOParameters=GPIO_Label
|
||||
PA0-WKUP.GPIO_Label=MOT4_CNT
|
||||
PA0-WKUP.Signal=S_TIM8_ETR
|
||||
PA1.GPIOParameters=GPIO_Label
|
||||
PA1.GPIO_Label=OLED_DC
|
||||
PA1.Locked=true
|
||||
@ -73,16 +48,14 @@ PA13.Mode=Serial_Wire
|
||||
PA13.Signal=SYS_JTMS-SWDIO
|
||||
PA14.Mode=Serial_Wire
|
||||
PA14.Signal=SYS_JTCK-SWCLK
|
||||
PA15.GPIOParameters=GPIO_Label
|
||||
PA15.GPIO_Label=MOT1_CNT
|
||||
PA15.Signal=S_TIM2_CH1_ETR
|
||||
PA2.GPIOParameters=GPIO_Label
|
||||
PA2.GPIO_Label=OLED_RST
|
||||
PA2.Locked=true
|
||||
PA2.Signal=GPIO_Output
|
||||
PA3.GPIOParameters=GPIO_Label
|
||||
PA3.GPIOParameters=PinState,GPIO_Label
|
||||
PA3.GPIO_Label=OLED_CS
|
||||
PA3.Locked=true
|
||||
PA3.PinState=GPIO_PIN_SET
|
||||
PA3.Signal=GPIO_Output
|
||||
PA5.Mode=Full_Duplex_Master
|
||||
PA5.Signal=SPI1_SCK
|
||||
@ -103,40 +76,6 @@ PCC.Seq0=0
|
||||
PCC.Series=STM32F1
|
||||
PCC.Temperature=25
|
||||
PCC.Vdd=3.3
|
||||
PD2.GPIOParameters=GPIO_Label
|
||||
PD2.GPIO_Label=MOT2_CNT
|
||||
PD2.Signal=S_TIM3_ETR
|
||||
PE0.GPIOParameters=GPIO_Label
|
||||
PE0.GPIO_Label=MOT3_CNT
|
||||
PE0.Signal=S_TIM4_ETR
|
||||
PE10.GPIOParameters=GPIO_Label
|
||||
PE10.GPIO_Label=MOT2_DIR
|
||||
PE10.Locked=true
|
||||
PE10.Signal=GPIO_Output
|
||||
PE11.GPIOParameters=GPIO_Label
|
||||
PE11.GPIO_Label=MOT2_PWM
|
||||
PE11.Signal=S_TIM1_CH2
|
||||
PE12.GPIOParameters=GPIO_Label
|
||||
PE12.GPIO_Label=MOT3_DIR
|
||||
PE12.Locked=true
|
||||
PE12.Signal=GPIO_Output
|
||||
PE13.GPIOParameters=GPIO_Label
|
||||
PE13.GPIO_Label=MOT3_PWM
|
||||
PE13.Signal=S_TIM1_CH3
|
||||
PE14.GPIOParameters=GPIO_Label
|
||||
PE14.GPIO_Label=MOT4_PWM
|
||||
PE14.Signal=S_TIM1_CH4
|
||||
PE15.GPIOParameters=GPIO_Label
|
||||
PE15.GPIO_Label=MOT4_DIR
|
||||
PE15.Locked=true
|
||||
PE15.Signal=GPIO_Output
|
||||
PE8.GPIOParameters=GPIO_Label
|
||||
PE8.GPIO_Label=MOT1_DIR
|
||||
PE8.Locked=true
|
||||
PE8.Signal=GPIO_Output
|
||||
PE9.GPIOParameters=GPIO_Label
|
||||
PE9.GPIO_Label=MOT1_PWM
|
||||
PE9.Signal=S_TIM1_CH1
|
||||
ProjectManager.AskForMigrate=true
|
||||
ProjectManager.BackupPrevious=false
|
||||
ProjectManager.CompilerOptimize=2
|
||||
@ -159,7 +98,7 @@ ProjectManager.StackSize=0x400
|
||||
ProjectManager.TargetToolchain=SW4STM32
|
||||
ProjectManager.ToolChainLocation=/home/wn/workspace-stm32/newcar/cube/newcar
|
||||
ProjectManager.UnderRoot=true
|
||||
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false,2-MX_SPI1_Init-SPI1-false,3-MX_TIM1_Init-TIM1-false,4-MX_TIM2_Init-TIM2-false,5-MX_TIM3_Init-TIM3-false,6-MX_TIM4_Init-TIM4-false,7-MX_TIM8_Init-TIM8-false
|
||||
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false,2-MX_SPI1_Init-SPI1-false
|
||||
RCC.ADCFreqValue=36000000
|
||||
RCC.AHBFreq_Value=72000000
|
||||
RCC.APB1CLKDivider=RCC_HCLK_DIV2
|
||||
@ -187,42 +126,12 @@ RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK
|
||||
RCC.TimSysFreq_Value=72000000
|
||||
RCC.USBFreq_Value=72000000
|
||||
RCC.VCOOutput2Freq_Value=8000000
|
||||
SH.S_TIM1_CH1.0=TIM1_CH1,PWM Generation1 CH1
|
||||
SH.S_TIM1_CH1.ConfNb=1
|
||||
SH.S_TIM1_CH2.0=TIM1_CH2,PWM Generation2 CH2
|
||||
SH.S_TIM1_CH2.ConfNb=1
|
||||
SH.S_TIM1_CH3.0=TIM1_CH3,PWM Generation3 CH3
|
||||
SH.S_TIM1_CH3.ConfNb=1
|
||||
SH.S_TIM1_CH4.0=TIM1_CH4,PWM Generation4 CH4
|
||||
SH.S_TIM1_CH4.ConfNb=1
|
||||
SH.S_TIM2_CH1_ETR.0=TIM2_ETR,TriggerSource_ETR
|
||||
SH.S_TIM2_CH1_ETR.ConfNb=1
|
||||
SH.S_TIM3_ETR.0=TIM3_ETR,TriggerSource_ETR
|
||||
SH.S_TIM3_ETR.ConfNb=1
|
||||
SH.S_TIM4_ETR.0=TIM4_ETR,TriggerSource_ETR
|
||||
SH.S_TIM4_ETR.ConfNb=1
|
||||
SH.S_TIM8_ETR.0=TIM8_ETR,TriggerSource_ETR
|
||||
SH.S_TIM8_ETR.ConfNb=1
|
||||
SPI1.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_16
|
||||
SPI1.CLKPhase=SPI_PHASE_2EDGE
|
||||
SPI1.CLKPolarity=SPI_POLARITY_HIGH
|
||||
SPI1.CalculateBaudRate=4.5 MBits/s
|
||||
SPI1.IPParameters=Mode,BaudRatePrescaler,CalculateBaudRate,CLKPhase,CLKPolarity
|
||||
SPI1.IPParameters=Mode,BaudRatePrescaler,CalculateBaudRate,CLKPolarity,CLKPhase
|
||||
SPI1.Mode=SPI_MODE_MASTER
|
||||
TIM1.Channel-PWM\ Generation2\ CH2=TIM_CHANNEL_2
|
||||
TIM1.Channel-PWM\ Generation3\ CH3=TIM_CHANNEL_3
|
||||
TIM1.Channel-PWM\ Generation4\ CH4=TIM_CHANNEL_4
|
||||
TIM1.IPParameters=Channel-PWM Generation2 CH2,Channel-PWM Generation3 CH3,Channel-PWM Generation4 CH4
|
||||
VP_SYS_VS_Systick.Mode=SysTick
|
||||
VP_SYS_VS_Systick.Signal=SYS_VS_Systick
|
||||
VP_TIM1_VS_ClockSourceINT.Mode=Internal
|
||||
VP_TIM1_VS_ClockSourceINT.Signal=TIM1_VS_ClockSourceINT
|
||||
VP_TIM2_VS_ControllerModeClock.Mode=Clock Mode
|
||||
VP_TIM2_VS_ControllerModeClock.Signal=TIM2_VS_ControllerModeClock
|
||||
VP_TIM3_VS_ControllerModeClock.Mode=Clock Mode
|
||||
VP_TIM3_VS_ControllerModeClock.Signal=TIM3_VS_ControllerModeClock
|
||||
VP_TIM4_VS_ControllerModeClock.Mode=Clock Mode
|
||||
VP_TIM4_VS_ControllerModeClock.Signal=TIM4_VS_ControllerModeClock
|
||||
VP_TIM8_VS_ControllerModeClock.Mode=Clock Mode
|
||||
VP_TIM8_VS_ControllerModeClock.Signal=TIM8_VS_ControllerModeClock
|
||||
board=newcar
|
||||
|
Binary file not shown.
@ -1,84 +0,0 @@
|
||||
Configuration newcar
|
||||
STM32CubeMX 4.16.1
|
||||
Date 03/31/2018
|
||||
MCU STM32F103VCTx
|
||||
|
||||
|
||||
|
||||
PERIPHERALS MODES FUNCTIONS PINS
|
||||
RCC Crystal/Ceramic Resonator RCC_OSC_IN OSC_IN
|
||||
RCC Crystal/Ceramic Resonator RCC_OSC_OUT OSC_OUT
|
||||
SPI1 Full-Duplex Master SPI1_MISO PA6
|
||||
SPI1 Full-Duplex Master SPI1_MOSI PA7
|
||||
SPI1 Full-Duplex Master SPI1_SCK PA5
|
||||
SYS Serial Wire SYS_JTCK-SWCLK PA14
|
||||
SYS Serial Wire SYS_JTMS-SWDIO PA13
|
||||
SYS SysTick SYS_VS_Systick VP_SYS_VS_Systick
|
||||
TIM1 Internal Clock TIM1_VS_ClockSourceINT VP_TIM1_VS_ClockSourceINT
|
||||
TIM1 PWM Generation CH1 TIM1_CH1 PE9
|
||||
TIM1 PWM Generation CH2 TIM1_CH2 PE11
|
||||
TIM1 PWM Generation CH3 TIM1_CH3 PE13
|
||||
TIM1 PWM Generation CH4 TIM1_CH4 PE14
|
||||
TIM2 External Clock Mode 1 TIM2_VS_ControllerModeClock VP_TIM2_VS_ControllerModeClock
|
||||
TIM2 ETR1 TIM2_ETR PA15
|
||||
TIM3 External Clock Mode 1 TIM3_VS_ControllerModeClock VP_TIM3_VS_ControllerModeClock
|
||||
TIM3 ETR1 TIM3_ETR PD2
|
||||
TIM4 External Clock Mode 1 TIM4_VS_ControllerModeClock VP_TIM4_VS_ControllerModeClock
|
||||
TIM4 ETR1 TIM4_ETR PE0
|
||||
TIM8 External Clock Mode 1 TIM8_VS_ControllerModeClock VP_TIM8_VS_ControllerModeClock
|
||||
TIM8 ETR1 TIM8_ETR PA0-WKUP
|
||||
|
||||
|
||||
|
||||
Pin Nb PINs FUNCTIONs LABELs
|
||||
7 PC13-TAMPER-RTC GPIO_Output LED
|
||||
12 OSC_IN RCC_OSC_IN
|
||||
13 OSC_OUT RCC_OSC_OUT
|
||||
23 PA0-WKUP TIM8_ETR MOT4_CNT
|
||||
24 PA1 GPIO_Output OLED_DC
|
||||
25 PA2 GPIO_Output OLED_RST
|
||||
26 PA3 GPIO_Output OLED_CS
|
||||
30 PA5 SPI1_SCK
|
||||
31 PA6 SPI1_MISO
|
||||
32 PA7 SPI1_MOSI
|
||||
39 PE8 GPIO_Output MOT1_DIR
|
||||
40 PE9 TIM1_CH1 MOT1_PWM
|
||||
41 PE10 GPIO_Output MOT2_DIR
|
||||
42 PE11 TIM1_CH2 MOT2_PWM
|
||||
43 PE12 GPIO_Output MOT3_DIR
|
||||
44 PE13 TIM1_CH3 MOT3_PWM
|
||||
45 PE14 TIM1_CH4 MOT4_PWM
|
||||
46 PE15 GPIO_Output MOT4_DIR
|
||||
72 PA13 SYS_JTMS-SWDIO
|
||||
76 PA14 SYS_JTCK-SWCLK
|
||||
77 PA15 TIM2_ETR MOT1_CNT
|
||||
83 PD2 TIM3_ETR MOT2_CNT
|
||||
97 PE0 TIM4_ETR MOT3_CNT
|
||||
|
||||
|
||||
|
||||
SOFTWARE PROJECT
|
||||
|
||||
Project Settings :
|
||||
Project Name : newcar
|
||||
Project Folder : /home/wn/workspace-stm32/newcar/cube/newcar
|
||||
Toolchain / IDE : SW4STM32
|
||||
Firmware Package Name and Version : STM32Cube FW_F1 V1.4.0
|
||||
|
||||
|
||||
Code Generation Settings :
|
||||
STM32Cube Firmware Library Package : Copy only the necessary library files
|
||||
Generate peripheral initialization as a pair of '.c/.h' files per peripherals : No
|
||||
Backup previously generated files when re-generating : No
|
||||
Delete previously generated files when not re-generated : Yes
|
||||
Set all free pins as analog (to optimize the power consumption) : No
|
||||
|
||||
|
||||
Toolchains Settings :
|
||||
Compiler Optimizations : Balanced Size/Speed
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -43,36 +43,12 @@
|
||||
|
||||
#define LED_Pin GPIO_PIN_13
|
||||
#define LED_GPIO_Port GPIOC
|
||||
#define MOT4_CNT_Pin GPIO_PIN_0
|
||||
#define MOT4_CNT_GPIO_Port GPIOA
|
||||
#define OLED_DC_Pin GPIO_PIN_1
|
||||
#define OLED_DC_GPIO_Port GPIOA
|
||||
#define OLED_RST_Pin GPIO_PIN_2
|
||||
#define OLED_RST_GPIO_Port GPIOA
|
||||
#define OLED_CS_Pin GPIO_PIN_3
|
||||
#define OLED_CS_GPIO_Port GPIOA
|
||||
#define MOT1_DIR_Pin GPIO_PIN_8
|
||||
#define MOT1_DIR_GPIO_Port GPIOE
|
||||
#define MOT1_PWM_Pin GPIO_PIN_9
|
||||
#define MOT1_PWM_GPIO_Port GPIOE
|
||||
#define MOT2_DIR_Pin GPIO_PIN_10
|
||||
#define MOT2_DIR_GPIO_Port GPIOE
|
||||
#define MOT2_PWM_Pin GPIO_PIN_11
|
||||
#define MOT2_PWM_GPIO_Port GPIOE
|
||||
#define MOT3_DIR_Pin GPIO_PIN_12
|
||||
#define MOT3_DIR_GPIO_Port GPIOE
|
||||
#define MOT3_PWM_Pin GPIO_PIN_13
|
||||
#define MOT3_PWM_GPIO_Port GPIOE
|
||||
#define MOT4_PWM_Pin GPIO_PIN_14
|
||||
#define MOT4_PWM_GPIO_Port GPIOE
|
||||
#define MOT4_DIR_Pin GPIO_PIN_15
|
||||
#define MOT4_DIR_GPIO_Port GPIOE
|
||||
#define MOT1_CNT_Pin GPIO_PIN_15
|
||||
#define MOT1_CNT_GPIO_Port GPIOA
|
||||
#define MOT2_CNT_Pin GPIO_PIN_2
|
||||
#define MOT2_CNT_GPIO_Port GPIOD
|
||||
#define MOT3_CNT_Pin GPIO_PIN_0
|
||||
#define MOT3_CNT_GPIO_Port GPIOE
|
||||
/* USER CODE BEGIN Private defines */
|
||||
|
||||
/* USER CODE END Private defines */
|
||||
|
@ -77,7 +77,7 @@
|
||||
/*#define HAL_SMARTCARD_MODULE_ENABLED */
|
||||
#define HAL_SPI_MODULE_ENABLED
|
||||
/*#define HAL_SRAM_MODULE_ENABLED */
|
||||
#define HAL_TIM_MODULE_ENABLED
|
||||
/*#define HAL_TIM_MODULE_ENABLED */
|
||||
/*#define HAL_UART_MODULE_ENABLED */
|
||||
/*#define HAL_USART_MODULE_ENABLED */
|
||||
/*#define HAL_WWDG_MODULE_ENABLED */
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "oled.h"
|
||||
|
||||
|
||||
|
||||
void my_setup_1() {
|
||||
schInit();
|
||||
}
|
||||
@ -44,6 +45,7 @@ void my_errorHandler() {
|
||||
void my_setup_2() {
|
||||
blinkInit();
|
||||
LED_P8x16Str(0, 0, "Hallo");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
257
src/main.c
257
src/main.c
@ -41,12 +41,6 @@
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
SPI_HandleTypeDef hspi1;
|
||||
|
||||
TIM_HandleTypeDef htim1;
|
||||
TIM_HandleTypeDef htim2;
|
||||
TIM_HandleTypeDef htim3;
|
||||
TIM_HandleTypeDef htim4;
|
||||
TIM_HandleTypeDef htim8;
|
||||
|
||||
/* USER CODE BEGIN PV */
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
|
||||
@ -57,14 +51,6 @@ void SystemClock_Config(void);
|
||||
void Error_Handler(void);
|
||||
static void MX_GPIO_Init(void);
|
||||
static void MX_SPI1_Init(void);
|
||||
static void MX_TIM1_Init(void);
|
||||
static void MX_TIM2_Init(void);
|
||||
static void MX_TIM3_Init(void);
|
||||
static void MX_TIM4_Init(void);
|
||||
static void MX_TIM8_Init(void);
|
||||
|
||||
void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);
|
||||
|
||||
|
||||
/* USER CODE BEGIN PFP */
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
@ -94,11 +80,6 @@ int main(void)
|
||||
/* Initialize all configured peripherals */
|
||||
MX_GPIO_Init();
|
||||
MX_SPI1_Init();
|
||||
MX_TIM1_Init();
|
||||
MX_TIM2_Init();
|
||||
MX_TIM3_Init();
|
||||
MX_TIM4_Init();
|
||||
MX_TIM8_Init();
|
||||
|
||||
/* USER CODE BEGIN 2 */
|
||||
my_setup_2();
|
||||
@ -180,232 +161,6 @@ static void MX_SPI1_Init(void)
|
||||
|
||||
}
|
||||
|
||||
/* TIM1 init function */
|
||||
static void MX_TIM1_Init(void)
|
||||
{
|
||||
|
||||
TIM_ClockConfigTypeDef sClockSourceConfig;
|
||||
TIM_MasterConfigTypeDef sMasterConfig;
|
||||
TIM_BreakDeadTimeConfigTypeDef sBreakDeadTimeConfig;
|
||||
TIM_OC_InitTypeDef sConfigOC;
|
||||
|
||||
htim1.Instance = TIM1;
|
||||
htim1.Init.Prescaler = 0;
|
||||
htim1.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||
htim1.Init.Period = 0;
|
||||
htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
||||
htim1.Init.RepetitionCounter = 0;
|
||||
if (HAL_TIM_Base_Init(&htim1) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL;
|
||||
if (HAL_TIM_ConfigClockSource(&htim1, &sClockSourceConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
if (HAL_TIM_PWM_Init(&htim1) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
|
||||
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
|
||||
if (HAL_TIMEx_MasterConfigSynchronization(&htim1, &sMasterConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
sBreakDeadTimeConfig.OffStateRunMode = TIM_OSSR_DISABLE;
|
||||
sBreakDeadTimeConfig.OffStateIDLEMode = TIM_OSSI_DISABLE;
|
||||
sBreakDeadTimeConfig.LockLevel = TIM_LOCKLEVEL_OFF;
|
||||
sBreakDeadTimeConfig.DeadTime = 0;
|
||||
sBreakDeadTimeConfig.BreakState = TIM_BREAK_DISABLE;
|
||||
sBreakDeadTimeConfig.BreakPolarity = TIM_BREAKPOLARITY_HIGH;
|
||||
sBreakDeadTimeConfig.AutomaticOutput = TIM_AUTOMATICOUTPUT_DISABLE;
|
||||
if (HAL_TIMEx_ConfigBreakDeadTime(&htim1, &sBreakDeadTimeConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
sConfigOC.OCMode = TIM_OCMODE_PWM1;
|
||||
sConfigOC.Pulse = 0;
|
||||
sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH;
|
||||
sConfigOC.OCNPolarity = TIM_OCNPOLARITY_HIGH;
|
||||
sConfigOC.OCFastMode = TIM_OCFAST_DISABLE;
|
||||
sConfigOC.OCIdleState = TIM_OCIDLESTATE_RESET;
|
||||
sConfigOC.OCNIdleState = TIM_OCNIDLESTATE_RESET;
|
||||
if (HAL_TIM_PWM_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_1) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
if (HAL_TIM_PWM_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_2) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
if (HAL_TIM_PWM_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_3) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
if (HAL_TIM_PWM_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_4) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
HAL_TIM_MspPostInit(&htim1);
|
||||
|
||||
}
|
||||
|
||||
/* TIM2 init function */
|
||||
static void MX_TIM2_Init(void)
|
||||
{
|
||||
|
||||
TIM_SlaveConfigTypeDef sSlaveConfig;
|
||||
TIM_MasterConfigTypeDef sMasterConfig;
|
||||
|
||||
htim2.Instance = TIM2;
|
||||
htim2.Init.Prescaler = 0;
|
||||
htim2.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||
htim2.Init.Period = 0;
|
||||
htim2.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
||||
if (HAL_TIM_Base_Init(&htim2) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
sSlaveConfig.SlaveMode = TIM_SLAVEMODE_EXTERNAL1;
|
||||
sSlaveConfig.InputTrigger = TIM_TS_ETRF;
|
||||
sSlaveConfig.TriggerPolarity = TIM_TRIGGERPOLARITY_NONINVERTED;
|
||||
sSlaveConfig.TriggerPrescaler = TIM_TRIGGERPRESCALER_DIV1;
|
||||
sSlaveConfig.TriggerFilter = 0;
|
||||
if (HAL_TIM_SlaveConfigSynchronization(&htim2, &sSlaveConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
|
||||
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
|
||||
if (HAL_TIMEx_MasterConfigSynchronization(&htim2, &sMasterConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* TIM3 init function */
|
||||
static void MX_TIM3_Init(void)
|
||||
{
|
||||
|
||||
TIM_SlaveConfigTypeDef sSlaveConfig;
|
||||
TIM_MasterConfigTypeDef sMasterConfig;
|
||||
|
||||
htim3.Instance = TIM3;
|
||||
htim3.Init.Prescaler = 0;
|
||||
htim3.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||
htim3.Init.Period = 0;
|
||||
htim3.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
||||
if (HAL_TIM_Base_Init(&htim3) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
sSlaveConfig.SlaveMode = TIM_SLAVEMODE_EXTERNAL1;
|
||||
sSlaveConfig.InputTrigger = TIM_TS_ETRF;
|
||||
sSlaveConfig.TriggerPolarity = TIM_TRIGGERPOLARITY_NONINVERTED;
|
||||
sSlaveConfig.TriggerPrescaler = TIM_TRIGGERPRESCALER_DIV1;
|
||||
sSlaveConfig.TriggerFilter = 0;
|
||||
if (HAL_TIM_SlaveConfigSynchronization(&htim3, &sSlaveConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
|
||||
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
|
||||
if (HAL_TIMEx_MasterConfigSynchronization(&htim3, &sMasterConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* TIM4 init function */
|
||||
static void MX_TIM4_Init(void)
|
||||
{
|
||||
|
||||
TIM_SlaveConfigTypeDef sSlaveConfig;
|
||||
TIM_MasterConfigTypeDef sMasterConfig;
|
||||
|
||||
htim4.Instance = TIM4;
|
||||
htim4.Init.Prescaler = 0;
|
||||
htim4.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||
htim4.Init.Period = 0;
|
||||
htim4.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
||||
if (HAL_TIM_Base_Init(&htim4) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
sSlaveConfig.SlaveMode = TIM_SLAVEMODE_EXTERNAL1;
|
||||
sSlaveConfig.InputTrigger = TIM_TS_ETRF;
|
||||
sSlaveConfig.TriggerPolarity = TIM_TRIGGERPOLARITY_NONINVERTED;
|
||||
sSlaveConfig.TriggerPrescaler = TIM_TRIGGERPRESCALER_DIV1;
|
||||
sSlaveConfig.TriggerFilter = 0;
|
||||
if (HAL_TIM_SlaveConfigSynchronization(&htim4, &sSlaveConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
|
||||
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
|
||||
if (HAL_TIMEx_MasterConfigSynchronization(&htim4, &sMasterConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* TIM8 init function */
|
||||
static void MX_TIM8_Init(void)
|
||||
{
|
||||
|
||||
TIM_SlaveConfigTypeDef sSlaveConfig;
|
||||
TIM_MasterConfigTypeDef sMasterConfig;
|
||||
|
||||
htim8.Instance = TIM8;
|
||||
htim8.Init.Prescaler = 0;
|
||||
htim8.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||
htim8.Init.Period = 0;
|
||||
htim8.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
||||
htim8.Init.RepetitionCounter = 0;
|
||||
if (HAL_TIM_Base_Init(&htim8) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
sSlaveConfig.SlaveMode = TIM_SLAVEMODE_EXTERNAL1;
|
||||
sSlaveConfig.InputTrigger = TIM_TS_ETRF;
|
||||
sSlaveConfig.TriggerPolarity = TIM_TRIGGERPOLARITY_NONINVERTED;
|
||||
sSlaveConfig.TriggerPrescaler = TIM_TRIGGERPRESCALER_DIV1;
|
||||
sSlaveConfig.TriggerFilter = 0;
|
||||
if (HAL_TIM_SlaveConfigSynchronization(&htim8, &sSlaveConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
|
||||
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
|
||||
if (HAL_TIMEx_MasterConfigSynchronization(&htim8, &sMasterConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** Configure pins as
|
||||
* Analog
|
||||
* Input
|
||||
@ -421,17 +176,15 @@ static void MX_GPIO_Init(void)
|
||||
/* GPIO Ports Clock Enable */
|
||||
__HAL_RCC_GPIOC_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOA_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOE_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOD_CLK_ENABLE();
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOA, OLED_DC_Pin|OLED_RST_Pin|OLED_CS_Pin, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(GPIOA, OLED_DC_Pin|OLED_RST_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOE, MOT1_DIR_Pin|MOT2_DIR_Pin|MOT3_DIR_Pin|MOT4_DIR_Pin, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(OLED_CS_GPIO_Port, OLED_CS_Pin, GPIO_PIN_SET);
|
||||
|
||||
/*Configure GPIO pin : LED_Pin */
|
||||
GPIO_InitStruct.Pin = LED_Pin;
|
||||
@ -445,12 +198,6 @@ static void MX_GPIO_Init(void)
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : MOT1_DIR_Pin MOT2_DIR_Pin MOT3_DIR_Pin MOT4_DIR_Pin */
|
||||
GPIO_InitStruct.Pin = MOT1_DIR_Pin|MOT2_DIR_Pin|MOT3_DIR_Pin|MOT4_DIR_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
|
||||
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN 4 */
|
||||
|
257
src/main.c-bak
257
src/main.c-bak
@ -40,12 +40,6 @@
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
SPI_HandleTypeDef hspi1;
|
||||
|
||||
TIM_HandleTypeDef htim1;
|
||||
TIM_HandleTypeDef htim2;
|
||||
TIM_HandleTypeDef htim3;
|
||||
TIM_HandleTypeDef htim4;
|
||||
TIM_HandleTypeDef htim8;
|
||||
|
||||
/* USER CODE BEGIN PV */
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
|
||||
@ -56,14 +50,6 @@ void SystemClock_Config(void);
|
||||
void Error_Handler(void);
|
||||
static void MX_GPIO_Init(void);
|
||||
static void MX_SPI1_Init(void);
|
||||
static void MX_TIM1_Init(void);
|
||||
static void MX_TIM2_Init(void);
|
||||
static void MX_TIM3_Init(void);
|
||||
static void MX_TIM4_Init(void);
|
||||
static void MX_TIM8_Init(void);
|
||||
|
||||
void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);
|
||||
|
||||
|
||||
/* USER CODE BEGIN PFP */
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
@ -92,11 +78,6 @@ int main(void)
|
||||
/* Initialize all configured peripherals */
|
||||
MX_GPIO_Init();
|
||||
MX_SPI1_Init();
|
||||
MX_TIM1_Init();
|
||||
MX_TIM2_Init();
|
||||
MX_TIM3_Init();
|
||||
MX_TIM4_Init();
|
||||
MX_TIM8_Init();
|
||||
|
||||
/* USER CODE BEGIN 2 */
|
||||
|
||||
@ -176,232 +157,6 @@ static void MX_SPI1_Init(void)
|
||||
|
||||
}
|
||||
|
||||
/* TIM1 init function */
|
||||
static void MX_TIM1_Init(void)
|
||||
{
|
||||
|
||||
TIM_ClockConfigTypeDef sClockSourceConfig;
|
||||
TIM_MasterConfigTypeDef sMasterConfig;
|
||||
TIM_BreakDeadTimeConfigTypeDef sBreakDeadTimeConfig;
|
||||
TIM_OC_InitTypeDef sConfigOC;
|
||||
|
||||
htim1.Instance = TIM1;
|
||||
htim1.Init.Prescaler = 0;
|
||||
htim1.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||
htim1.Init.Period = 0;
|
||||
htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
||||
htim1.Init.RepetitionCounter = 0;
|
||||
if (HAL_TIM_Base_Init(&htim1) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL;
|
||||
if (HAL_TIM_ConfigClockSource(&htim1, &sClockSourceConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
if (HAL_TIM_PWM_Init(&htim1) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
|
||||
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
|
||||
if (HAL_TIMEx_MasterConfigSynchronization(&htim1, &sMasterConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
sBreakDeadTimeConfig.OffStateRunMode = TIM_OSSR_DISABLE;
|
||||
sBreakDeadTimeConfig.OffStateIDLEMode = TIM_OSSI_DISABLE;
|
||||
sBreakDeadTimeConfig.LockLevel = TIM_LOCKLEVEL_OFF;
|
||||
sBreakDeadTimeConfig.DeadTime = 0;
|
||||
sBreakDeadTimeConfig.BreakState = TIM_BREAK_DISABLE;
|
||||
sBreakDeadTimeConfig.BreakPolarity = TIM_BREAKPOLARITY_HIGH;
|
||||
sBreakDeadTimeConfig.AutomaticOutput = TIM_AUTOMATICOUTPUT_DISABLE;
|
||||
if (HAL_TIMEx_ConfigBreakDeadTime(&htim1, &sBreakDeadTimeConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
sConfigOC.OCMode = TIM_OCMODE_PWM1;
|
||||
sConfigOC.Pulse = 0;
|
||||
sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH;
|
||||
sConfigOC.OCNPolarity = TIM_OCNPOLARITY_HIGH;
|
||||
sConfigOC.OCFastMode = TIM_OCFAST_DISABLE;
|
||||
sConfigOC.OCIdleState = TIM_OCIDLESTATE_RESET;
|
||||
sConfigOC.OCNIdleState = TIM_OCNIDLESTATE_RESET;
|
||||
if (HAL_TIM_PWM_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_1) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
if (HAL_TIM_PWM_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_2) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
if (HAL_TIM_PWM_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_3) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
if (HAL_TIM_PWM_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_4) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
HAL_TIM_MspPostInit(&htim1);
|
||||
|
||||
}
|
||||
|
||||
/* TIM2 init function */
|
||||
static void MX_TIM2_Init(void)
|
||||
{
|
||||
|
||||
TIM_SlaveConfigTypeDef sSlaveConfig;
|
||||
TIM_MasterConfigTypeDef sMasterConfig;
|
||||
|
||||
htim2.Instance = TIM2;
|
||||
htim2.Init.Prescaler = 0;
|
||||
htim2.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||
htim2.Init.Period = 0;
|
||||
htim2.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
||||
if (HAL_TIM_Base_Init(&htim2) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
sSlaveConfig.SlaveMode = TIM_SLAVEMODE_EXTERNAL1;
|
||||
sSlaveConfig.InputTrigger = TIM_TS_ETRF;
|
||||
sSlaveConfig.TriggerPolarity = TIM_TRIGGERPOLARITY_NONINVERTED;
|
||||
sSlaveConfig.TriggerPrescaler = TIM_TRIGGERPRESCALER_DIV1;
|
||||
sSlaveConfig.TriggerFilter = 0;
|
||||
if (HAL_TIM_SlaveConfigSynchronization(&htim2, &sSlaveConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
|
||||
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
|
||||
if (HAL_TIMEx_MasterConfigSynchronization(&htim2, &sMasterConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* TIM3 init function */
|
||||
static void MX_TIM3_Init(void)
|
||||
{
|
||||
|
||||
TIM_SlaveConfigTypeDef sSlaveConfig;
|
||||
TIM_MasterConfigTypeDef sMasterConfig;
|
||||
|
||||
htim3.Instance = TIM3;
|
||||
htim3.Init.Prescaler = 0;
|
||||
htim3.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||
htim3.Init.Period = 0;
|
||||
htim3.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
||||
if (HAL_TIM_Base_Init(&htim3) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
sSlaveConfig.SlaveMode = TIM_SLAVEMODE_EXTERNAL1;
|
||||
sSlaveConfig.InputTrigger = TIM_TS_ETRF;
|
||||
sSlaveConfig.TriggerPolarity = TIM_TRIGGERPOLARITY_NONINVERTED;
|
||||
sSlaveConfig.TriggerPrescaler = TIM_TRIGGERPRESCALER_DIV1;
|
||||
sSlaveConfig.TriggerFilter = 0;
|
||||
if (HAL_TIM_SlaveConfigSynchronization(&htim3, &sSlaveConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
|
||||
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
|
||||
if (HAL_TIMEx_MasterConfigSynchronization(&htim3, &sMasterConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* TIM4 init function */
|
||||
static void MX_TIM4_Init(void)
|
||||
{
|
||||
|
||||
TIM_SlaveConfigTypeDef sSlaveConfig;
|
||||
TIM_MasterConfigTypeDef sMasterConfig;
|
||||
|
||||
htim4.Instance = TIM4;
|
||||
htim4.Init.Prescaler = 0;
|
||||
htim4.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||
htim4.Init.Period = 0;
|
||||
htim4.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
||||
if (HAL_TIM_Base_Init(&htim4) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
sSlaveConfig.SlaveMode = TIM_SLAVEMODE_EXTERNAL1;
|
||||
sSlaveConfig.InputTrigger = TIM_TS_ETRF;
|
||||
sSlaveConfig.TriggerPolarity = TIM_TRIGGERPOLARITY_NONINVERTED;
|
||||
sSlaveConfig.TriggerPrescaler = TIM_TRIGGERPRESCALER_DIV1;
|
||||
sSlaveConfig.TriggerFilter = 0;
|
||||
if (HAL_TIM_SlaveConfigSynchronization(&htim4, &sSlaveConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
|
||||
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
|
||||
if (HAL_TIMEx_MasterConfigSynchronization(&htim4, &sMasterConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* TIM8 init function */
|
||||
static void MX_TIM8_Init(void)
|
||||
{
|
||||
|
||||
TIM_SlaveConfigTypeDef sSlaveConfig;
|
||||
TIM_MasterConfigTypeDef sMasterConfig;
|
||||
|
||||
htim8.Instance = TIM8;
|
||||
htim8.Init.Prescaler = 0;
|
||||
htim8.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||
htim8.Init.Period = 0;
|
||||
htim8.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
||||
htim8.Init.RepetitionCounter = 0;
|
||||
if (HAL_TIM_Base_Init(&htim8) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
sSlaveConfig.SlaveMode = TIM_SLAVEMODE_EXTERNAL1;
|
||||
sSlaveConfig.InputTrigger = TIM_TS_ETRF;
|
||||
sSlaveConfig.TriggerPolarity = TIM_TRIGGERPOLARITY_NONINVERTED;
|
||||
sSlaveConfig.TriggerPrescaler = TIM_TRIGGERPRESCALER_DIV1;
|
||||
sSlaveConfig.TriggerFilter = 0;
|
||||
if (HAL_TIM_SlaveConfigSynchronization(&htim8, &sSlaveConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
|
||||
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
|
||||
if (HAL_TIMEx_MasterConfigSynchronization(&htim8, &sMasterConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** Configure pins as
|
||||
* Analog
|
||||
* Input
|
||||
@ -417,17 +172,15 @@ static void MX_GPIO_Init(void)
|
||||
/* GPIO Ports Clock Enable */
|
||||
__HAL_RCC_GPIOC_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOA_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOE_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOD_CLK_ENABLE();
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOA, OLED_DC_Pin|OLED_RST_Pin|OLED_CS_Pin, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(GPIOA, OLED_DC_Pin|OLED_RST_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOE, MOT1_DIR_Pin|MOT2_DIR_Pin|MOT3_DIR_Pin|MOT4_DIR_Pin, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(OLED_CS_GPIO_Port, OLED_CS_Pin, GPIO_PIN_SET);
|
||||
|
||||
/*Configure GPIO pin : LED_Pin */
|
||||
GPIO_InitStruct.Pin = LED_Pin;
|
||||
@ -441,12 +194,6 @@ static void MX_GPIO_Init(void)
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : MOT1_DIR_Pin MOT2_DIR_Pin MOT3_DIR_Pin MOT4_DIR_Pin */
|
||||
GPIO_InitStruct.Pin = MOT1_DIR_Pin|MOT2_DIR_Pin|MOT3_DIR_Pin|MOT4_DIR_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
|
||||
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN 4 */
|
||||
|
@ -136,221 +136,6 @@ void HAL_SPI_MspDeInit(SPI_HandleTypeDef* hspi)
|
||||
|
||||
}
|
||||
|
||||
void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* htim_base)
|
||||
{
|
||||
|
||||
GPIO_InitTypeDef GPIO_InitStruct;
|
||||
if(htim_base->Instance==TIM1)
|
||||
{
|
||||
/* USER CODE BEGIN TIM1_MspInit 0 */
|
||||
|
||||
/* USER CODE END TIM1_MspInit 0 */
|
||||
/* Peripheral clock enable */
|
||||
__HAL_RCC_TIM1_CLK_ENABLE();
|
||||
/* USER CODE BEGIN TIM1_MspInit 1 */
|
||||
|
||||
/* USER CODE END TIM1_MspInit 1 */
|
||||
}
|
||||
else if(htim_base->Instance==TIM2)
|
||||
{
|
||||
/* USER CODE BEGIN TIM2_MspInit 0 */
|
||||
|
||||
/* USER CODE END TIM2_MspInit 0 */
|
||||
/* Peripheral clock enable */
|
||||
__HAL_RCC_TIM2_CLK_ENABLE();
|
||||
|
||||
/**TIM2 GPIO Configuration
|
||||
PA15 ------> TIM2_ETR
|
||||
*/
|
||||
GPIO_InitStruct.Pin = MOT1_CNT_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(MOT1_CNT_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
__HAL_AFIO_REMAP_TIM2_PARTIAL_1();
|
||||
|
||||
/* USER CODE BEGIN TIM2_MspInit 1 */
|
||||
|
||||
/* USER CODE END TIM2_MspInit 1 */
|
||||
}
|
||||
else if(htim_base->Instance==TIM3)
|
||||
{
|
||||
/* USER CODE BEGIN TIM3_MspInit 0 */
|
||||
|
||||
/* USER CODE END TIM3_MspInit 0 */
|
||||
/* Peripheral clock enable */
|
||||
__HAL_RCC_TIM3_CLK_ENABLE();
|
||||
|
||||
/**TIM3 GPIO Configuration
|
||||
PD2 ------> TIM3_ETR
|
||||
*/
|
||||
GPIO_InitStruct.Pin = MOT2_CNT_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(MOT2_CNT_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/* USER CODE BEGIN TIM3_MspInit 1 */
|
||||
|
||||
/* USER CODE END TIM3_MspInit 1 */
|
||||
}
|
||||
else if(htim_base->Instance==TIM4)
|
||||
{
|
||||
/* USER CODE BEGIN TIM4_MspInit 0 */
|
||||
|
||||
/* USER CODE END TIM4_MspInit 0 */
|
||||
/* Peripheral clock enable */
|
||||
__HAL_RCC_TIM4_CLK_ENABLE();
|
||||
|
||||
/**TIM4 GPIO Configuration
|
||||
PE0 ------> TIM4_ETR
|
||||
*/
|
||||
GPIO_InitStruct.Pin = MOT3_CNT_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(MOT3_CNT_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/* USER CODE BEGIN TIM4_MspInit 1 */
|
||||
|
||||
/* USER CODE END TIM4_MspInit 1 */
|
||||
}
|
||||
else if(htim_base->Instance==TIM8)
|
||||
{
|
||||
/* USER CODE BEGIN TIM8_MspInit 0 */
|
||||
|
||||
/* USER CODE END TIM8_MspInit 0 */
|
||||
/* Peripheral clock enable */
|
||||
__HAL_RCC_TIM8_CLK_ENABLE();
|
||||
|
||||
/**TIM8 GPIO Configuration
|
||||
PA0-WKUP ------> TIM8_ETR
|
||||
*/
|
||||
GPIO_InitStruct.Pin = MOT4_CNT_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(MOT4_CNT_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/* USER CODE BEGIN TIM8_MspInit 1 */
|
||||
|
||||
/* USER CODE END TIM8_MspInit 1 */
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void HAL_TIM_MspPostInit(TIM_HandleTypeDef* htim)
|
||||
{
|
||||
|
||||
GPIO_InitTypeDef GPIO_InitStruct;
|
||||
if(htim->Instance==TIM1)
|
||||
{
|
||||
/* USER CODE BEGIN TIM1_MspPostInit 0 */
|
||||
|
||||
/* USER CODE END TIM1_MspPostInit 0 */
|
||||
|
||||
/**TIM1 GPIO Configuration
|
||||
PE9 ------> TIM1_CH1
|
||||
PE11 ------> TIM1_CH2
|
||||
PE13 ------> TIM1_CH3
|
||||
PE14 ------> TIM1_CH4
|
||||
*/
|
||||
GPIO_InitStruct.Pin = MOT1_PWM_Pin|MOT2_PWM_Pin|MOT3_PWM_Pin|MOT4_PWM_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
|
||||
|
||||
__HAL_AFIO_REMAP_TIM1_ENABLE();
|
||||
|
||||
/* USER CODE BEGIN TIM1_MspPostInit 1 */
|
||||
|
||||
/* USER CODE END TIM1_MspPostInit 1 */
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* htim_base)
|
||||
{
|
||||
|
||||
if(htim_base->Instance==TIM1)
|
||||
{
|
||||
/* USER CODE BEGIN TIM1_MspDeInit 0 */
|
||||
|
||||
/* USER CODE END TIM1_MspDeInit 0 */
|
||||
/* Peripheral clock disable */
|
||||
__HAL_RCC_TIM1_CLK_DISABLE();
|
||||
/* USER CODE BEGIN TIM1_MspDeInit 1 */
|
||||
|
||||
/* USER CODE END TIM1_MspDeInit 1 */
|
||||
}
|
||||
else if(htim_base->Instance==TIM2)
|
||||
{
|
||||
/* USER CODE BEGIN TIM2_MspDeInit 0 */
|
||||
|
||||
/* USER CODE END TIM2_MspDeInit 0 */
|
||||
/* Peripheral clock disable */
|
||||
__HAL_RCC_TIM2_CLK_DISABLE();
|
||||
|
||||
/**TIM2 GPIO Configuration
|
||||
PA15 ------> TIM2_ETR
|
||||
*/
|
||||
HAL_GPIO_DeInit(MOT1_CNT_GPIO_Port, MOT1_CNT_Pin);
|
||||
|
||||
/* USER CODE BEGIN TIM2_MspDeInit 1 */
|
||||
|
||||
/* USER CODE END TIM2_MspDeInit 1 */
|
||||
}
|
||||
else if(htim_base->Instance==TIM3)
|
||||
{
|
||||
/* USER CODE BEGIN TIM3_MspDeInit 0 */
|
||||
|
||||
/* USER CODE END TIM3_MspDeInit 0 */
|
||||
/* Peripheral clock disable */
|
||||
__HAL_RCC_TIM3_CLK_DISABLE();
|
||||
|
||||
/**TIM3 GPIO Configuration
|
||||
PD2 ------> TIM3_ETR
|
||||
*/
|
||||
HAL_GPIO_DeInit(MOT2_CNT_GPIO_Port, MOT2_CNT_Pin);
|
||||
|
||||
/* USER CODE BEGIN TIM3_MspDeInit 1 */
|
||||
|
||||
/* USER CODE END TIM3_MspDeInit 1 */
|
||||
}
|
||||
else if(htim_base->Instance==TIM4)
|
||||
{
|
||||
/* USER CODE BEGIN TIM4_MspDeInit 0 */
|
||||
|
||||
/* USER CODE END TIM4_MspDeInit 0 */
|
||||
/* Peripheral clock disable */
|
||||
__HAL_RCC_TIM4_CLK_DISABLE();
|
||||
|
||||
/**TIM4 GPIO Configuration
|
||||
PE0 ------> TIM4_ETR
|
||||
*/
|
||||
HAL_GPIO_DeInit(MOT3_CNT_GPIO_Port, MOT3_CNT_Pin);
|
||||
|
||||
/* USER CODE BEGIN TIM4_MspDeInit 1 */
|
||||
|
||||
/* USER CODE END TIM4_MspDeInit 1 */
|
||||
}
|
||||
else if(htim_base->Instance==TIM8)
|
||||
{
|
||||
/* USER CODE BEGIN TIM8_MspDeInit 0 */
|
||||
|
||||
/* USER CODE END TIM8_MspDeInit 0 */
|
||||
/* Peripheral clock disable */
|
||||
__HAL_RCC_TIM8_CLK_DISABLE();
|
||||
|
||||
/**TIM8 GPIO Configuration
|
||||
PA0-WKUP ------> TIM8_ETR
|
||||
*/
|
||||
HAL_GPIO_DeInit(MOT4_CNT_GPIO_Port, MOT4_CNT_Pin);
|
||||
|
||||
/* USER CODE BEGIN TIM8_MspDeInit 1 */
|
||||
|
||||
/* USER CODE END TIM8_MspDeInit 1 */
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN 1 */
|
||||
|
||||
/* USER CODE END 1 */
|
||||
|
Reference in New Issue
Block a user