mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-05-31 03:38:02 +08:00
add i2c,timer,pwm support
ToolsCI / Tools (push) Has been cancelled
RT-Thread BSP Static Build Check / 🔍 Summary of Git Diff Changes (push) Has been cancelled
pkgs_test / change (push) Has been cancelled
utest_auto_run / A9 :components/dfs.cfg (push) Has been cancelled
utest_auto_run / A9 :components/lwip.cfg (push) Has been cancelled
utest_auto_run / A9 :components/netdev.cfg (push) Has been cancelled
utest_auto_run / A9 :components/sal.cfg (push) Has been cancelled
utest_auto_run / A9 :cpp11/cpp11.cfg (push) Has been cancelled
utest_auto_run / AARCH64-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / A9-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / RISCV-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / XUANTIE-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / AARCH64 :default.cfg (push) Has been cancelled
utest_auto_run / AARCH64-smp :default.cfg (push) Has been cancelled
utest_auto_run / A9 :default.cfg (push) Has been cancelled
utest_auto_run / A9-smp :default.cfg (push) Has been cancelled
utest_auto_run / RISCV :default.cfg (push) Has been cancelled
utest_auto_run / RISCV-smp :default.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/atomic_c11.cfg (push) Has been cancelled
utest_auto_run / RISCV :kernel/atomic_c11.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/ipc.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/kernel_basic.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/mem.cfg (push) Has been cancelled
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (push) Has been cancelled
RT-Thread BSP Static Build Check / collect-artifacts (push) Has been cancelled
Weekly CI Scheduler / Trigger and Monitor CIs (push) Has been cancelled
Weekly CI Scheduler / Create Discussion Report (push) Has been cancelled
doc_doxygen / doxygen_doc generate (push) Has been cancelled
doc_doxygen / deploy (push) Has been cancelled
manual_trigger_update_all / update and create pull request (push) Has been cancelled
manual_trigger_scons_build_all / ${{ github.event.inputs.bsp_options }} (push) Has been cancelled
ToolsCI / Tools (push) Has been cancelled
RT-Thread BSP Static Build Check / 🔍 Summary of Git Diff Changes (push) Has been cancelled
pkgs_test / change (push) Has been cancelled
utest_auto_run / A9 :components/dfs.cfg (push) Has been cancelled
utest_auto_run / A9 :components/lwip.cfg (push) Has been cancelled
utest_auto_run / A9 :components/netdev.cfg (push) Has been cancelled
utest_auto_run / A9 :components/sal.cfg (push) Has been cancelled
utest_auto_run / A9 :cpp11/cpp11.cfg (push) Has been cancelled
utest_auto_run / AARCH64-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / A9-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / RISCV-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / XUANTIE-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / AARCH64 :default.cfg (push) Has been cancelled
utest_auto_run / AARCH64-smp :default.cfg (push) Has been cancelled
utest_auto_run / A9 :default.cfg (push) Has been cancelled
utest_auto_run / A9-smp :default.cfg (push) Has been cancelled
utest_auto_run / RISCV :default.cfg (push) Has been cancelled
utest_auto_run / RISCV-smp :default.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/atomic_c11.cfg (push) Has been cancelled
utest_auto_run / RISCV :kernel/atomic_c11.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/ipc.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/kernel_basic.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/mem.cfg (push) Has been cancelled
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (push) Has been cancelled
RT-Thread BSP Static Build Check / collect-artifacts (push) Has been cancelled
Weekly CI Scheduler / Trigger and Monitor CIs (push) Has been cancelled
Weekly CI Scheduler / Create Discussion Report (push) Has been cancelled
doc_doxygen / doxygen_doc generate (push) Has been cancelled
doc_doxygen / deploy (push) Has been cancelled
manual_trigger_update_all / update and create pull request (push) Has been cancelled
manual_trigger_scons_build_all / ${{ github.event.inputs.bsp_options }} (push) Has been cancelled
revise the README.md
This commit is contained in:
@@ -89,6 +89,7 @@ This document is based on the RT-Thread mainline repository and categorizes the
|
|||||||
| [stm32f407-atk-explorer](stm32/stm32f407-atk-explorer) | ✅ | ✅ | ✅ | ✅ | ✅ | - | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - | - | ✅ | - | ✅ | ✅ | - | ✅ | - | - | - | - | ✅ | - | ✅ |
|
| [stm32f407-atk-explorer](stm32/stm32f407-atk-explorer) | ✅ | ✅ | ✅ | ✅ | ✅ | - | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - | - | ✅ | - | ✅ | ✅ | - | ✅ | - | - | - | - | ✅ | - | ✅ |
|
||||||
| [stm32f407-fk407m2-zgt6](stm32/stm32f407-fk407m2-zgt6) | ✅ | ✅ | ✅ | - | ✅ | - | - | ✅ | ✅ | ✅ | ✅ | ✅ | - | ✅ | ✅ | - | ✅ | - | - | ✅ | - | - | - | - | ✅ | - | ✅ |
|
| [stm32f407-fk407m2-zgt6](stm32/stm32f407-fk407m2-zgt6) | ✅ | ✅ | ✅ | - | ✅ | - | - | ✅ | ✅ | ✅ | ✅ | ✅ | - | ✅ | ✅ | - | ✅ | - | - | ✅ | - | - | - | - | ✅ | - | ✅ |
|
||||||
| [stm32f407-lckfb-skystar](stm32/stm32f407-lckfb-skystar) | ✅ | ✅ | ✅ | - | ✅ | - | - | ✅ | ✅ | ✅ | ✅ | ✅ | - | ✅ | ✅ | - | ✅ | - | - | ✅ | - | - | - | ✅ | ✅ | - | - |
|
| [stm32f407-lckfb-skystar](stm32/stm32f407-lckfb-skystar) | ✅ | ✅ | ✅ | - | ✅ | - | - | ✅ | ✅ | ✅ | ✅ | ✅ | - | ✅ | ✅ | - | ✅ | - | - | ✅ | - | - | - | ✅ | ✅ | - | - |
|
||||||
|
| [stm32f407-micu](stm32/stm32f407-micu) | ✅ | ✅ | - | - | - | - | - | ✅ | ✅ | ✅ | ✅ | ✅ | - | ✅ | ✅ | - | - | - | - | - |
|
||||||
| [stm32f407-robomaster-c](stm32/stm32f407-robomaster-c) | ✅ | ✅ | ✅ | ✅ | - | - | - | - | ✅ | ✅ | - | ✅ | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - |
|
| [stm32f407-robomaster-c](stm32/stm32f407-robomaster-c) | ✅ | ✅ | ✅ | ✅ | - | - | - | - | ✅ | ✅ | - | ✅ | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - |
|
||||||
| [stm32f407-rt-spark](stm32/stm32f407-rt-spark) | ✅ | ✅ | ✅ | ✅ | ✅ | - | - | ✅ | ✅ | ✅ | ✅ | ✅ | - | ✅ | ✅ | - | ✅ | ✅ | - | ✅ | - | - | - | ✅ | ✅ | - | ✅ |
|
| [stm32f407-rt-spark](stm32/stm32f407-rt-spark) | ✅ | ✅ | ✅ | ✅ | ✅ | - | - | ✅ | ✅ | ✅ | ✅ | ✅ | - | ✅ | ✅ | - | ✅ | ✅ | - | ✅ | - | - | - | ✅ | ✅ | - | ✅ |
|
||||||
| [stm32f407-st-discovery](stm32/stm32f407-st-discovery) | ✅ | ✅ | - | - | - | - | - | - | ✅ | - | - | ✅ | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - |
|
| [stm32f407-st-discovery](stm32/stm32f407-st-discovery) | ✅ | ✅ | - | - | - | - | - | - | ✅ | - | - | ✅ | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - |
|
||||||
|
|||||||
@@ -9,26 +9,46 @@ Mcu.CPN=STM32F407VET6
|
|||||||
Mcu.Family=STM32F4
|
Mcu.Family=STM32F4
|
||||||
Mcu.IP0=NVIC
|
Mcu.IP0=NVIC
|
||||||
Mcu.IP1=RCC
|
Mcu.IP1=RCC
|
||||||
Mcu.IP2=SPI1
|
Mcu.IP2=RTC
|
||||||
Mcu.IP3=SYS
|
Mcu.IP3=SDIO
|
||||||
Mcu.IP4=USART1
|
Mcu.IP4=SPI1
|
||||||
Mcu.IPNb=5
|
Mcu.IP5=SYS
|
||||||
|
Mcu.IP6=TIM1
|
||||||
|
Mcu.IP7=TIM3
|
||||||
|
Mcu.IP8=TIM4
|
||||||
|
Mcu.IP9=USART1
|
||||||
|
Mcu.IPNb=10
|
||||||
Mcu.Name=STM32F407V(E-G)Tx
|
Mcu.Name=STM32F407V(E-G)Tx
|
||||||
Mcu.Package=LQFP100
|
Mcu.Package=LQFP100
|
||||||
Mcu.Pin0=PC14-OSC32_IN
|
Mcu.Pin0=PC14-OSC32_IN
|
||||||
Mcu.Pin1=PC15-OSC32_OUT
|
Mcu.Pin1=PC15-OSC32_OUT
|
||||||
Mcu.Pin10=PA13
|
Mcu.Pin10=PE13
|
||||||
Mcu.Pin11=PA14
|
Mcu.Pin11=PE14
|
||||||
Mcu.Pin12=VP_SYS_VS_Systick
|
Mcu.Pin12=PD12
|
||||||
|
Mcu.Pin13=PD13
|
||||||
|
Mcu.Pin14=PC8
|
||||||
|
Mcu.Pin15=PC9
|
||||||
|
Mcu.Pin16=PA9
|
||||||
|
Mcu.Pin17=PA10
|
||||||
|
Mcu.Pin18=PA13
|
||||||
|
Mcu.Pin19=PA14
|
||||||
Mcu.Pin2=PH0-OSC_IN
|
Mcu.Pin2=PH0-OSC_IN
|
||||||
|
Mcu.Pin20=PC10
|
||||||
|
Mcu.Pin21=PC11
|
||||||
|
Mcu.Pin22=PC12
|
||||||
|
Mcu.Pin23=PD2
|
||||||
|
Mcu.Pin24=PB4
|
||||||
|
Mcu.Pin25=PB5
|
||||||
|
Mcu.Pin26=VP_RTC_VS_RTC_Activate
|
||||||
|
Mcu.Pin27=VP_SYS_VS_Systick
|
||||||
Mcu.Pin3=PH1-OSC_OUT
|
Mcu.Pin3=PH1-OSC_OUT
|
||||||
Mcu.Pin4=PA4
|
Mcu.Pin4=PA4
|
||||||
Mcu.Pin5=PA5
|
Mcu.Pin5=PA5
|
||||||
Mcu.Pin6=PA6
|
Mcu.Pin6=PA6
|
||||||
Mcu.Pin7=PA7
|
Mcu.Pin7=PA7
|
||||||
Mcu.Pin8=PA9
|
Mcu.Pin8=PE9
|
||||||
Mcu.Pin9=PA10
|
Mcu.Pin9=PE11
|
||||||
Mcu.PinsNb=13
|
Mcu.PinsNb=28
|
||||||
Mcu.ThirdPartyNb=0
|
Mcu.ThirdPartyNb=0
|
||||||
Mcu.UserConstants=
|
Mcu.UserConstants=
|
||||||
Mcu.UserName=STM32F407VETx
|
Mcu.UserName=STM32F407VETx
|
||||||
@@ -63,10 +83,32 @@ PA7.Mode=Full_Duplex_Master
|
|||||||
PA7.Signal=SPI1_MOSI
|
PA7.Signal=SPI1_MOSI
|
||||||
PA9.Mode=Asynchronous
|
PA9.Mode=Asynchronous
|
||||||
PA9.Signal=USART1_TX
|
PA9.Signal=USART1_TX
|
||||||
|
PB4.Locked=true
|
||||||
|
PB4.Signal=S_TIM3_CH1
|
||||||
|
PB5.Locked=true
|
||||||
|
PB5.Signal=S_TIM3_CH2
|
||||||
|
PC10.Mode=SD_4_bits_Wide_bus
|
||||||
|
PC10.Signal=SDIO_D2
|
||||||
|
PC11.Mode=SD_4_bits_Wide_bus
|
||||||
|
PC11.Signal=SDIO_D3
|
||||||
|
PC12.Mode=SD_4_bits_Wide_bus
|
||||||
|
PC12.Signal=SDIO_CK
|
||||||
PC14-OSC32_IN.Mode=LSE-External-Oscillator
|
PC14-OSC32_IN.Mode=LSE-External-Oscillator
|
||||||
PC14-OSC32_IN.Signal=RCC_OSC32_IN
|
PC14-OSC32_IN.Signal=RCC_OSC32_IN
|
||||||
PC15-OSC32_OUT.Mode=LSE-External-Oscillator
|
PC15-OSC32_OUT.Mode=LSE-External-Oscillator
|
||||||
PC15-OSC32_OUT.Signal=RCC_OSC32_OUT
|
PC15-OSC32_OUT.Signal=RCC_OSC32_OUT
|
||||||
|
PC8.Mode=SD_4_bits_Wide_bus
|
||||||
|
PC8.Signal=SDIO_D0
|
||||||
|
PC9.Mode=SD_4_bits_Wide_bus
|
||||||
|
PC9.Signal=SDIO_D1
|
||||||
|
PD12.Signal=S_TIM4_CH1
|
||||||
|
PD13.Signal=S_TIM4_CH2
|
||||||
|
PD2.Mode=SD_4_bits_Wide_bus
|
||||||
|
PD2.Signal=SDIO_CMD
|
||||||
|
PE11.Signal=S_TIM1_CH2
|
||||||
|
PE13.Signal=S_TIM1_CH3
|
||||||
|
PE14.Signal=S_TIM1_CH4
|
||||||
|
PE9.Signal=S_TIM1_CH1
|
||||||
PH0-OSC_IN.Mode=HSE-External-Oscillator
|
PH0-OSC_IN.Mode=HSE-External-Oscillator
|
||||||
PH0-OSC_IN.Signal=RCC_OSC_IN
|
PH0-OSC_IN.Signal=RCC_OSC_IN
|
||||||
PH1-OSC_OUT.Mode=HSE-External-Oscillator
|
PH1-OSC_OUT.Mode=HSE-External-Oscillator
|
||||||
@@ -103,8 +145,8 @@ ProjectManager.ToolChainLocation=
|
|||||||
ProjectManager.UAScriptAfterPath=
|
ProjectManager.UAScriptAfterPath=
|
||||||
ProjectManager.UAScriptBeforePath=
|
ProjectManager.UAScriptBeforePath=
|
||||||
ProjectManager.UnderRoot=false
|
ProjectManager.UnderRoot=false
|
||||||
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_USART1_UART_Init-USART1-false-HAL-true,4-MX_SPI1_Init-SPI1-false-HAL-true,5-MX_RTC_Init-RTC-false-HAL-true,6-MX_SDIO_MMC_Init-SDIO-false-HAL-true,7-MX_TIM1_Init-TIM1-false-HAL-true,8-MX_TIM3_Init-TIM3-false-HAL-true,9-MX_TIM4_Init-TIM4-false-HAL-true
|
||||||
RCC.48MHZClocksFreq_Value=84000000
|
RCC.48MHZClocksFreq_Value=48000000
|
||||||
RCC.AHBFreq_Value=168000000
|
RCC.AHBFreq_Value=168000000
|
||||||
RCC.APB1CLKDivider=RCC_HCLK_DIV4
|
RCC.APB1CLKDivider=RCC_HCLK_DIV4
|
||||||
RCC.APB1Freq_Value=42000000
|
RCC.APB1Freq_Value=42000000
|
||||||
@@ -120,14 +162,17 @@ RCC.HCLKFreq_Value=168000000
|
|||||||
RCC.HSE_VALUE=8000000
|
RCC.HSE_VALUE=8000000
|
||||||
RCC.HSI_VALUE=16000000
|
RCC.HSI_VALUE=16000000
|
||||||
RCC.I2SClocksFreq_Value=192000000
|
RCC.I2SClocksFreq_Value=192000000
|
||||||
RCC.IPParameters=48MHZClocksFreq_Value,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2CLKDivider,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,EthernetFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI_VALUE,I2SClocksFreq_Value,LSI_VALUE,MCO2PinFreq_Value,PLLCLKFreq_Value,PLLM,PLLN,PLLQCLKFreq_Value,RTCFreq_Value,RTCHSEDivFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,VCOI2SOutputFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VcooutputI2S
|
RCC.IPParameters=48MHZClocksFreq_Value,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2CLKDivider,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,EthernetFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI_VALUE,I2SClocksFreq_Value,LSI_VALUE,MCO2PinFreq_Value,PLLCLKFreq_Value,PLLM,PLLN,PLLQ,PLLQCLKFreq_Value,PLLSourceVirtual,RCC_RTC_Clock_Source,RTCFreq_Value,RTCHSEDivFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,VCOI2SOutputFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VcooutputI2S
|
||||||
RCC.LSI_VALUE=32000
|
RCC.LSI_VALUE=32000
|
||||||
RCC.MCO2PinFreq_Value=168000000
|
RCC.MCO2PinFreq_Value=168000000
|
||||||
RCC.PLLCLKFreq_Value=168000000
|
RCC.PLLCLKFreq_Value=168000000
|
||||||
RCC.PLLM=8
|
RCC.PLLM=4
|
||||||
RCC.PLLN=168
|
RCC.PLLN=168
|
||||||
RCC.PLLQCLKFreq_Value=84000000
|
RCC.PLLQ=7
|
||||||
RCC.RTCFreq_Value=32000
|
RCC.PLLQCLKFreq_Value=48000000
|
||||||
|
RCC.PLLSourceVirtual=RCC_PLLSOURCE_HSE
|
||||||
|
RCC.RCC_RTC_Clock_Source=RCC_RTCCLKSOURCE_LSE
|
||||||
|
RCC.RTCFreq_Value=32768
|
||||||
RCC.RTCHSEDivFreq_Value=4000000
|
RCC.RTCHSEDivFreq_Value=4000000
|
||||||
RCC.SYSCLKFreq_VALUE=168000000
|
RCC.SYSCLKFreq_VALUE=168000000
|
||||||
RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK
|
RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK
|
||||||
@@ -135,13 +180,42 @@ RCC.VCOI2SOutputFreq_Value=384000000
|
|||||||
RCC.VCOInputFreq_Value=2000000
|
RCC.VCOInputFreq_Value=2000000
|
||||||
RCC.VCOOutputFreq_Value=336000000
|
RCC.VCOOutputFreq_Value=336000000
|
||||||
RCC.VcooutputI2S=192000000
|
RCC.VcooutputI2S=192000000
|
||||||
|
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_TIM3_CH1.0=TIM3_CH1,PWM Generation1 CH1
|
||||||
|
SH.S_TIM3_CH1.ConfNb=1
|
||||||
|
SH.S_TIM3_CH2.0=TIM3_CH2,PWM Generation2 CH2
|
||||||
|
SH.S_TIM3_CH2.ConfNb=1
|
||||||
|
SH.S_TIM4_CH1.0=TIM4_CH1,PWM Generation1 CH1
|
||||||
|
SH.S_TIM4_CH1.ConfNb=1
|
||||||
|
SH.S_TIM4_CH2.0=TIM4_CH2,PWM Generation2 CH2
|
||||||
|
SH.S_TIM4_CH2.ConfNb=1
|
||||||
SPI1.CalculateBaudRate=42.0 MBits/s
|
SPI1.CalculateBaudRate=42.0 MBits/s
|
||||||
SPI1.Direction=SPI_DIRECTION_2LINES
|
SPI1.Direction=SPI_DIRECTION_2LINES
|
||||||
SPI1.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate
|
SPI1.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate
|
||||||
SPI1.Mode=SPI_MODE_MASTER
|
SPI1.Mode=SPI_MODE_MASTER
|
||||||
SPI1.VirtualType=VM_MASTER
|
SPI1.VirtualType=VM_MASTER
|
||||||
|
TIM1.Channel-PWM\ Generation1\ CH1=TIM_CHANNEL_1
|
||||||
|
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 Generation1 CH1,Channel-PWM Generation2 CH2,Channel-PWM Generation3 CH3,Channel-PWM Generation4 CH4
|
||||||
|
TIM3.Channel-PWM\ Generation1\ CH1=TIM_CHANNEL_1
|
||||||
|
TIM3.Channel-PWM\ Generation2\ CH2=TIM_CHANNEL_2
|
||||||
|
TIM3.IPParameters=Channel-PWM Generation1 CH1,Channel-PWM Generation2 CH2
|
||||||
|
TIM4.Channel-PWM\ Generation1\ CH1=TIM_CHANNEL_1
|
||||||
|
TIM4.Channel-PWM\ Generation2\ CH2=TIM_CHANNEL_2
|
||||||
|
TIM4.IPParameters=Channel-PWM Generation1 CH1,Channel-PWM Generation2 CH2
|
||||||
USART1.IPParameters=VirtualMode
|
USART1.IPParameters=VirtualMode
|
||||||
USART1.VirtualMode=VM_ASYNC
|
USART1.VirtualMode=VM_ASYNC
|
||||||
|
VP_RTC_VS_RTC_Activate.Mode=RTC_Enabled
|
||||||
|
VP_RTC_VS_RTC_Activate.Signal=RTC_VS_RTC_Activate
|
||||||
VP_SYS_VS_Systick.Mode=SysTick
|
VP_SYS_VS_Systick.Mode=SysTick
|
||||||
VP_SYS_VS_Systick.Signal=SYS_VS_Systick
|
VP_SYS_VS_Systick.Signal=SYS_VS_Systick
|
||||||
board=custom
|
board=custom
|
||||||
|
|||||||
@@ -63,7 +63,7 @@
|
|||||||
#define HAL_SD_MODULE_ENABLED
|
#define HAL_SD_MODULE_ENABLED
|
||||||
/* #define HAL_MMC_MODULE_ENABLED */
|
/* #define HAL_MMC_MODULE_ENABLED */
|
||||||
#define HAL_SPI_MODULE_ENABLED
|
#define HAL_SPI_MODULE_ENABLED
|
||||||
/* #define HAL_TIM_MODULE_ENABLED */
|
#define HAL_TIM_MODULE_ENABLED
|
||||||
#define HAL_UART_MODULE_ENABLED
|
#define HAL_UART_MODULE_ENABLED
|
||||||
/* #define HAL_USART_MODULE_ENABLED */
|
/* #define HAL_USART_MODULE_ENABLED */
|
||||||
/* #define HAL_IRDA_MODULE_ENABLED */
|
/* #define HAL_IRDA_MODULE_ENABLED */
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
/* Includes ------------------------------------------------------------------*/
|
/* Includes ------------------------------------------------------------------*/
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
/* USER CODE BEGIN Includes */
|
/* USER CODE BEGIN Includes */
|
||||||
|
#include <drv_common.h>
|
||||||
/* USER CODE END Includes */
|
/* USER CODE END Includes */
|
||||||
|
|
||||||
/* Private typedef -----------------------------------------------------------*/
|
/* Private typedef -----------------------------------------------------------*/
|
||||||
@@ -57,6 +57,8 @@
|
|||||||
/* USER CODE BEGIN 0 */
|
/* USER CODE BEGIN 0 */
|
||||||
|
|
||||||
/* USER CODE END 0 */
|
/* USER CODE END 0 */
|
||||||
|
|
||||||
|
void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);
|
||||||
/**
|
/**
|
||||||
* Initializes the Global MSP.
|
* Initializes the Global MSP.
|
||||||
*/
|
*/
|
||||||
@@ -77,6 +79,148 @@ void HAL_MspInit(void)
|
|||||||
/* USER CODE END MspInit 1 */
|
/* USER CODE END MspInit 1 */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief RTC MSP Initialization
|
||||||
|
* This function configures the hardware resources used in this example
|
||||||
|
* @param hrtc: RTC handle pointer
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void HAL_RTC_MspInit(RTC_HandleTypeDef* hrtc)
|
||||||
|
{
|
||||||
|
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
|
||||||
|
if (hrtc->Instance == RTC)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN RTC_MspInit 0 */
|
||||||
|
|
||||||
|
/* USER CODE END RTC_MspInit 0 */
|
||||||
|
|
||||||
|
/** Initializes the peripherals clock
|
||||||
|
*/
|
||||||
|
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_RTC;
|
||||||
|
PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
|
||||||
|
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
|
||||||
|
{
|
||||||
|
Error_Handler();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Peripheral clock enable */
|
||||||
|
__HAL_RCC_RTC_ENABLE();
|
||||||
|
/* USER CODE BEGIN RTC_MspInit 1 */
|
||||||
|
|
||||||
|
/* USER CODE END RTC_MspInit 1 */
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief RTC MSP De-Initialization
|
||||||
|
* This function freeze the hardware resources used in this example
|
||||||
|
* @param hrtc: RTC handle pointer
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void HAL_RTC_MspDeInit(RTC_HandleTypeDef* hrtc)
|
||||||
|
{
|
||||||
|
if (hrtc->Instance == RTC)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN RTC_MspDeInit 0 */
|
||||||
|
|
||||||
|
/* USER CODE END RTC_MspDeInit 0 */
|
||||||
|
/* Peripheral clock disable */
|
||||||
|
__HAL_RCC_RTC_DISABLE();
|
||||||
|
/* USER CODE BEGIN RTC_MspDeInit 1 */
|
||||||
|
|
||||||
|
/* USER CODE END RTC_MspDeInit 1 */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief SD MSP Initialization
|
||||||
|
* This function configures the hardware resources used in this example
|
||||||
|
* @param hsd: SD handle pointer
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void HAL_SD_MspInit(SD_HandleTypeDef* hsd)
|
||||||
|
{
|
||||||
|
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
||||||
|
if (hsd->Instance == SDIO)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN SDIO_MspInit 0 */
|
||||||
|
|
||||||
|
/* USER CODE END SDIO_MspInit 0 */
|
||||||
|
/* Peripheral clock enable */
|
||||||
|
__HAL_RCC_SDIO_CLK_ENABLE();
|
||||||
|
|
||||||
|
__HAL_RCC_GPIOC_CLK_ENABLE();
|
||||||
|
__HAL_RCC_GPIOD_CLK_ENABLE();
|
||||||
|
/**SDIO GPIO Configuration
|
||||||
|
PC8 ------> SDIO_D0
|
||||||
|
PC9 ------> SDIO_D1
|
||||||
|
PC10 ------> SDIO_D2
|
||||||
|
PC11 ------> SDIO_D3
|
||||||
|
PC12 ------> SDIO_CK
|
||||||
|
PD2 ------> SDIO_CMD
|
||||||
|
*/
|
||||||
|
GPIO_InitStruct.Pin = GPIO_PIN_8 | GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11
|
||||||
|
| GPIO_PIN_12;
|
||||||
|
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||||
|
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||||
|
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||||
|
GPIO_InitStruct.Alternate = GPIO_AF12_SDIO;
|
||||||
|
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
|
||||||
|
|
||||||
|
GPIO_InitStruct.Pin = GPIO_PIN_2;
|
||||||
|
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||||
|
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||||
|
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||||
|
GPIO_InitStruct.Alternate = GPIO_AF12_SDIO;
|
||||||
|
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
|
||||||
|
|
||||||
|
/* USER CODE BEGIN SDIO_MspInit 1 */
|
||||||
|
|
||||||
|
/* USER CODE END SDIO_MspInit 1 */
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief SD MSP De-Initialization
|
||||||
|
* This function freeze the hardware resources used in this example
|
||||||
|
* @param hsd: SD handle pointer
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void HAL_SD_MspDeInit(SD_HandleTypeDef* hsd)
|
||||||
|
{
|
||||||
|
if (hsd->Instance == SDIO)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN SDIO_MspDeInit 0 */
|
||||||
|
|
||||||
|
/* USER CODE END SDIO_MspDeInit 0 */
|
||||||
|
/* Peripheral clock disable */
|
||||||
|
__HAL_RCC_SDIO_CLK_DISABLE();
|
||||||
|
|
||||||
|
/**SDIO GPIO Configuration
|
||||||
|
PC8 ------> SDIO_D0
|
||||||
|
PC9 ------> SDIO_D1
|
||||||
|
PC10 ------> SDIO_D2
|
||||||
|
PC11 ------> SDIO_D3
|
||||||
|
PC12 ------> SDIO_CK
|
||||||
|
PD2 ------> SDIO_CMD
|
||||||
|
*/
|
||||||
|
HAL_GPIO_DeInit(GPIOC, GPIO_PIN_8 | GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11
|
||||||
|
| GPIO_PIN_12);
|
||||||
|
|
||||||
|
HAL_GPIO_DeInit(GPIOD, GPIO_PIN_2);
|
||||||
|
|
||||||
|
/* USER CODE BEGIN SDIO_MspDeInit 1 */
|
||||||
|
|
||||||
|
/* USER CODE END SDIO_MspDeInit 1 */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief SPI MSP Initialization
|
* @brief SPI MSP Initialization
|
||||||
* This function configures the hardware resources used in this example
|
* This function configures the hardware resources used in this example
|
||||||
@@ -145,6 +289,166 @@ void HAL_SPI_MspDeInit(SPI_HandleTypeDef* hspi)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief TIM_PWM MSP Initialization
|
||||||
|
* This function configures the hardware resources used in this example
|
||||||
|
* @param htim_pwm: TIM_PWM handle pointer
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void HAL_TIM_PWM_MspInit(TIM_HandleTypeDef* htim_pwm)
|
||||||
|
{
|
||||||
|
if (htim_pwm->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_pwm->Instance == TIM3)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN TIM3_MspInit 0 */
|
||||||
|
|
||||||
|
/* USER CODE END TIM3_MspInit 0 */
|
||||||
|
/* Peripheral clock enable */
|
||||||
|
__HAL_RCC_TIM3_CLK_ENABLE();
|
||||||
|
/* USER CODE BEGIN TIM3_MspInit 1 */
|
||||||
|
|
||||||
|
/* USER CODE END TIM3_MspInit 1 */
|
||||||
|
}
|
||||||
|
else if (htim_pwm->Instance == TIM4)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN TIM4_MspInit 0 */
|
||||||
|
|
||||||
|
/* USER CODE END TIM4_MspInit 0 */
|
||||||
|
/* Peripheral clock enable */
|
||||||
|
__HAL_RCC_TIM4_CLK_ENABLE();
|
||||||
|
/* USER CODE BEGIN TIM4_MspInit 1 */
|
||||||
|
|
||||||
|
/* USER CODE END TIM4_MspInit 1 */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void HAL_TIM_MspPostInit(TIM_HandleTypeDef* htim)
|
||||||
|
{
|
||||||
|
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
||||||
|
if (htim->Instance == TIM1)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN TIM1_MspPostInit 0 */
|
||||||
|
|
||||||
|
/* USER CODE END TIM1_MspPostInit 0 */
|
||||||
|
__HAL_RCC_GPIOE_CLK_ENABLE();
|
||||||
|
/**TIM1 GPIO Configuration
|
||||||
|
PE9 ------> TIM1_CH1
|
||||||
|
PE11 ------> TIM1_CH2
|
||||||
|
PE13 ------> TIM1_CH3
|
||||||
|
PE14 ------> TIM1_CH4
|
||||||
|
*/
|
||||||
|
GPIO_InitStruct.Pin = GPIO_PIN_9 | GPIO_PIN_11 | GPIO_PIN_13 | GPIO_PIN_14;
|
||||||
|
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||||
|
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||||
|
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||||
|
GPIO_InitStruct.Alternate = GPIO_AF1_TIM1;
|
||||||
|
HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
|
||||||
|
|
||||||
|
/* USER CODE BEGIN TIM1_MspPostInit 1 */
|
||||||
|
|
||||||
|
/* USER CODE END TIM1_MspPostInit 1 */
|
||||||
|
}
|
||||||
|
else if (htim->Instance == TIM3)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN TIM3_MspPostInit 0 */
|
||||||
|
|
||||||
|
/* USER CODE END TIM3_MspPostInit 0 */
|
||||||
|
|
||||||
|
__HAL_RCC_GPIOB_CLK_ENABLE();
|
||||||
|
/**TIM3 GPIO Configuration
|
||||||
|
PB4 ------> TIM3_CH1
|
||||||
|
PB5 ------> TIM3_CH2
|
||||||
|
*/
|
||||||
|
GPIO_InitStruct.Pin = GPIO_PIN_4 | GPIO_PIN_5;
|
||||||
|
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||||
|
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||||
|
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||||
|
GPIO_InitStruct.Alternate = GPIO_AF2_TIM3;
|
||||||
|
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||||
|
|
||||||
|
/* USER CODE BEGIN TIM3_MspPostInit 1 */
|
||||||
|
|
||||||
|
/* USER CODE END TIM3_MspPostInit 1 */
|
||||||
|
}
|
||||||
|
else if (htim->Instance == TIM4)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN TIM4_MspPostInit 0 */
|
||||||
|
|
||||||
|
/* USER CODE END TIM4_MspPostInit 0 */
|
||||||
|
|
||||||
|
__HAL_RCC_GPIOD_CLK_ENABLE();
|
||||||
|
/**TIM4 GPIO Configuration
|
||||||
|
PD12 ------> TIM4_CH1
|
||||||
|
PD13 ------> TIM4_CH2
|
||||||
|
*/
|
||||||
|
GPIO_InitStruct.Pin = GPIO_PIN_12 | GPIO_PIN_13;
|
||||||
|
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||||
|
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||||
|
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||||
|
GPIO_InitStruct.Alternate = GPIO_AF2_TIM4;
|
||||||
|
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
|
||||||
|
|
||||||
|
/* USER CODE BEGIN TIM4_MspPostInit 1 */
|
||||||
|
|
||||||
|
/* USER CODE END TIM4_MspPostInit 1 */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @brief TIM_PWM MSP De-Initialization
|
||||||
|
* This function freeze the hardware resources used in this example
|
||||||
|
* @param htim_pwm: TIM_PWM handle pointer
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void HAL_TIM_PWM_MspDeInit(TIM_HandleTypeDef* htim_pwm)
|
||||||
|
{
|
||||||
|
if (htim_pwm->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_pwm->Instance == TIM3)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN TIM3_MspDeInit 0 */
|
||||||
|
|
||||||
|
/* USER CODE END TIM3_MspDeInit 0 */
|
||||||
|
/* Peripheral clock disable */
|
||||||
|
__HAL_RCC_TIM3_CLK_DISABLE();
|
||||||
|
/* USER CODE BEGIN TIM3_MspDeInit 1 */
|
||||||
|
|
||||||
|
/* USER CODE END TIM3_MspDeInit 1 */
|
||||||
|
}
|
||||||
|
else if (htim_pwm->Instance == TIM4)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN TIM4_MspDeInit 0 */
|
||||||
|
|
||||||
|
/* USER CODE END TIM4_MspDeInit 0 */
|
||||||
|
/* Peripheral clock disable */
|
||||||
|
__HAL_RCC_TIM4_CLK_DISABLE();
|
||||||
|
/* USER CODE BEGIN TIM4_MspDeInit 1 */
|
||||||
|
|
||||||
|
/* USER CODE END TIM4_MspDeInit 1 */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief UART MSP Initialization
|
* @brief UART MSP Initialization
|
||||||
* This function configures the hardware resources used in this example
|
* This function configures the hardware resources used in this example
|
||||||
@@ -211,90 +515,6 @@ void HAL_UART_MspDeInit(UART_HandleTypeDef* huart)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief SD MSP Initialization
|
|
||||||
* This function configures the hardware resources used in this example
|
|
||||||
* @param hsd: SD handle pointer
|
|
||||||
* @retval None
|
|
||||||
*/
|
|
||||||
void HAL_SD_MspInit(SD_HandleTypeDef* hsd)
|
|
||||||
{
|
|
||||||
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
|
||||||
if(hsd->Instance==SDIO)
|
|
||||||
{
|
|
||||||
/* USER CODE BEGIN SDIO_MspInit 0 */
|
|
||||||
|
|
||||||
/* USER CODE END SDIO_MspInit 0 */
|
|
||||||
/* Peripheral clock enable */
|
|
||||||
__HAL_RCC_SDIO_CLK_ENABLE();
|
|
||||||
|
|
||||||
__HAL_RCC_GPIOC_CLK_ENABLE();
|
|
||||||
__HAL_RCC_GPIOD_CLK_ENABLE();
|
|
||||||
/**SDIO GPIO Configuration
|
|
||||||
PC8 ------> SDIO_D0
|
|
||||||
PC9 ------> SDIO_D1
|
|
||||||
PC10 ------> SDIO_D2
|
|
||||||
PC11 ------> SDIO_D3
|
|
||||||
PC12 ------> SDIO_CK
|
|
||||||
PD2 ------> SDIO_CMD
|
|
||||||
*/
|
|
||||||
GPIO_InitStruct.Pin = GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_11
|
|
||||||
|GPIO_PIN_12;
|
|
||||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
|
||||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
|
||||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
|
||||||
GPIO_InitStruct.Alternate = GPIO_AF12_SDIO;
|
|
||||||
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
|
|
||||||
|
|
||||||
GPIO_InitStruct.Pin = GPIO_PIN_2;
|
|
||||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
|
||||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
|
||||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
|
||||||
GPIO_InitStruct.Alternate = GPIO_AF12_SDIO;
|
|
||||||
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
|
|
||||||
|
|
||||||
/* USER CODE BEGIN SDIO_MspInit 1 */
|
|
||||||
|
|
||||||
/* USER CODE END SDIO_MspInit 1 */
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief SD MSP De-Initialization
|
|
||||||
* This function de-initializes the hardware resources used in this example
|
|
||||||
* @param hsd: SD handle pointer
|
|
||||||
* @retval None
|
|
||||||
*/
|
|
||||||
void HAL_SD_MspDeInit(SD_HandleTypeDef* hsd)
|
|
||||||
{
|
|
||||||
if(hsd->Instance==SDIO)
|
|
||||||
{
|
|
||||||
/* USER CODE BEGIN SDIO_MspDeInit 0 */
|
|
||||||
|
|
||||||
/* USER CODE END SDIO_MspDeInit 0 */
|
|
||||||
/* Peripheral clock disable */
|
|
||||||
__HAL_RCC_SDIO_CLK_DISABLE();
|
|
||||||
|
|
||||||
/**SDIO GPIO Configuration
|
|
||||||
PC8 ------> SDIO_D0
|
|
||||||
PC9 ------> SDIO_D1
|
|
||||||
PC10 ------> SDIO_D2
|
|
||||||
PC11 ------> SDIO_D3
|
|
||||||
PC12 ------> SDIO_CK
|
|
||||||
PD2 ------> SDIO_CMD
|
|
||||||
*/
|
|
||||||
HAL_GPIO_DeInit(GPIOC, GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_11
|
|
||||||
|GPIO_PIN_12);
|
|
||||||
|
|
||||||
HAL_GPIO_DeInit(GPIOD, GPIO_PIN_2);
|
|
||||||
|
|
||||||
/* USER CODE BEGIN SDIO_MspDeInit 1 */
|
|
||||||
|
|
||||||
/* USER CODE END SDIO_MspDeInit 1 */
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
/* USER CODE BEGIN 1 */
|
/* USER CODE BEGIN 1 */
|
||||||
|
|
||||||
/* USER CODE END 1 */
|
/* USER CODE END 1 */
|
||||||
|
|||||||
@@ -117,6 +117,109 @@ menu "On-chip Peripheral Drivers"
|
|||||||
bool "RTC USING LSI"
|
bool "RTC USING LSI"
|
||||||
endchoice
|
endchoice
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
menuconfig BSP_USING_I2C
|
||||||
|
bool "Enable I2C"
|
||||||
|
default n
|
||||||
|
if BSP_USING_I2C
|
||||||
|
menuconfig BSP_USING_I2C1
|
||||||
|
bool "Enable I2C1 BUS (software simulation)"
|
||||||
|
default n
|
||||||
|
select RT_USING_I2C
|
||||||
|
select RT_USING_I2C_BITOPS
|
||||||
|
select RT_USING_PIN
|
||||||
|
if BSP_USING_I2C1
|
||||||
|
config BSP_I2C1_SCL_PIN
|
||||||
|
int "i2c1 scl pin number"
|
||||||
|
range 0 143
|
||||||
|
default 22
|
||||||
|
config BSP_I2C1_SDA_PIN
|
||||||
|
int "I2C1 sda pin number"
|
||||||
|
range 0 143
|
||||||
|
default 23
|
||||||
|
endif
|
||||||
|
|
||||||
|
menuconfig BSP_USING_I2C2
|
||||||
|
bool "Enable I2C2 BUS (software simulation)"
|
||||||
|
default n
|
||||||
|
select RT_USING_I2C
|
||||||
|
select RT_USING_I2C_BITOPS
|
||||||
|
select RT_USING_PIN
|
||||||
|
if BSP_USING_I2C2
|
||||||
|
config BSP_I2C2_SCL_PIN
|
||||||
|
int "i2c2 scl pin number"
|
||||||
|
range 0 143
|
||||||
|
default 26
|
||||||
|
config BSP_I2C2_SDA_PIN
|
||||||
|
int "I2C2 sda pin number"
|
||||||
|
range 0 143
|
||||||
|
default 27
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
menuconfig BSP_USING_TIM
|
||||||
|
bool "Enable timer"
|
||||||
|
default n
|
||||||
|
select RT_USING_HWTIMER
|
||||||
|
if BSP_USING_TIM
|
||||||
|
config BSP_USING_TIM11
|
||||||
|
bool "Enable TIM11"
|
||||||
|
default n
|
||||||
|
|
||||||
|
config BSP_USING_TIM13
|
||||||
|
bool "Enable TIM13"
|
||||||
|
default n
|
||||||
|
|
||||||
|
config BSP_USING_TIM14
|
||||||
|
bool "Enable TIM14"
|
||||||
|
default n
|
||||||
|
endif
|
||||||
|
|
||||||
|
menuconfig BSP_USING_PWM
|
||||||
|
bool "Enable PWM"
|
||||||
|
default n
|
||||||
|
select RT_USING_PWM
|
||||||
|
if BSP_USING_PWM
|
||||||
|
menuconfig BSP_USING_PWM1
|
||||||
|
bool "Enable timer1 output PWM"
|
||||||
|
default n
|
||||||
|
if BSP_USING_PWM1
|
||||||
|
config BSP_USING_PWM1_CH1
|
||||||
|
bool "Enable PWM1 channel1"
|
||||||
|
default n
|
||||||
|
config BSP_USING_PWM1_CH2
|
||||||
|
bool "Enable PWM1 channel2"
|
||||||
|
default n
|
||||||
|
config BSP_USING_PWM1_CH3
|
||||||
|
bool "Enable PWM1 channel3"
|
||||||
|
default n
|
||||||
|
config BSP_USING_PWM1_CH4
|
||||||
|
bool "Enable PWM1 channel4"
|
||||||
|
default n
|
||||||
|
endif
|
||||||
|
menuconfig BSP_USING_PWM3
|
||||||
|
bool "Enable timer3 output PWM"
|
||||||
|
default n
|
||||||
|
if BSP_USING_PWM3
|
||||||
|
config BSP_USING_PWM3_CH1
|
||||||
|
bool "Enable PWM3 channel1"
|
||||||
|
default n
|
||||||
|
config BSP_USING_PWM3_CH2
|
||||||
|
bool "Enable PWM3 channel2"
|
||||||
|
default n
|
||||||
|
endif
|
||||||
|
menuconfig BSP_USING_PWM4
|
||||||
|
bool "Enable timer4 output PWM"
|
||||||
|
default n
|
||||||
|
if BSP_USING_PWM4
|
||||||
|
config BSP_USING_PWM4_CH1
|
||||||
|
bool "Enable PWM4 channel1"
|
||||||
|
default n
|
||||||
|
config BSP_USING_PWM4_CH2
|
||||||
|
bool "Enable PWM4 channel2"
|
||||||
|
default n
|
||||||
|
endif
|
||||||
|
endif
|
||||||
source "$(BSP_DIR)/../libraries/HAL_Drivers/drivers/Kconfig"
|
source "$(BSP_DIR)/../libraries/HAL_Drivers/drivers/Kconfig"
|
||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "board.h"
|
#include "board.h"
|
||||||
|
#include "drv_common.h"
|
||||||
|
|
||||||
void SystemClock_Config(void)
|
void SystemClock_Config(void)
|
||||||
{
|
{
|
||||||
@@ -23,15 +24,15 @@ void SystemClock_Config(void)
|
|||||||
/** Initializes the RCC Oscillators according to the specified parameters
|
/** Initializes the RCC Oscillators according to the specified parameters
|
||||||
* in the RCC_OscInitTypeDef structure.
|
* in the RCC_OscInitTypeDef structure.
|
||||||
*/
|
*/
|
||||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
|
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI | RCC_OSCILLATORTYPE_HSE;
|
||||||
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
|
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
|
||||||
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
|
RCC_OscInitStruct.LSIState = RCC_LSI_ON;
|
||||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
|
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
|
||||||
RCC_OscInitStruct.PLL.PLLM = 8;
|
RCC_OscInitStruct.PLL.PLLM = 4;
|
||||||
RCC_OscInitStruct.PLL.PLLN = 168;
|
RCC_OscInitStruct.PLL.PLLN = 168;
|
||||||
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
|
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
|
||||||
RCC_OscInitStruct.PLL.PLLQ = 4;
|
RCC_OscInitStruct.PLL.PLLQ = 7;
|
||||||
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
|
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
|
||||||
{
|
{
|
||||||
Error_Handler();
|
Error_Handler();
|
||||||
|
|||||||
Reference in New Issue
Block a user