[stm32f469-disc] support RTduino Tone feature

This commit is contained in:
Meco Man 2024-03-07 18:54:25 -05:00 committed by Rbb666
parent 1a240798fa
commit 5f87e10032
5 changed files with 70 additions and 25 deletions

View File

@ -51,4 +51,6 @@
/* i2c1 : PB9-SDA PB8-SCL */ /* i2c1 : PB9-SDA PB8-SCL */
#define RTDUINO_DEFAULT_IIC_BUS_NAME "i2c1" #define RTDUINO_DEFAULT_IIC_BUS_NAME "i2c1"
#define RTDUINO_TONE_HWTIMER_DEVICE_NAME "timer6"
#endif /* Pins_Arduino_h */ #endif /* Pins_Arduino_h */

File diff suppressed because one or more lines are too long

View File

@ -5,6 +5,9 @@ ADC1.NbrOfConversionFlag=1
ADC1.Rank-0\#ChannelRegularConversion=1 ADC1.Rank-0\#ChannelRegularConversion=1
ADC1.SamplingTime-0\#ChannelRegularConversion=ADC_SAMPLETIME_3CYCLES ADC1.SamplingTime-0\#ChannelRegularConversion=ADC_SAMPLETIME_3CYCLES
ADC1.master=1 ADC1.master=1
CAD.formats=
CAD.pinconfig=
CAD.provider=
DSIHOST_CKN.Mode=DSIHost_Video DSIHOST_CKN.Mode=DSIHost_Video
DSIHOST_CKN.Signal=DSIHOST_CKN DSIHOST_CKN.Signal=DSIHOST_CKN
DSIHOST_CKP.Mode=DSIHost_Video DSIHOST_CKP.Mode=DSIHost_Video
@ -43,6 +46,7 @@ I2S3.RealAudioFreq=15.957 KHz
I2S3.Standard=I2S_STANDARD_LSB I2S3.Standard=I2S_STANDARD_LSB
I2S3.VirtualMode=I2S_MODE_MASTER I2S3.VirtualMode=I2S_MODE_MASTER
KeepUserPlacement=false KeepUserPlacement=false
Mcu.CPN=STM32F469NIH6
Mcu.Family=STM32F4 Mcu.Family=STM32F4
Mcu.IP0=ADC1 Mcu.IP0=ADC1
Mcu.IP1=CRC Mcu.IP1=CRC
@ -52,9 +56,10 @@ Mcu.IP12=SYS
Mcu.IP13=TIM2 Mcu.IP13=TIM2
Mcu.IP14=TIM3 Mcu.IP14=TIM3
Mcu.IP15=TIM4 Mcu.IP15=TIM4
Mcu.IP16=TIM12 Mcu.IP16=TIM6
Mcu.IP17=USART3 Mcu.IP17=TIM12
Mcu.IP18=USB_OTG_FS Mcu.IP18=USART3
Mcu.IP19=USB_OTG_FS
Mcu.IP2=DMA2D Mcu.IP2=DMA2D
Mcu.IP3=DSIHOST Mcu.IP3=DSIHOST
Mcu.IP4=FMC Mcu.IP4=FMC
@ -63,7 +68,7 @@ Mcu.IP6=LTDC
Mcu.IP7=NVIC Mcu.IP7=NVIC
Mcu.IP8=PDM2PCM Mcu.IP8=PDM2PCM
Mcu.IP9=QUADSPI Mcu.IP9=QUADSPI
Mcu.IPNb=19 Mcu.IPNb=20
Mcu.Name=STM32F469NIHx Mcu.Name=STM32F469NIHx
Mcu.Package=TFBGA216 Mcu.Package=TFBGA216
Mcu.Pin0=PE1 Mcu.Pin0=PE1
@ -78,8 +83,9 @@ Mcu.Pin105=VP_SYS_VS_Systick
Mcu.Pin106=VP_TIM2_VS_ClockSourceINT Mcu.Pin106=VP_TIM2_VS_ClockSourceINT
Mcu.Pin107=VP_TIM3_VS_ClockSourceINT Mcu.Pin107=VP_TIM3_VS_ClockSourceINT
Mcu.Pin108=VP_TIM4_VS_ControllerModeClock Mcu.Pin108=VP_TIM4_VS_ControllerModeClock
Mcu.Pin109=VP_TIM12_VS_ClockSourceINT Mcu.Pin109=VP_TIM6_VS_ClockSourceINT
Mcu.Pin11=PC11 Mcu.Pin11=PC11
Mcu.Pin110=VP_TIM12_VS_ClockSourceINT
Mcu.Pin12=PC10 Mcu.Pin12=PC10
Mcu.Pin13=PA12 Mcu.Pin13=PA12
Mcu.Pin14=PI4 Mcu.Pin14=PI4
@ -176,25 +182,25 @@ Mcu.Pin96=PE12
Mcu.Pin97=PE15 Mcu.Pin97=PE15
Mcu.Pin98=PE13 Mcu.Pin98=PE13
Mcu.Pin99=PB11 Mcu.Pin99=PB11
Mcu.PinsNb=110 Mcu.PinsNb=111
Mcu.ThirdPartyNb=0 Mcu.ThirdPartyNb=0
Mcu.UserConstants= Mcu.UserConstants=
Mcu.UserName=STM32F469NIHx Mcu.UserName=STM32F469NIHx
MxCube.Version=5.1.0 MxCube.Version=5.1.0
MxDb.Version=DB.5.0.10 MxDb.Version=DB.5.0.10
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC.ForceEnableDMAVector=true NVIC.ForceEnableDMAVector=true
NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC.OTG_FS_IRQn=true\:0\:0\:false\:false\:true\:true\:true NVIC.OTG_FS_IRQn=true\:0\:0\:false\:false\:true\:true\:true\:true
NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4 NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4
NVIC.SPI3_IRQn=true\:0\:0\:false\:false\:true\:true\:true NVIC.SPI3_IRQn=true\:0\:0\:false\:false\:true\:true\:true\:true
NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC.SysTick_IRQn=true\:0\:0\:false\:false\:true\:false\:true NVIC.SysTick_IRQn=true\:0\:0\:false\:false\:true\:false\:true\:false
NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
PA1.Locked=true PA1.Locked=true
PA1.Signal=S_TIM2_CH2 PA1.Signal=S_TIM2_CH2
PA11.Mode=Device_Only PA11.Mode=Device_Only
@ -372,12 +378,13 @@ ProjectManager.PreviousToolchain=
ProjectManager.ProjectBuild=false ProjectManager.ProjectBuild=false
ProjectManager.ProjectFileName=CubeMX_Config.ioc ProjectManager.ProjectFileName=CubeMX_Config.ioc
ProjectManager.ProjectName=CubeMX_Config ProjectManager.ProjectName=CubeMX_Config
ProjectManager.ProjectStructure=
ProjectManager.RegisterCallBack= ProjectManager.RegisterCallBack=
ProjectManager.StackSize=0x400 ProjectManager.StackSize=0x400
ProjectManager.TargetToolchain=MDK-ARM V5 ProjectManager.TargetToolchain=MDK-ARM V5
ProjectManager.ToolChainLocation= ProjectManager.ToolChainLocation=
ProjectManager.UnderRoot=false ProjectManager.UnderRoot=false
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_USART3_UART_Init-USART3-false-HAL-true,3-MX_FMC_Init-FMC-false-HAL-true,4-MX_QUADSPI_Init-QUADSPI-false-HAL-true,5-MX_CRC_Init-CRC-false-HAL-true,6-MX_I2S3_Init-I2S3-false-HAL-true,7-MX_TIM4_Init-TIM4-false-HAL-true,8-MX_PDM2PCM_Init-PDM2PCM-false-HAL-false,9-MX_USB_OTG_FS_PCD_Init-USB_OTG_FS-false-HAL-true,10-SystemClock_Config-RCC-false-HAL-false,11-MX_LTDC_Init-LTDC-false-HAL-true,12-MX_DMA2D_Init-DMA2D-false-HAL-true,13-MX_DSIHOST_DSI_Init-DSIHOST-false-HAL-true,14-MX_SDIO_SD_Init-SDIO-false-HAL-true ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_USART3_UART_Init-USART3-false-HAL-true,3-MX_FMC_Init-FMC-false-HAL-true,4-MX_QUADSPI_Init-QUADSPI-false-HAL-true,5-MX_CRC_Init-CRC-false-HAL-true,6-MX_I2S3_Init-I2S3-false-HAL-true,7-MX_TIM4_Init-TIM4-false-HAL-true,8-MX_PDM2PCM_Init-PDM2PCM-false-HAL-false,9-MX_USB_OTG_FS_PCD_Init-USB_OTG_FS-false-HAL-true,10-SystemClock_Config-RCC-false-HAL-false,11-MX_LTDC_Init-LTDC-false-HAL-true,12-MX_DMA2D_Init-DMA2D-false-HAL-true,13-MX_DSIHOST_DSI_Init-DSIHOST-false-HAL-true,14-MX_SDIO_SD_Init-SDIO-false-HAL-true,15-MX_ADC1_Init-ADC1-false-HAL-true,16-MX_TIM2_Init-TIM2-false-HAL-true,17-MX_TIM3_Init-TIM3-false-HAL-true,18-MX_TIM12_Init-TIM12-false-HAL-true
QUADSPI.ChipSelectHighTime=QSPI_CS_HIGH_TIME_5_CYCLE QUADSPI.ChipSelectHighTime=QSPI_CS_HIGH_TIME_5_CYCLE
QUADSPI.ClockPrescaler=1 QUADSPI.ClockPrescaler=1
QUADSPI.FifoThreshold=4 QUADSPI.FifoThreshold=4
@ -607,4 +614,6 @@ VP_TIM3_VS_ClockSourceINT.Mode=Internal
VP_TIM3_VS_ClockSourceINT.Signal=TIM3_VS_ClockSourceINT VP_TIM3_VS_ClockSourceINT.Signal=TIM3_VS_ClockSourceINT
VP_TIM4_VS_ControllerModeClock.Mode=Clock Mode VP_TIM4_VS_ControllerModeClock.Mode=Clock Mode
VP_TIM4_VS_ControllerModeClock.Signal=TIM4_VS_ControllerModeClock VP_TIM4_VS_ControllerModeClock.Signal=TIM4_VS_ControllerModeClock
VP_TIM6_VS_ClockSourceINT.Mode=Enable_Timer
VP_TIM6_VS_ClockSourceINT.Signal=TIM6_VS_ClockSourceINT
board=custom board=custom

View File

@ -664,6 +664,17 @@ void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* htim_base)
/* USER CODE END TIM4_MspInit 1 */ /* USER CODE END TIM4_MspInit 1 */
} }
else if(htim_base->Instance==TIM6)
{
/* USER CODE BEGIN TIM6_MspInit 0 */
/* USER CODE END TIM6_MspInit 0 */
/* Peripheral clock enable */
__HAL_RCC_TIM6_CLK_ENABLE();
/* USER CODE BEGIN TIM6_MspInit 1 */
/* USER CODE END TIM6_MspInit 1 */
}
else if(htim_base->Instance==TIM12) else if(htim_base->Instance==TIM12)
{ {
/* USER CODE BEGIN TIM12_MspInit 0 */ /* USER CODE BEGIN TIM12_MspInit 0 */
@ -825,6 +836,17 @@ void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* htim_base)
/* USER CODE END TIM4_MspDeInit 1 */ /* USER CODE END TIM4_MspDeInit 1 */
} }
else if(htim_base->Instance==TIM6)
{
/* USER CODE BEGIN TIM6_MspDeInit 0 */
/* USER CODE END TIM6_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_TIM6_CLK_DISABLE();
/* USER CODE BEGIN TIM6_MspDeInit 1 */
/* USER CODE END TIM6_MspDeInit 1 */
}
else if(htim_base->Instance==TIM12) else if(htim_base->Instance==TIM12)
{ {
/* USER CODE BEGIN TIM12_MspDeInit 0 */ /* USER CODE BEGIN TIM12_MspDeInit 0 */

View File

@ -28,6 +28,8 @@ menu "Onboard Peripheral Drivers"
select BSP_USING_GPIO select BSP_USING_GPIO
select BSP_USING_ADC select BSP_USING_ADC
select BSP_USING_ADC1 select BSP_USING_ADC1
select BSP_USING_TIM
select BSP_USING_TIM6
select BSP_USING_PWM select BSP_USING_PWM
select BSP_USING_PWM2 select BSP_USING_PWM2
select BSP_USING_PWM2_CH2 select BSP_USING_PWM2_CH2
@ -173,6 +175,16 @@ menu "On-chip Peripheral Drivers"
endif endif
endif endif
menuconfig BSP_USING_TIM
bool "Enable timer"
default n
select RT_USING_HWTIMER
if BSP_USING_TIM
config BSP_USING_TIM6
bool "Enable TIM6"
default n
endif
menuconfig BSP_USING_UART menuconfig BSP_USING_UART
bool "Enable UART" bool "Enable UART"
select RT_USING_SERIAL select RT_USING_SERIAL