[bsp][stm32f411][RTduino] support Tone hwtimer

This commit is contained in:
Meco Man 2023-07-09 13:48:21 -04:00 committed by Man, Jianting (Meco)
parent a75de72bb1
commit 673d1dcaf0
4 changed files with 51 additions and 7 deletions

View File

@ -15,8 +15,9 @@ Mcu.Family=STM32F4
Mcu.IP0=ADC1
Mcu.IP1=IWDG
Mcu.IP10=TIM4
Mcu.IP11=USART2
Mcu.IP12=USART6
Mcu.IP11=TIM9
Mcu.IP12=USART2
Mcu.IP13=USART6
Mcu.IP2=NVIC
Mcu.IP3=RCC
Mcu.IP4=RTC
@ -25,7 +26,7 @@ Mcu.IP6=SYS
Mcu.IP7=TIM1
Mcu.IP8=TIM2
Mcu.IP9=TIM3
Mcu.IPNb=13
Mcu.IPNb=14
Mcu.Name=STM32F411R(C-E)Tx
Mcu.Package=LQFP64
Mcu.Pin0=PC14-OSC32_IN
@ -55,18 +56,19 @@ Mcu.Pin3=PH1 - OSC_OUT
Mcu.Pin30=VP_TIM2_VS_ClockSourceINT
Mcu.Pin31=VP_TIM3_VS_ClockSourceINT
Mcu.Pin32=VP_TIM4_VS_ClockSourceINT
Mcu.Pin33=VP_TIM9_VS_ClockSourceINT
Mcu.Pin4=PC0
Mcu.Pin5=PC1
Mcu.Pin6=PA0-WKUP
Mcu.Pin7=PA1
Mcu.Pin8=PA2
Mcu.Pin9=PA3
Mcu.PinsNb=33
Mcu.PinsNb=34
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32F411RETx
MxCube.Version=6.7.0
MxDb.Version=DB.6.0.70
MxCube.Version=6.8.1
MxDb.Version=DB.6.0.81
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:true\:false\:false
NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:true\:false\:false
NVIC.ForceEnableDMAVector=true
@ -155,12 +157,13 @@ ProjectManager.PreviousToolchain=
ProjectManager.ProjectBuild=false
ProjectManager.ProjectFileName=CubeMX_Config.ioc
ProjectManager.ProjectName=CubeMX_Config
ProjectManager.ProjectStructure=
ProjectManager.RegisterCallBack=
ProjectManager.StackSize=0x400
ProjectManager.TargetToolchain=MDK-ARM V5
ProjectManager.ToolChainLocation=
ProjectManager.UnderRoot=false
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_USART2_UART_Init-USART2-false-HAL-true,4-MX_TIM3_Init-TIM3-false-HAL-true,5-MX_ADC1_Init-ADC1-false-HAL-true,6-MX_TIM1_Init-TIM1-false-HAL-true,7-MX_TIM2_Init-TIM2-false-HAL-true,8-MX_TIM4_Init-TIM4-false-HAL-true,9-MX_RTC_Init-RTC-false-HAL-true,10-MX_USART6_UART_Init-USART6-false-HAL-true,11-MX_IWDG_Init-IWDG-false-HAL-true
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_USART2_UART_Init-USART2-false-HAL-true,4-MX_TIM3_Init-TIM3-false-HAL-true,5-MX_ADC1_Init-ADC1-false-HAL-true,6-MX_TIM1_Init-TIM1-false-HAL-true,7-MX_TIM2_Init-TIM2-false-HAL-true,8-MX_TIM4_Init-TIM4-false-HAL-true,9-MX_RTC_Init-RTC-false-HAL-true,10-MX_USART6_UART_Init-USART6-false-HAL-true,11-MX_IWDG_Init-IWDG-false-HAL-true,12-MX_SPI3_Init-SPI3-false-HAL-true
RCC.48MHZClocksFreq_Value=42000000
RCC.AHBFreq_Value=84000000
RCC.APB1CLKDivider=RCC_HCLK_DIV2
@ -252,5 +255,7 @@ VP_TIM3_VS_ClockSourceINT.Mode=Internal
VP_TIM3_VS_ClockSourceINT.Signal=TIM3_VS_ClockSourceINT
VP_TIM4_VS_ClockSourceINT.Mode=Internal
VP_TIM4_VS_ClockSourceINT.Signal=TIM4_VS_ClockSourceINT
VP_TIM9_VS_ClockSourceINT.Mode=Internal
VP_TIM9_VS_ClockSourceINT.Signal=TIM9_VS_ClockSourceINT
board=NUCLEO-F411RE
boardIOC=true

View File

@ -46,6 +46,7 @@
/* #define HAL_DCMI_MODULE_ENABLED */
/* #define HAL_DMA2D_MODULE_ENABLED */
/* #define HAL_ETH_MODULE_ENABLED */
/* #define HAL_ETH_LEGACY_MODULE_ENABLED */
/* #define HAL_NAND_MODULE_ENABLED */
/* #define HAL_NOR_MODULE_ENABLED */
/* #define HAL_PCCARD_MODULE_ENABLED */
@ -326,6 +327,10 @@
#include "stm32f4xx_hal_eth.h"
#endif /* HAL_ETH_MODULE_ENABLED */
#ifdef HAL_ETH_LEGACY_MODULE_ENABLED
#include "stm32f4xx_hal_eth_legacy.h"
#endif /* HAL_ETH_LEGACY_MODULE_ENABLED */
#ifdef HAL_FLASH_MODULE_ENABLED
#include "stm32f4xx_hal_flash.h"
#endif /* HAL_FLASH_MODULE_ENABLED */

View File

@ -372,6 +372,17 @@ void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* htim_base)
/* USER CODE END TIM4_MspInit 1 */
}
else if(htim_base->Instance==TIM9)
{
/* USER CODE BEGIN TIM9_MspInit 0 */
/* USER CODE END TIM9_MspInit 0 */
/* Peripheral clock enable */
__HAL_RCC_TIM9_CLK_ENABLE();
/* USER CODE BEGIN TIM9_MspInit 1 */
/* USER CODE END TIM9_MspInit 1 */
}
}
@ -526,6 +537,17 @@ void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* htim_base)
/* USER CODE END TIM4_MspDeInit 1 */
}
else if(htim_base->Instance==TIM9)
{
/* USER CODE BEGIN TIM9_MspDeInit 0 */
/* USER CODE END TIM9_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_TIM9_CLK_DISABLE();
/* USER CODE BEGIN TIM9_MspDeInit 1 */
/* USER CODE END TIM9_MspDeInit 1 */
}
}

View File

@ -19,6 +19,8 @@ menu "Onboard Peripheral Drivers"
select PKG_USING_RTDUINO
select BSP_USING_STLINK_TO_USART
select BSP_USING_GPIO
select BSP_USING_TIM
select BSP_USING_TIM9
select BSP_USING_ADC
select BSP_USING_ADC1
select BSP_USING_PWM
@ -159,6 +161,16 @@ menu "On-chip Peripheral Drivers"
endif
endif
menuconfig BSP_USING_TIM
bool "Enable timer"
default n
select RT_USING_HWTIMER
if BSP_USING_TIM
config BSP_USING_TIM9
bool "Enable TIM9"
default n
endif
menuconfig BSP_USING_ONCHIP_RTC
bool "Enable RTC"
select RT_USING_RTC