[bsp] add n32 pwm driver
ToolsCI / Tools (push) Has been cancelled
RT-Thread BSP Static Build Check / 🔍 Summary of Git Diff Changes (push) Has been cancelled
doc_doxygen / doxygen_doc generate (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
doc_doxygen / deploy (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

This commit is contained in:
映心
2026-03-05 10:10:03 +08:00
committed by Rbb666
parent 78b6b6e17f
commit 38c007af31
20 changed files with 2337 additions and 10 deletions
@@ -33,9 +33,9 @@ if GetDepend(['RT_USING_ADC']):
if GetDepend(['RT_USING_DAC']):
src += ['n32g43x_std_periph_driver/src/n32g43x_dac.c']
if GetDepend(['RT_USING_CLOCK_TIME']):
if GetDepend(['RT_USING_CLOCK_TIME'])or GetDepend(['RT_USING_PWM']):
src += ['n32g43x_std_periph_driver/src/n32g43x_tim.c']
if GetDepend(['RT_USING_RTC']):
src += ['n32g43x_std_periph_driver/src/n32g43x_rtc.c']
src += ['n32g43x_std_periph_driver/src/n32g43x_pwr.c']
@@ -38,7 +38,7 @@ if GetDepend(['RT_USING_ADC']):
if GetDepend(['RT_USING_DAC']):
src += ['n32g45x_std_periph_driver/src/n32g45x_dac.c']
if GetDepend(['RT_USING_CLOCK_TIME']):
if GetDepend(['RT_USING_CLOCK_TIME']) or GetDepend(['RT_USING_PWM']):
src += ['n32g45x_std_periph_driver/src/n32g45x_tim.c']
if GetDepend(['RT_USING_RTC']):
@@ -32,9 +32,9 @@ if GetDepend(['RT_USING_ADC']):
if GetDepend(['RT_USING_DAC']):
src += ['n32g4fr_std_periph_driver/src/n32g4fr_dac.c']
if GetDepend(['RT_USING_CLOCK_TIME']):
if GetDepend(['RT_USING_CLOCK_TIME']) or GetDepend(['RT_USING_PWM']):
src += ['n32g4fr_std_periph_driver/src/n32g4fr_tim.c']
if GetDepend(['RT_USING_RTC']):
src += ['n32g4fr_std_periph_driver/src/n32g4fr_rtc.c']
@@ -33,7 +33,7 @@ if GetDepend(['RT_USING_ADC']):
if GetDepend(['RT_USING_DAC']):
src += ['n32l40x_std_periph_driver/src/n32l40x_dac.c']
if GetDepend(['RT_USING_CLOCK_TIME']):
if GetDepend(['RT_USING_CLOCK_TIME']) or GetDepend(['RT_USING_PWM']):
src += ['n32l40x_std_periph_driver/src/n32l40x_tim.c']
if GetDepend(['RT_USING_RTC']):
@@ -33,9 +33,9 @@ if GetDepend(['RT_USING_ADC']):
if GetDepend(['RT_USING_DAC']):
src += ['n32l43x_std_periph_driver/src/n32l43x_dac.c']
if GetDepend(['RT_USING_CLOCK_TIME']):
if GetDepend(['RT_USING_CLOCK_TIME']) or GetDepend(['RT_USING_PWM']):
src += ['n32l43x_std_periph_driver/src/n32l43x_tim.c']
if GetDepend(['RT_USING_RTC']):
src += ['n32l43x_std_periph_driver/src/n32l43x_rtc.c']
src += ['n32l43x_std_periph_driver/src/n32l43x_pwr.c']
@@ -33,7 +33,7 @@ if GetDepend(['RT_USING_ADC']):
if GetDepend(['RT_USING_DAC']):
src += ['n32wb452_std_periph_driver/src/n32wb452_dac.c']
if GetDepend(['RT_USING_CLOCK_TIME']):
if GetDepend(['RT_USING_CLOCK_TIME']) or GetDepend(['RT_USING_PWM']):
src += ['n32wb452_std_periph_driver/src/n32wb452_tim.c']
if GetDepend(['RT_USING_RTC']):
@@ -45,6 +45,8 @@ if GetDepend(['RT_USING_RTC']):
if GetDepend(['RT_USING_WDT']):
src += ['drv_wdt.c']
if GetDepend(['BSP_USING_PWM']):
src += ['drv_pwm.c']
path = [cwd]
path += [cwd + '/config']
File diff suppressed because it is too large Load Diff
@@ -164,6 +164,99 @@ menu "On-chip Peripheral Drivers"
select RT_USING_CAN
default n
#-----------------------------PWM----------------------------------
menuconfig BSP_USING_PWM
bool "Enable PWM"
default n
select RT_USING_PWM
select RT_USING_HWTIMER
select RT_USING_CLOCK_TIME
if BSP_USING_PWM
menuconfig BSP_USING_TIM1_PWM
bool "Enable TIM1 output PWM"
default n
if BSP_USING_TIM1_PWM
choice
prompt "Select Pin"
default TIM1_REMAP_0
config TIM1_REMAP_0
bool "PA8 PA9 PA10 PA11"
config TIM1_REMAP_3
bool "PE9 PE11 PE13 PE14"
endchoice
config BSP_USING_TIM1_PWM_CH0
bool "Enable TIM1 CH0"
default n
config BSP_USING_TIM1_PWM_CH1
bool "Enable TIM1 CH0"
default n
config BSP_USING_TIM1_PWM_CH2
bool "Enable TIM1 CH2"
default n
config BSP_USING_TIM1_PWM_CH3
bool "Enable TIM1 CH3"
default n
endif
menuconfig BSP_USING_TIM2_PWM
bool "Enable TIM2 output PWM"
default n
if BSP_USING_TIM2_PWM
choice
prompt "Select Pin"
default TIM2_REMAP_0
config TIM2_REMAP_0
bool "PA0 PA1 PA2 PA3"
config TIM2_REMAP_1
bool "PA15 PB3 PA2 PA3"
config TIM2_REMAP_2
bool "PA0 PA1 PB10 PB11"
config TIM2_REMAP_3
bool "PA15 PB3 PB10 PB11"
endchoice
config BSP_USING_TIM2_PWM_CH0
bool "Enable TIM2 CH0"
default n
config BSP_USING_TIM2_PWM_CH1
bool "Enable TIM2 CH1"
default n
config BSP_USING_TIM2_PWM_CH2
bool "Enable TIM2 CH2"
default n
config BSP_USING_TIM2_PWM_CH3
bool "Enable TIM2 CH3"
default n
endif
menuconfig BSP_USING_TIM3_PWM
bool "Enable TIM3 output PWM"
default n
if BSP_USING_TIM3_PWM
choice
prompt "Select Pin"
default TIM3_REMAP_0
config TIM3_REMAP_0
bool "PA6 PA7 PB0 PB1"
config TIM3_REMAP_2
bool "PB4 PB5 PB0 PB1"
config TIM3_REMAP_3
bool "PC6 PC7 PC8 PC9"
endchoice
config BSP_USING_TIM3_PWM_CH0
bool "Enable TIM3 CH0"
default n
config BSP_USING_TIM3_PWM_CH1
bool "Enable TIM3 CH1"
default n
config BSP_USING_TIM3_PWM_CH2
bool "Enable TIM3 CH2"
default n
config BSP_USING_TIM3_PWM_CH3
bool "Enable TIM3 CH3"
default n
endif#BSP_USING_TIM3_PWM
endif#BSP_USING_PWM
rsource "../../libraries/n32_drivers/Kconfig"
endmenu
@@ -190,6 +190,100 @@ menu "On-chip Peripheral Drivers"
default n
endif
#-----------------------------PWM----------------------------------
menuconfig BSP_USING_PWM
bool "Enable PWM"
default n
select RT_USING_PWM
if BSP_USING_PWM
menuconfig BSP_USING_TIM1_PWM
bool "Enable TIM1 output PWM"
default n
if BSP_USING_TIM1_PWM
choice
prompt "Select Pin"
default TIM1_REMAP_0
config TIM1_REMAP_0
bool "PA8 PA9 PA10 PA11"
config TIM1_REMAP_3
bool "PE9 PE11 PE13 PE14"
endchoice
config BSP_USING_TIM1_PWM_CH0
bool "Enable TIM1 CH0"
default n
config BSP_USING_TIM1_PWM_CH1
bool "Enable TIM1 CH1"
default n
config BSP_USING_TIM1_PWM_CH2
bool "Enable TIM1 CH2"
default n
config BSP_USING_TIM1_PWM_CH3
bool "Enable TIM1 CH3"
default n
endif
menuconfig BSP_USING_TIM2_PWM
bool "Enable TIM2 output PWM"
default n
if BSP_USING_TIM2_PWM
choice
prompt "Select Pin"
default TIM2_REMAP_0
config TIM2_REMAP_0
bool "PA0 PA1 PA2 PA3"
config TIM2_REMAP_1
bool "PA15 PB3 PA2 PA3"
config TIM2_REMAP_2
bool "PA0 PA1 PB10 PB11"
config TIM2_REMAP_3
bool "PA15 PB3 PB10 PB11"
endchoice
config BSP_USING_TIM2_PWM_CH0
bool "Enable TIM2 CH0"
default n
config BSP_USING_TIM2_PWM_CH1
bool "Enable TIM2 CH1"
default n
config BSP_USING_TIM2_PWM_CH2
bool "Enable TIM2 CH2"
default n
config BSP_USING_TIM2_PWM_CH3
bool "Enable TIM2 CH3"
default n
endif
menuconfig BSP_USING_TIM3_PWM
bool "Enable TIM3 output PWM"
default n
if BSP_USING_TIM3_PWM
choice
prompt "Select Pin"
default TIM3_REMAP_0
config TIM3_REMAP_0
bool "PA6 PA7 PB0 PB1"
config TIM3_REMAP_2
bool "PB4 PB5 PB0 PB1"
config TIM3_REMAP_3
bool "PC6 PC7 PC8 PC9"
endchoice
config BSP_USING_TIM3_PWM_CH0
bool "Enable TIM3 CH0"
default n
config BSP_USING_TIM3_PWM_CH1
bool "Enable TIM3 CH1"
default n
config BSP_USING_TIM3_PWM_CH2
bool "Enable TIM3 CH2"
default n
config BSP_USING_TIM3_PWM_CH3
bool "Enable TIM3 CH3"
default n
endif#BSP_USING_TIM3_PWM
endif#BSP_USING_PWM
rsource "../../libraries/n32_drivers/Kconfig"
endmenu
@@ -189,7 +189,100 @@ menu "On-chip Peripheral Drivers"
bool "using can2"
default n
endif
#-----------------------------PWM----------------------------------
menuconfig BSP_USING_PWM
bool "Enable PWM"
default n
select RT_USING_PWM
if BSP_USING_PWM
menuconfig BSP_USING_TIM1_PWM
bool "Enable TIM1 output PWM"
default n
if BSP_USING_TIM1_PWM
choice
prompt "Select Pin"
default TIM1_REMAP_0
config TIM1_REMAP_0
bool "PA8 PA9 PA10 PA11"
config TIM1_REMAP_3
bool "PE9 PE11 PE13 PE14"
endchoice
config BSP_USING_TIM1_PWM_CH0
bool "Enable TIM1 CH0"
default n
config BSP_USING_TIM1_PWM_CH1
bool "Enable TIM1 CH1"
default n
config BSP_USING_TIM1_PWM_CH2
bool "Enable TIM1 CH2"
default n
config BSP_USING_TIM1_PWM_CH3
bool "Enable TIM1 CH3"
default n
endif
menuconfig BSP_USING_TIM2_PWM
bool "Enable TIM2 output PWM"
default n
if BSP_USING_TIM2_PWM
choice
prompt "Select Pin"
default TIM2_REMAP_0
config TIM2_REMAP_0
bool "PA0 PA1 PA2 PA3"
config TIM2_REMAP_1
bool "PA15 PB3 PA2 PA3"
config TIM2_REMAP_2
bool "PA0 PA1 PB10 PB11"
config TIM2_REMAP_3
bool "PA15 PB3 PB10 PB11"
endchoice
config BSP_USING_TIM2_PWM_CH0
bool "Enable TIM2 CH0"
default n
config BSP_USING_TIM2_PWM_CH1
bool "Enable TIM2 CH1"
default n
config BSP_USING_TIM2_PWM_CH2
bool "Enable TIM2 CH2"
default n
config BSP_USING_TIM2_PWM_CH3
bool "Enable TIM2 CH3"
default n
endif
menuconfig BSP_USING_TIM3_PWM
bool "Enable TIM3 output PWM"
default n
if BSP_USING_TIM3_PWM
choice
prompt "Select Pin"
default TIM3_REMAP_0
config TIM3_REMAP_0
bool "PA6 PA7 PB0 PB1"
config TIM3_REMAP_2
bool "PB4 PB5 PB0 PB1"
config TIM3_REMAP_3
bool "PC6 PC7 PC8 PC9"
endchoice
config BSP_USING_TIM3_PWM_CH0
bool "Enable TIM3 CH0"
default n
config BSP_USING_TIM3_PWM_CH1
bool "Enable TIM3 CH1"
default n
config BSP_USING_TIM3_PWM_CH2
bool "Enable TIM3 CH2"
default n
config BSP_USING_TIM3_PWM_CH3
bool "Enable TIM3 CH3"
default n
endif#BSP_USING_TIM3_PWM
endif#BSP_USING_PWM
rsource "../../libraries/n32_drivers/Kconfig"
endmenu
@@ -189,7 +189,101 @@ menu "On-chip Peripheral Drivers"
bool "using can2"
default n
endif
#-----------------------------PWM----------------------------------
menuconfig BSP_USING_PWM
bool "Enable PWM"
default n
select RT_USING_PWM
if BSP_USING_PWM
menuconfig BSP_USING_TIM1_PWM
bool "Enable TIM1 output PWM"
default n
if BSP_USING_TIM1_PWM
choice
prompt "Select Pin"
default TIM1_REMAP_0
config TIM1_REMAP_0
bool "PA8 PA9 PA10 PA11"
config TIM1_REMAP_3
bool "PE9 PE11 PE13 PE14"
endchoice
config BSP_USING_TIM1_PWM_CH0
bool "Enable TIM1 CH0"
default n
config BSP_USING_TIM1_PWM_CH1
bool "Enable TIM1 CH1"
default n
config BSP_USING_TIM1_PWM_CH2
bool "Enable TIM1 CH2"
default n
config BSP_USING_TIM1_PWM_CH3
bool "Enable TIM1 CH3"
default n
endif
menuconfig BSP_USING_TIM2_PWM
bool "Enable TIM2 output PWM"
default n
if BSP_USING_TIM2_PWM
choice
prompt "Select Pin"
default TIM2_REMAP_0
config TIM2_REMAP_0
bool "PA0 PA1 PA2 PA3"
config TIM2_REMAP_1
bool "PA15 PB3 PA2 PA3"
config TIM2_REMAP_2
bool "PA0 PA1 PB10 PB11"
config TIM2_REMAP_3
bool "PA15 PB3 PB10 PB11"
endchoice
config BSP_USING_TIM2_PWM_CH0
bool "Enable TIM2 CH0"
default n
config BSP_USING_TIM2_PWM_CH1
bool "Enable TIM2 CH1"
default n
config BSP_USING_TIM2_PWM_CH2
bool "Enable TIM2 CH2"
default n
config BSP_USING_TIM2_PWM_CH3
bool "Enable TIM2 CH3"
default n
endif
menuconfig BSP_USING_TIM3_PWM
bool "Enable TIM3 output PWM"
default n
if BSP_USING_TIM3_PWM
choice
prompt "Select Pin"
default TIM3_REMAP_0
config TIM3_REMAP_0
bool "PA6 PA7 PB0 PB1"
config TIM3_REMAP_2
bool "PB4 PB5 PB0 PB1"
config TIM3_REMAP_3
bool "PC6 PC7 PC8 PC9"
endchoice
config BSP_USING_TIM3_PWM_CH0
bool "Enable TIM3 CH0"
default n
config BSP_USING_TIM3_PWM_CH1
bool "Enable TIM3 CH1"
default n
config BSP_USING_TIM3_PWM_CH2
bool "Enable TIM3 CH2"
default n
config BSP_USING_TIM3_PWM_CH3
bool "Enable TIM3 CH3"
default n
endif#BSP_USING_TIM3_PWM
endif#BSP_USING_PWM
rsource "../../libraries/n32_drivers/Kconfig"
endmenu
@@ -190,6 +190,100 @@ menu "On-chip Peripheral Drivers"
default n
endif
#-----------------------------PWM----------------------------------
menuconfig BSP_USING_PWM
bool "Enable PWM"
default n
select RT_USING_PWM
if BSP_USING_PWM
menuconfig BSP_USING_TIM1_PWM
bool "Enable TIM1 output PWM"
default n
if BSP_USING_TIM1_PWM
choice
prompt "Select Pin"
default TIM1_REMAP_0
config TIM1_REMAP_0
bool "PA8 PA9 PA10 PA11"
config TIM1_REMAP_3
bool "PE9 PE11 PE13 PE14"
endchoice
config BSP_USING_TIM1_PWM_CH0
bool "Enable TIM1 CH0"
default n
config BSP_USING_TIM1_PWM_CH1
bool "Enable TIM1 CH1"
default n
config BSP_USING_TIM1_PWM_CH2
bool "Enable TIM1 CH2"
default n
config BSP_USING_TIM1_PWM_CH3
bool "Enable TIM1 CH3"
default n
endif
menuconfig BSP_USING_TIM2_PWM
bool "Enable TIM2 output PWM"
default n
if BSP_USING_TIM2_PWM
choice
prompt "Select Pin"
default TIM2_REMAP_0
config TIM2_REMAP_0
bool "PA0 PA1 PA2 PA3"
config TIM2_REMAP_1
bool "PA15 PB3 PA2 PA3"
config TIM2_REMAP_2
bool "PA0 PA1 PB10 PB11"
config TIM2_REMAP_3
bool "PA15 PB3 PB10 PB11"
endchoice
config BSP_USING_TIM2_PWM_CH0
bool "Enable TIM2 CH0"
default n
config BSP_USING_TIM2_PWM_CH1
bool "Enable TIM2 CH1"
default n
config BSP_USING_TIM2_PWM_CH2
bool "Enable TIM2 CH2"
default n
config BSP_USING_TIM2_PWM_CH3
bool "Enable TIM2 CH3"
default n
endif
menuconfig BSP_USING_TIM3_PWM
bool "Enable TIM3 output PWM"
default n
if BSP_USING_TIM3_PWM
choice
prompt "Select Pin"
default TIM3_REMAP_0
config TIM3_REMAP_0
bool "PA6 PA7 PB0 PB1"
config TIM3_REMAP_2
bool "PB4 PB5 PB0 PB1"
config TIM3_REMAP_3
bool "PC6 PC7 PC8 PC9"
endchoice
config BSP_USING_TIM3_PWM_CH0
bool "Enable TIM3 CH0"
default n
config BSP_USING_TIM3_PWM_CH1
bool "Enable TIM3 CH1"
default n
config BSP_USING_TIM3_PWM_CH2
bool "Enable TIM3 CH2"
default n
config BSP_USING_TIM3_PWM_CH3
bool "Enable TIM3 CH3"
default n
endif#BSP_USING_TIM3_PWM
endif#BSP_USING_PWM
rsource "../../libraries/n32_drivers/Kconfig"
endmenu
@@ -523,6 +523,100 @@ menu "On-chip Peripheral Drivers"
default n
endif
#-----------------------------PWM----------------------------------
menuconfig BSP_USING_PWM
bool "Enable PWM"
default n
select RT_USING_PWM
if BSP_USING_PWM
menuconfig BSP_USING_TIM1_PWM
bool "Enable TIM1 output PWM"
default n
if BSP_USING_TIM1_PWM
choice
prompt "Select Pin"
default TIM1_REMAP_0
config TIM1_REMAP_0
bool "PA8 PA9 PA10 PA11"
config TIM1_REMAP_3
bool "PE9 PE11 PE13 PE14"
endchoice
config BSP_USING_TIM1_PWM_CH0
bool "Enable TIM1 CH0"
default n
config BSP_USING_TIM1_PWM_CH1
bool "Enable TIM1 CH1"
default n
config BSP_USING_TIM1_PWM_CH2
bool "Enable TIM1 CH2"
default n
config BSP_USING_TIM1_PWM_CH3
bool "Enable TIM1 CH3"
default n
endif
menuconfig BSP_USING_TIM2_PWM
bool "Enable TIM2 output PWM"
default n
if BSP_USING_TIM2_PWM
choice
prompt "Select Pin"
default TIM2_REMAP_0
config TIM2_REMAP_0
bool "PA0 PA1 PA2 PA3"
config TIM2_REMAP_1
bool "PA15 PB3 PA2 PA3"
config TIM2_REMAP_2
bool "PA0 PA1 PB10 PB11"
config TIM2_REMAP_3
bool "PA15 PB3 PB10 PB11"
endchoice
config BSP_USING_TIM2_PWM_CH0
bool "Enable TIM2 CH0"
default n
config BSP_USING_TIM2_PWM_CH1
bool "Enable TIM2 CH1"
default n
config BSP_USING_TIM2_PWM_CH2
bool "Enable TIM2 CH2"
default n
config BSP_USING_TIM2_PWM_CH3
bool "Enable TIM2 CH3"
default n
endif
menuconfig BSP_USING_TIM3_PWM
bool "Enable TIM3 output PWM"
default n
if BSP_USING_TIM3_PWM
choice
prompt "Select Pin"
default TIM3_REMAP_0
config TIM3_REMAP_0
bool "PA6 PA7 PB0 PB1"
config TIM3_REMAP_2
bool "PB4 PB5 PB0 PB1"
config TIM3_REMAP_3
bool "PC6 PC7 PC8 PC9"
endchoice
config BSP_USING_TIM3_PWM_CH0
bool "Enable TIM3 CH0"
default n
config BSP_USING_TIM3_PWM_CH1
bool "Enable TIM3 CH1"
default n
config BSP_USING_TIM3_PWM_CH2
bool "Enable TIM3 CH2"
default n
config BSP_USING_TIM3_PWM_CH3
bool "Enable TIM3 CH3"
default n
endif#BSP_USING_TIM3_PWM
endif#BSP_USING_PWM
rsource "../../libraries/n32_drivers/Kconfig"
endmenu
@@ -189,7 +189,99 @@ menu "On-chip Peripheral Drivers"
bool "using can2"
default n
endif
#-----------------------------PWM----------------------------------
menuconfig BSP_USING_PWM
bool "Enable PWM"
default n
select RT_USING_PWM
select RT_USING_HWTIMER
select RT_USING_CLOCK_TIME
if BSP_USING_PWM
menuconfig BSP_USING_TIM1_PWM
bool "Enable TIM1 output PWM"
default n
if BSP_USING_TIM1_PWM
choice
prompt "Select Pin"
default TIM1_REMAP_0
config TIM1_REMAP_0
bool "PA8 PA9 PA10 PA11"
config TIM1_REMAP_3
bool "PE9 PE11 PE13 PE14"
endchoice
config BSP_USING_TIM1_PWM_CH0
bool "Enable TIM1 CH0"
default n
config BSP_USING_TIM1_PWM_CH1
bool "Enable TIM1 CH1"
default n
config BSP_USING_TIM1_PWM_CH2
bool "Enable TIM1 CH2"
default n
config BSP_USING_TIM1_PWM_CH3
bool "Enable TIM1 CH3"
default n
endif
menuconfig BSP_USING_TIM2_PWM
bool "Enable TIM2 output PWM"
default n
if BSP_USING_TIM2_PWM
choice
prompt "Select Pin"
default TIM2_REMAP_0
config TIM2_REMAP_0
bool "PA0 PA1 PA2 PA3"
config TIM2_REMAP_1
bool "PA15 PB3 PA2 PA3"
config TIM2_REMAP_2
bool "PA0 PA1 PB10 PB11"
config TIM2_REMAP_3
bool "PA15 PB3 PB10 PB11"
endchoice
config BSP_USING_TIM2_PWM_CH0
bool "Enable TIM2 CH0"
default n
config BSP_USING_TIM2_PWM_CH1
bool "Enable TIM2 CH1"
default n
config BSP_USING_TIM2_PWM_CH2
bool "Enable TIM2 CH2"
default n
config BSP_USING_TIM2_PWM_CH3
bool "Enable TIM2 CH3"
default n
endif
menuconfig BSP_USING_TIM3_PWM
bool "Enable TIM3 output PWM"
default n
if BSP_USING_TIM3_PWM
choice
prompt "Select Pin"
default TIM3_REMAP_0
config TIM3_REMAP_0
bool "PA6 PA7 PB0 PB1"
config TIM3_REMAP_2
bool "PB4 PB5 PB0 PB1"
config TIM3_REMAP_3
bool "PC6 PC7 PC8 PC9"
endchoice
config BSP_USING_TIM3_PWM_CH0
bool "Enable TIM3 CH0"
default n
config BSP_USING_TIM3_PWM_CH1
bool "Enable TIM3 CH1"
default n
config BSP_USING_TIM3_PWM_CH2
bool "Enable TIM3 CH2"
default n
config BSP_USING_TIM3_PWM_CH3
bool "Enable TIM3 CH3"
default n
endif#BSP_USING_TIM3_PWM
endif#BSP_USING_PWM
rsource "../../libraries/n32_drivers/Kconfig"
endmenu
+139 -1
View File
@@ -164,8 +164,146 @@ menu "On-chip Peripheral Drivers"
select RT_USING_CAN
default n
rsource "../../libraries/n32_drivers/Kconfig"
#-----------------------------PWM----------------------------------
menuconfig BSP_USING_PWM
bool "Enable PWM"
default n
select RT_USING_PWM
select RT_USING_HWTIMER
select RT_USING_CLOCK_TIME
if BSP_USING_PWM
menuconfig BSP_USING_TIM1_PWM
bool "Enable TIM1 output PWM"
default n
# --------------selcet remap-----------------
if BSP_USING_TIM1_PWM
config BSP_USING_TIM1_PWM_CH1
bool "Enable TIM1 channel 1 PA8 AF2"
default n
config BSP_USING_TIM1_PWM_CH2
bool "Enable TIM1 channel 2 PA9 AF2"
default n
config BSP_USING_TIM1_PWM_CH3
bool "Enable TIM1 channel 3 PA10 AF2"
default n
config BSP_USING_TIM1_PWM_CH4
bool "Enable TIM1 channel 4 PA11 AF2"
default n
endif#BSP_USING_TIM1_PWM
menuconfig BSP_USING_TIM2_PWM
bool "Enable TIM2 output PWM"
default n
if BSP_USING_TIM2_PWM
config BSP_USING_TIM2_PWM_CH1
bool "Enable TIM2 channel 1"
default n
if BSP_USING_TIM2_PWM_CH1
choice
prompt "Select Pin"
default TIM2_PWM_CH1_PA0
config TIM2_PWM_CH1_PA0
bool "PA0 AF2"
config TIM2_PWM_CH1_PA15
bool "PA15 AF5"
endchoice
endif
config BSP_USING_TIM2_PWM_CH2
bool "Enable TIM2 channel 2"
default n
if BSP_USING_TIM2_PWM_CH2
choice
prompt "Select Pin"
default TIM2_PWM_CH2_PA1
config TIM2_PWM_CH2_PA1
bool "PA1 AF2"
config TIM2_PWM_CH2_PB3
bool "PB3 AF2"
endchoice
endif
config BSP_USING_TIM2_PWM_CH3
bool "Enable TIM2 channel 3"
default n
if BSP_USING_TIM2_PWM_CH3
choice
prompt "Select Pin"
default TIM2_PWM_CH3_PA2
config TIM2_PWM_CH3_PA2
bool "PA2 AF2"
config TIM2_PWM_CH3_PB10
bool "PB10 AF2"
endchoice
endif
config BSP_USING_TIM2_PWM_CH4
bool "Enable TIM2 channel4 AF2 PB11"
default n
endif#BSP_USING_TIM2_PWM
menuconfig BSP_USING_TIM3_PWM
bool "Enable TIM3 output PWM"
default n
if BSP_USING_TIM3_PWM
config BSP_USING_TIM3_PWM_CH1
bool "Enable TIM3 channel 1"
default n
if BSP_USING_TIM3_PWM_CH1
choice
prompt "Select Pin"
default TIM3_PWM_CH1_PA6
config TIM3_PWM_CH1_PA6
bool "PA6 AF2"
config TIM3_PWM_CH1_PB4
bool "PB4 AF2"
config TIM3_PWM_CH1_PC6
bool "PC6 AF5"
endchoice
endif
config BSP_USING_TIM3_PWM_CH2
bool "Enable TIM3 channel 2"
default n
if BSP_USING_TIM3_PWM_CH2
choice
prompt "Select Pin"
default TIM3_PWM_CH2_PA7
config TIM3_PWM_CH2_PA7
bool "PA7 AF2"
config TIM3_PWM_CH2_PB5
bool "PB5 AF2"
config TIM3_PWM_CH2_PC7
bool "PC7 AF2"
endchoice
endif
config BSP_USING_TIM3_PWM_CH3
bool "Enable TIM3 channel 3"
default n
if BSP_USING_TIM3_PWM_CH3
choice
prompt "Select Pin"
default TIM3_PWM_CH3_PB0
config TIM3_PWM_CH3_PB0
bool "PB0 AF2"
config TIM3_PWM_CH3_PC8
bool "PC8 AF2"
endchoice
endif
config BSP_USING_TIM3_PWM_CH4
bool "Enable TIM3 channel 4 AF2 PB11"
default n
if BSP_USING_TIM3_PWM_CH4
choice
prompt "Select Pin"
default TIM3_PWM_CH4_PB1
config TIM3_PWM_CH4_PB1
bool "PB1 AF2"
config TIM3_PWM_CH4_PC9
bool "PC9 AF2"
endchoice
endif
endif #BSP_USING_TIM3_PWM
endif#BSP_USING_PWM
rsource "../../libraries/n32_drivers/Kconfig"
endmenu
menu "Board extended module Drivers"
@@ -164,6 +164,142 @@ menu "On-chip Peripheral Drivers"
select RT_USING_CAN
default n
#-----------------------------PWM----------------------------------
menuconfig BSP_USING_PWM
bool "Enable PWM"
default n
select RT_USING_PWM
select RT_USING_HWTIMER
select RT_USING_CLOCK_TIME
if BSP_USING_PWM
menuconfig BSP_USING_TIM1_PWM
bool "Enable TIM1 output PWM"
default n
if BSP_USING_TIM1_PWM
config BSP_USING_TIM1_PWM_CH1
bool "Enable TIM1 channel 1 PA8 AF2"
default n
config BSP_USING_TIM1_PWM_CH2
bool "Enable TIM1 channel 2 PA9 AF2"
default n
config BSP_USING_TIM1_PWM_CH3
bool "Enable TIM1 channel 3 PA10 AF2"
default n
config BSP_USING_TIM1_PWM_CH4
bool "Enable TIM1 channel 4 PA11 AF2"
default n
endif#BSP_USING_TIM1_PWM
menuconfig BSP_USING_TIM2_PWM
bool "Enable TIM2 output PWM"
default n
if BSP_USING_TIM2_PWM
config BSP_USING_TIM2_PWM_CH1
bool "Enable TIM2 channel 1"
default n
if BSP_USING_TIM2_PWM_CH1
choice
prompt "Select Pin"
default TIM2_PWM_CH1_PA0
config TIM2_PWM_CH1_PA0
bool "PA0 AF2"
config TIM2_PWM_CH1_PA15
bool "PA15 AF5"
endchoice
endif
config BSP_USING_TIM2_PWM_CH2
bool "Enable TIM2 channel 2"
default n
if BSP_USING_TIM2_PWM_CH2
choice
prompt "Select Pin"
default TIM2_PWM_CH2_PA1
config TIM2_PWM_CH2_PA1
bool "PA1 AF2"
config TIM2_PWM_CH2_PB3
bool "PB3 AF2"
endchoice
endif
config BSP_USING_TIM2_PWM_CH3
bool "Enable TIM2 channel 3"
default n
if BSP_USING_TIM2_PWM_CH3
choice
prompt "Select Pin"
default TIM2_PWM_CH3_PA2
config TIM2_PWM_CH3_PA2
bool "PA2 AF2"
config TIM2_PWM_CH3_PB10
bool "PB10 AF2"
endchoice
endif
config BSP_USING_TIM2_PWM_CH4
bool "Enable TIM2 channel 4 AF2 PB11"
default n
endif#BSP_USING_TIM2_PWM
menuconfig BSP_USING_TIM3_PWM
bool "Enable TIM3 output PWM"
default n
if BSP_USING_TIM3_PWM
config BSP_USING_TIM3_PWM_CH1
bool "Enable TIM3 channel 1"
default n
if BSP_USING_TIM3_PWM_CH1
choice
prompt "Select Pin"
default TIM3_PWM_CH1_PA6
config TIM3_PWM_CH1_PA6
bool "PA6 AF2"
config TIM3_PWM_CH1_PB4
bool "PB4 AF2"
config TIM3_PWM_CH1_PC6
bool "PC6 AF5"
endchoice
endif
config BSP_USING_TIM3_PWM_CH2
bool "Enable TIM3 channel 2"
default n
if BSP_USING_TIM3_PWM_CH2
choice
prompt "Select Pin"
default TIM3_PWM_CH2_PA7
config TIM3_PWM_CH2_PA7
bool "PA7 AF2"
config TIM3_PWM_CH2_PB5
bool "PB5 AF2"
config TIM3_PWM_CH2_PC7
bool "PC7 AF2"
endchoice
endif
config BSP_USING_TIM3_PWM_CH3
bool "Enable TIM3 channel 3"
default n
if BSP_USING_TIM3_PWM_CH3
choice
prompt "Select Pin"
default TIM3_PWM_CH3_PB0
config TIM3_PWM_CH3_PB0
bool "PB0 AF2"
config TIM3_PWM_CH3_PC8
bool "PC8 AF2"
endchoice
endif
config BSP_USING_TIM3_PWM_CH4
bool "Enable TIM3 channel 4 AF2 PB11"
default n
if BSP_USING_TIM3_PWM_CH4
choice
prompt "Select Pin"
default TIM3_PWM_CH4_PB1
config TIM3_PWM_CH4_PB1
bool "PB1 AF2"
config TIM3_PWM_CH4_PC9
bool "PC9 AF2"
endchoice
endif
endif #BSP_USING_TIM3_PWM
endif#BSP_USING_PWM
rsource "../../libraries/n32_drivers/Kconfig"
endmenu
@@ -163,7 +163,143 @@ menu "On-chip Peripheral Drivers"
bool "Enable CAN"
select RT_USING_CAN
default n
#-----------------------------PWM----------------------------------
menuconfig BSP_USING_PWM
bool "Enable PWM"
default n
select RT_USING_PWM
select RT_USING_HWTIMER
select RT_USING_CLOCK_TIME
if BSP_USING_PWM
menuconfig BSP_USING_TIM1_PWM
bool "Enable TIM1 output PWM"
default n
if BSP_USING_TIM1_PWM
config BSP_USING_TIM1_PWM_CH1
bool "Enable TIM1 channel 1 PA8 AF2"
default n
config BSP_USING_TIM1_PWM_CH2
bool "Enable TIM1 channel 2 PA9 AF2"
default n
config BSP_USING_TIM1_PWM_CH3
bool "Enable TIM1 channel 3 PA10 AF2"
default n
config BSP_USING_TIM1_PWM_CH4
bool "Enable TIM1 channel 4 PA11 AF2"
default n
endif#BSP_USING_TIM1_PWM
menuconfig BSP_USING_TIM2_PWM
bool "Enable TIM2 output PWM"
default n
if BSP_USING_TIM2_PWM
config BSP_USING_TIM2_PWM_CH1
bool "Enable TIM2 channel 1"
default n
if BSP_USING_TIM2_PWM_CH1
choice
prompt "Select Pin"
default TIM2_PWM_CH1_PA0
config TIM2_PWM_CH1_PA0
bool "PA0 AF2"
config TIM2_PWM_CH1_PA15
bool "PA15 AF5"
endchoice
endif
config BSP_USING_TIM2_PWM_CH2
bool "Enable TIM2 channel 2"
default n
if BSP_USING_TIM2_PWM_CH2
choice
prompt "Select Pin"
default TIM2_PWM_CH2_PA1
config TIM2_PWM_CH2_PA1
bool "PA1 AF2"
config TIM2_PWM_CH2_PB3
bool "PB3 AF2"
endchoice
endif
config BSP_USING_TIM2_PWM_CH3
bool "Enable TIM2 channel 3"
default n
if BSP_USING_TIM2_PWM_CH3
choice
prompt "Select Pin"
default TIM2_PWM_CH3_PA2
config TIM2_PWM_CH3_PA2
bool "PA2 AF2"
config TIM2_PWM_CH3_PB10
bool "PB10 AF2"
endchoice
endif
config BSP_USING_TIM2_PWM_CH4
bool "Enable TIM2 channel 4 AF2 PB11"
default n
endif#BSP_USING_TIM2_PWM
menuconfig BSP_USING_TIM3_PWM
bool "Enable TIM3 output PWM"
default n
if BSP_USING_TIM3_PWM
config BSP_USING_TIM3_PWM_CH1
bool "Enable TIM3 channel 1"
default n
if BSP_USING_TIM3_PWM_CH1
choice
prompt "Select Pin"
default TIM3_PWM_CH1_PA6
config TIM3_PWM_CH1_PA6
bool "PA6 AF2"
config TIM3_PWM_CH1_PB4
bool "PB4 AF2"
config TIM3_PWM_CH1_PC6
bool "PC6 AF5"
endchoice
endif
config BSP_USING_TIM3_PWM_CH2
bool "Enable TIM3 channel 2"
default n
if BSP_USING_TIM3_PWM_CH2
choice
prompt "Select Pin"
default TIM3_PWM_CH2_PA7
config TIM3_PWM_CH2_PA7
bool "PA7 AF2"
config TIM3_PWM_CH2_PB5
bool "PB5 AF2"
config TIM3_PWM_CH2_PC7
bool "PC7 AF2"
endchoice
endif
config BSP_USING_TIM3_PWM_CH3
bool "Enable TIM3 channel 3"
default n
if BSP_USING_TIM3_PWM_CH3
choice
prompt "Select Pin"
default TIM3_PWM_CH3_PB0
config TIM3_PWM_CH3_PB0
bool "PB0 AF2"
config TIM3_PWM_CH3_PC8
bool "PC8 AF2"
endchoice
endif
config BSP_USING_TIM3_PWM_CH4
bool "Enable TIM3 channel 4 AF2 PB11"
default n
if BSP_USING_TIM3_PWM_CH4
choice
prompt "Select Pin"
default TIM3_PWM_CH4_PB1
config TIM3_PWM_CH4_PB1
bool "PB1 AF2"
config TIM3_PWM_CH4_PC9
bool "PC9 AF2"
endchoice
endif
endif #BSP_USING_TIM3_PWM
endif#BSP_USING_PWM
rsource "../../libraries/n32_drivers/Kconfig"
endmenu
@@ -164,6 +164,142 @@ menu "On-chip Peripheral Drivers"
select RT_USING_CAN
default n
#-----------------------------PWM----------------------------------
menuconfig BSP_USING_PWM
bool "Enable PWM"
default n
select RT_USING_PWM
select RT_USING_HWTIMER
select RT_USING_CLOCK_TIME
if BSP_USING_PWM
menuconfig BSP_USING_TIM1_PWM
bool "Enable TIM1 output PWM"
default n
if BSP_USING_TIM1_PWM
config BSP_USING_TIM1_PWM_CH1
bool "Enable TIM1 channel 1 PA8 AF2"
default n
config BSP_USING_TIM1_PWM_CH2
bool "Enable TIM1 channel 2 PA9 AF2"
default n
config BSP_USING_TIM1_PWM_CH3
bool "Enable TIM1 channel 3 PA10 AF2"
default n
config BSP_USING_TIM1_PWM_CH4
bool "Enable TIM1 channel 4 PA11 AF2"
default n
endif#BSP_USING_TIM1_PWM
menuconfig BSP_USING_TIM2_PWM
bool "Enable TIM2 output PWM"
default n
if BSP_USING_TIM2_PWM
config BSP_USING_TIM2_PWM_CH1
bool "Enable TIM2 channel 1"
default n
if BSP_USING_TIM2_PWM_CH1
choice
prompt "Select Pin"
default TIM2_PWM_CH1_PA0
config TIM2_PWM_CH1_PA0
bool "PA0 AF2"
config TIM2_PWM_CH1_PA15
bool "PA15 AF5"
endchoice
endif
config BSP_USING_TIM2_PWM_CH2
bool "Enable TIM2 channel 2"
default n
if BSP_USING_TIM2_PWM_CH2
choice
prompt "Select Pin"
default TIM2_PWM_CH2_PA1
config TIM2_PWM_CH2_PA1
bool "PA1 AF2"
config TIM2_PWM_CH2_PB3
bool "PB3 AF2"
endchoice
endif
config BSP_USING_TIM2_PWM_CH3
bool "Enable TIM2 channel 3"
default n
if BSP_USING_TIM2_PWM_CH3
choice
prompt "Select Pin"
default TIM2_PWM_CH3_PA2
config TIM2_PWM_CH3_PA2
bool "PA2 AF2"
config TIM2_PWM_CH3_PB10
bool "PB10 AF2"
endchoice
endif
config BSP_USING_TIM2_PWM_CH4
bool "Enable TIM2 channel 4 AF2 PB11"
default n
endif#BSP_USING_TIM2_PWM
menuconfig BSP_USING_TIM3_PWM
bool "Enable TIM3 output PWM"
default n
if BSP_USING_TIM3_PWM
config BSP_USING_TIM3_PWM_CH1
bool "Enable TIM3 channel 1"
default n
if BSP_USING_TIM3_PWM_CH1
choice
prompt "Select Pin"
default TIM3_PWM_CH1_PA6
config TIM3_PWM_CH1_PA6
bool "PA6 AF2"
config TIM3_PWM_CH1_PB4
bool "PB4 AF2"
config TIM3_PWM_CH1_PC6
bool "PC6 AF5"
endchoice
endif
config BSP_USING_TIM3_PWM_CH2
bool "Enable TIM3 channel 2"
default n
if BSP_USING_TIM3_PWM_CH2
choice
prompt "Select Pin"
default TIM3_PWM_CH2_PA7
config TIM3_PWM_CH2_PA7
bool "PA7 AF2"
config TIM3_PWM_CH2_PB5
bool "PB5 AF2"
config TIM3_PWM_CH2_PC7
bool "PC7 AF2"
endchoice
endif
config BSP_USING_TIM3_PWM_CH3
bool "Enable TIM3 channel 3"
default n
if BSP_USING_TIM3_PWM_CH3
choice
prompt "Select Pin"
default TIM3_PWM_CH3_PB0
config TIM3_PWM_CH3_PB0
bool "PB0 AF2"
config TIM3_PWM_CH3_PC8
bool "PC8 AF2"
endchoice
endif
config BSP_USING_TIM3_PWM_CH4
bool "Enable TIM3 channel 4 AF2 PB11"
default n
if BSP_USING_TIM3_PWM_CH4
choice
prompt "Select Pin"
default TIM3_PWM_CH4_PB1
config TIM3_PWM_CH4_PB1
bool "PB1 AF2"
config TIM3_PWM_CH4_PC9
bool "PC9 AF2"
endchoice
endif
endif #BSP_USING_TIM3_PWM
endif#BSP_USING_PWM
rsource "../../libraries/n32_drivers/Kconfig"
endmenu
@@ -184,6 +184,101 @@ menu "On-chip Peripheral Drivers"
default n
endif
#-----------------------------PWM----------------------------------
menuconfig BSP_USING_PWM
bool "Enable PWM"
default n
select RT_USING_PWM
select RT_USING_HWTIMER
select RT_USING_CLOCK_TIME
if BSP_USING_PWM
menuconfig BSP_USING_TIM1_PWM
bool "Enable TIM1 output PWM"
default n
if BSP_USING_TIM1_PWM
choice
prompt "Select Pin"
default TIM1_REMAP_0
config TIM1_REMAP_0
bool "PA8 PA9 PA10 PA11"
config TIM1_REMAP_3
bool "PE9 PE11 PE13 PE14"
endchoice
config BSP_USING_TIM1_PWM_CH0
bool "Enable TIM1 CH0"
default n
config BSP_USING_TIM1_PWM_CH1
bool "Enable TIM1 CH1"
default n
config BSP_USING_TIM1_PWM_CH2
bool "Enable TIM1 CH2"
default n
config BSP_USING_TIM1_PWM_CH3
bool "Enable TIM1 CH3"
default n
endif
menuconfig BSP_USING_TIM2_PWM
bool "Enable TIM2 output PWM"
default n
if BSP_USING_TIM2_PWM
choice
prompt "Select Pin"
default TIM2_REMAP_0
config TIM2_REMAP_0
bool "PA0 PA1 PA2 PA3"
config TIM2_REMAP_1
bool "PA15 PB3 PA2 PA3"
config TIM2_REMAP_2
bool "PA0 PA1 PB10 PB11"
config TIM2_REMAP_3
bool "PA15 PB3 PB10 PB11"
endchoice
config BSP_USING_TIM2_PWM_CH0
bool "Enable TIM2 CH0"
default n
config BSP_USING_TIM2_PWM_CH1
bool "Enable TIM2 CH1"
default n
config BSP_USING_TIM2_PWM_CH2
bool "Enable TIM2 CH2"
default n
config BSP_USING_TIM2_PWM_CH3
bool "Enable TIM2 CH3"
default n
endif
menuconfig BSP_USING_TIM3_PWM
bool "Enable TIM3 output PWM"
default n
if BSP_USING_TIM3_PWM
choice
prompt "Select Pin"
default TIM3_REMAP_0
config TIM3_REMAP_0
bool "PA6 PA7 PB0 PB1"
config TIM3_REMAP_2
bool "PB4 PB5 PB0 PB1"
config TIM3_REMAP_3
bool "PC6 PC7 PC8 PC9"
endchoice
config BSP_USING_TIM3_PWM_CH0
bool "Enable TIM3 CH0"
default n
config BSP_USING_TIM3_PWM_CH1
bool "Enable TIM3 CH1"
default n
config BSP_USING_TIM3_PWM_CH2
bool "Enable TIM3 CH2"
default n
config BSP_USING_TIM3_PWM_CH3
bool "Enable TIM3 CH3"
default n
endif#BSP_USING_TIM3_PWM
endif#BSP_USING_PWM
rsource "../../libraries/n32_drivers/Kconfig"
endmenu