mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-02-07 01:44:41 +08:00
[bsp][stm32f10x-HAL] add pwm driver.
This commit is contained in:
@@ -206,3 +206,122 @@ if RT_USING_DEVICE_IPC && (STM32F103RC || STM32F103RD || STM32F103RE || STM32F10
|
||||
default n
|
||||
depends on RT_USING_SDCARD
|
||||
endif
|
||||
|
||||
|
||||
|
||||
menuconfig BSP_USING_PWM1
|
||||
bool "Using PWM1"
|
||||
select RT_USING_PWM
|
||||
default n
|
||||
|
||||
if BSP_USING_PWM1
|
||||
config BSP_USING_PWM1_CH1
|
||||
bool "Enable Channel 1 (PE9)"
|
||||
default n
|
||||
config BSP_USING_PWM1_CH2
|
||||
bool "Enable Channel 2 (PE11)"
|
||||
default n
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_PWM2
|
||||
bool "Using PWM2"
|
||||
select RT_USING_PWM
|
||||
default n
|
||||
|
||||
if BSP_USING_PWM2
|
||||
config BSP_USING_PWM2_CH1
|
||||
bool "Enable Channel 1 (PB10)"
|
||||
default n
|
||||
config BSP_USING_PWM2_CH2
|
||||
bool "Enable Channel 2 (PB11)"
|
||||
default n
|
||||
config BSP_USING_PWM2_CH3
|
||||
bool "Enable Channel 3 (PA15)"
|
||||
default n
|
||||
config BSP_USING_PWM2_CH4
|
||||
bool "Enable Channel 4 (PB3)"
|
||||
default n
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_PWM3
|
||||
bool "Using PWM3"
|
||||
select RT_USING_PWM
|
||||
default n
|
||||
|
||||
if BSP_USING_PWM3
|
||||
config BSP_USING_PWM3_CH1
|
||||
bool "Enable Channel 1 (PA6)"
|
||||
default n
|
||||
config BSP_USING_PWM3_CH2
|
||||
bool "Enable Channel 2 (PA7)"
|
||||
default n
|
||||
config BSP_USING_PWM3_CH3
|
||||
bool "Enable Channel 3 (PB0)"
|
||||
default n
|
||||
config BSP_USING_PWM3_CH4
|
||||
bool "Enable Channel 4 (PB1)"
|
||||
default n
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_PWM4
|
||||
bool "Using PWM4"
|
||||
select RT_USING_PWM
|
||||
default n
|
||||
|
||||
if BSP_USING_PWM4
|
||||
config BSP_USING_PWM4_CH1
|
||||
bool "Enable Channel 1 (PD12)"
|
||||
default n
|
||||
config BSP_USING_PWM4_CH2
|
||||
bool "Enable Channel 2 (PD13)"
|
||||
default n
|
||||
config BSP_USING_PWM4_CH3
|
||||
bool "Enable Channel 3 (PD14)"
|
||||
default n
|
||||
config BSP_USING_PWM4_CH4
|
||||
bool "Enable Channel 4 (PD15)"
|
||||
default n
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_PWM5
|
||||
bool "Using PWM5"
|
||||
select RT_USING_PWM
|
||||
default n
|
||||
|
||||
if BSP_USING_PWM5
|
||||
config BSP_USING_PWM5_CH1
|
||||
bool "Enable Channel 1 (PA0)"
|
||||
default n
|
||||
config BSP_USING_PWM5_CH2
|
||||
bool "Enable Channel 2 (PA1)"
|
||||
default n
|
||||
config BSP_USING_PWM5_CH3
|
||||
bool "Enable Channel 3 (PA2)"
|
||||
default n
|
||||
config BSP_USING_PWM5_CH4
|
||||
bool "Enable Channel 4 (PA3)"
|
||||
default n
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_PWM8
|
||||
bool "Using PWM8"
|
||||
select RT_USING_PWM
|
||||
default n
|
||||
|
||||
if BSP_USING_PWM8
|
||||
config BSP_USING_PWM8_CH1
|
||||
bool "Enable Channel 1 (PC6)"
|
||||
default n
|
||||
config BSP_USING_PWM8_CH2
|
||||
bool "Enable Channel 2 (PC7)"
|
||||
default n
|
||||
config BSP_USING_PWM8_CH3
|
||||
bool "Enable Channel 3 (PC8)"
|
||||
default n
|
||||
config BSP_USING_PWM8_CH4
|
||||
bool "Enable Channel 4 (PC9)"
|
||||
default n
|
||||
endif
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -26,6 +26,9 @@ if GetDepend(['RT_USING_I2C', 'RT_USING_I2C_BITOPS']):
|
||||
if GetDepend(['RT_USING_WDT']):
|
||||
src += ['drv_iwg.c']
|
||||
|
||||
if GetDepend(['RT_USING_PWM']):
|
||||
src += ['drv_pwm.c']
|
||||
|
||||
if rtconfig.CROSS_TOOL == 'gcc':
|
||||
src += ['gcc_startup.s']
|
||||
|
||||
|
||||
842
bsp/stm32f10x-HAL/drivers/drv_pwm.c
Normal file
842
bsp/stm32f10x-HAL/drivers/drv_pwm.c
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user