Skip to content

Commit c0b86f9

Browse files
committed
[feat]add all timer Kconfig config
[fix] Timer Channel 1 PWM no output issue
1 parent 663a21e commit c0b86f9

10 files changed

Lines changed: 1158 additions & 198 deletions

File tree

bsp/n32/n32gxx_lxx/libraries/n32_drivers/drv_pwm.c

Lines changed: 524 additions & 194 deletions
Large diffs are not rendered by default.

bsp/n32/n32gxx_lxx/n32g457qel-stb/board/Kconfig

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,76 @@ menu "On-chip Peripheral Drivers"
282282
bool "Enable TIM3 CH3"
283283
default n
284284
endif#BSP_USING_TIM3_PWM
285+
286+
menuconfig BSP_USING_TIM4_PWM
287+
bool "Enable TIM4 output PWM"
288+
default n
289+
if BSP_USING_TIM4_PWM
290+
choice
291+
prompt "Select Pin"
292+
default TIM4_PB6_PB7_PB8_PB9
293+
config TIM4_PB6_PB7_PB8_PB9
294+
bool "PB6 PB7 PB8 PB9"
295+
config TIM4_PD12_PD13_PD14_PD15
296+
bool "PD12 PD13 PD14 PD15"
297+
endchoice
298+
config BSP_USING_TIM4_PWM_CH0
299+
bool "Enable TIM4 CH0"
300+
default n
301+
config BSP_USING_TIM4_PWM_CH1
302+
bool "Enable TIM4 CH1"
303+
default n
304+
config BSP_USING_TIM4_PWM_CH2
305+
bool "Enable TIM4 CH2"
306+
default n
307+
config BSP_USING_TIM4_PWM_CH3
308+
bool "Enable TIM4 CH3"
309+
default n
310+
endif#BSP_USING_TIM4_PWM
311+
312+
menuconfig BSP_USING_TIM5_PWM
313+
bool "Enable TIM5 output PWM "
314+
default n
315+
if BSP_USING_TIM5_PWM
316+
config BSP_USING_TIM5_PWM_CH0
317+
bool "Enable TIM5 CH0 PA0"
318+
default n
319+
config BSP_USING_TIM5_PWM_CH1
320+
bool "Enable TIM5 CH1 PA1"
321+
default n
322+
config BSP_USING_TIM5_PWM_CH2
323+
bool "Enable TIM5 CH2 PA2"
324+
default n
325+
config BSP_USING_TIM5_PWM_CH3
326+
bool "Enable TIM5 CH3 PA3"
327+
default n
328+
endif#BSP_USING_TIM5_PWM
329+
330+
menuconfig BSP_USING_TIM8_PWM
331+
bool "Enable TIM8 output PWM"
332+
default n
333+
if BSP_USING_TIM8_PWM
334+
choice
335+
prompt "Select Pin"
336+
default TIM8_PC6_PC7_PC8_PC9
337+
config TIM8_PC6_PC7_PC8_PC9
338+
bool "PC6 PC7 PC8 PC9"
339+
config TIM8_PD14_PD15_PC8_PC9
340+
bool "PD14 PD15 PC8 PC9"
341+
endchoice
342+
config BSP_USING_TIM8_PWM_CH0
343+
bool "Enable TIM8 CH0"
344+
default n
345+
config BSP_USING_TIM8_PWM_CH1
346+
bool "Enable TIM8 CH1"
347+
default n
348+
config BSP_USING_TIM8_PWM_CH2
349+
bool "Enable TIM8 CH2"
350+
default n
351+
config BSP_USING_TIM8_PWM_CH3
352+
bool "Enable TIM8 CH3"
353+
default n
354+
endif#BSP_USING_TIM8_PWM
285355

286356
endif#BSP_USING_PWM
287357
rsource "../../libraries/n32_drivers/Kconfig"

bsp/n32/n32gxx_lxx/n32g45xcl-stb/board/Kconfig

Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,76 @@ menu "On-chip Peripheral Drivers"
281281
bool "Enable TIM3 CH3"
282282
default n
283283
endif#BSP_USING_TIM3_PWM
284-
284+
285+
menuconfig BSP_USING_TIM4_PWM
286+
bool "Enable TIM4 output PWM"
287+
default n
288+
if BSP_USING_TIM4_PWM
289+
choice
290+
prompt "Select Pin"
291+
default TIM4_PB6_PB7_PB8_PB9
292+
config TIM4_PB6_PB7_PB8_PB9
293+
bool "PB6 PB7 PB8 PB9"
294+
config TIM4_PD12_PD13_PD14_PD15
295+
bool "PD12 PD13 PD14 PD15"
296+
endchoice
297+
config BSP_USING_TIM4_PWM_CH0
298+
bool "Enable TIM4 CH0"
299+
default n
300+
config BSP_USING_TIM4_PWM_CH1
301+
bool "Enable TIM4 CH1"
302+
default n
303+
config BSP_USING_TIM4_PWM_CH2
304+
bool "Enable TIM4 CH2"
305+
default n
306+
config BSP_USING_TIM4_PWM_CH3
307+
bool "Enable TIM4 CH3"
308+
default n
309+
endif#BSP_USING_TIM4_PWM
310+
311+
menuconfig BSP_USING_TIM5_PWM
312+
bool "Enable TIM5 output PWM "
313+
default n
314+
if BSP_USING_TIM5_PWM
315+
config BSP_USING_TIM5_PWM_CH0
316+
bool "Enable TIM5 CH0 PA0"
317+
default n
318+
config BSP_USING_TIM5_PWM_CH1
319+
bool "Enable TIM5 CH1 PA1"
320+
default n
321+
config BSP_USING_TIM5_PWM_CH2
322+
bool "Enable TIM5 CH2 PA2"
323+
default n
324+
config BSP_USING_TIM5_PWM_CH3
325+
bool "Enable TIM5 CH3 PA3"
326+
default n
327+
endif#BSP_USING_TIM5_PWM
328+
329+
menuconfig BSP_USING_TIM8_PWM
330+
bool "Enable TIM8 output PWM"
331+
default n
332+
if BSP_USING_TIM8_PWM
333+
choice
334+
prompt "Select Pin"
335+
default TIM8_PC6_PC7_PC8_PC9
336+
config TIM8_PC6_PC7_PC8_PC9
337+
bool "PC6 PC7 PC8 PC9"
338+
config TIM8_PD14_PD15_PC8_PC9
339+
bool "PD14 PD15 PC8 PC9"
340+
endchoice
341+
config BSP_USING_TIM8_PWM_CH0
342+
bool "Enable TIM8 CH0"
343+
default n
344+
config BSP_USING_TIM8_PWM_CH1
345+
bool "Enable TIM8 CH1"
346+
default n
347+
config BSP_USING_TIM8_PWM_CH2
348+
bool "Enable TIM8 CH2"
349+
default n
350+
config BSP_USING_TIM8_PWM_CH3
351+
bool "Enable TIM8 CH3"
352+
default n
353+
endif#BSP_USING_TIM8_PWM
285354
endif#BSP_USING_PWM
286355
rsource "../../libraries/n32_drivers/Kconfig"
287356

bsp/n32/n32gxx_lxx/n32g45xml-stb/board/Kconfig

Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,76 @@ menu "On-chip Peripheral Drivers"
282282
bool "Enable TIM3 CH3"
283283
default n
284284
endif#BSP_USING_TIM3_PWM
285-
285+
286+
menuconfig BSP_USING_TIM4_PWM
287+
bool "Enable TIM4 output PWM"
288+
default n
289+
if BSP_USING_TIM4_PWM
290+
choice
291+
prompt "Select Pin"
292+
default TIM4_PB6_PB7_PB8_PB9
293+
config TIM4_PB6_PB7_PB8_PB9
294+
bool "PB6 PB7 PB8 PB9"
295+
config TIM4_PD12_PD13_PD14_PD15
296+
bool "PD12 PD13 PD14 PD15"
297+
endchoice
298+
config BSP_USING_TIM4_PWM_CH0
299+
bool "Enable TIM4 CH0"
300+
default n
301+
config BSP_USING_TIM4_PWM_CH1
302+
bool "Enable TIM4 CH1"
303+
default n
304+
config BSP_USING_TIM4_PWM_CH2
305+
bool "Enable TIM4 CH2"
306+
default n
307+
config BSP_USING_TIM4_PWM_CH3
308+
bool "Enable TIM4 CH3"
309+
default n
310+
endif#BSP_USING_TIM4_PWM
311+
312+
menuconfig BSP_USING_TIM5_PWM
313+
bool "Enable TIM5 output PWM "
314+
default n
315+
if BSP_USING_TIM5_PWM
316+
config BSP_USING_TIM5_PWM_CH0
317+
bool "Enable TIM5 CH0 PA0"
318+
default n
319+
config BSP_USING_TIM5_PWM_CH1
320+
bool "Enable TIM5 CH1 PA1"
321+
default n
322+
config BSP_USING_TIM5_PWM_CH2
323+
bool "Enable TIM5 CH2 PA2"
324+
default n
325+
config BSP_USING_TIM5_PWM_CH3
326+
bool "Enable TIM5 CH3 PA3"
327+
default n
328+
endif#BSP_USING_TIM5_PWM
329+
330+
menuconfig BSP_USING_TIM8_PWM
331+
bool "Enable TIM8 output PWM"
332+
default n
333+
if BSP_USING_TIM8_PWM
334+
choice
335+
prompt "Select Pin"
336+
default TIM8_PC6_PC7_PC8_PC9
337+
config TIM8_PC6_PC7_PC8_PC9
338+
bool "PC6 PC7 PC8 PC9"
339+
config TIM8_PD14_PD15_PC8_PC9
340+
bool "PD14 PD15 PC8 PC9"
341+
endchoice
342+
config BSP_USING_TIM8_PWM_CH0
343+
bool "Enable TIM8 CH0"
344+
default n
345+
config BSP_USING_TIM8_PWM_CH1
346+
bool "Enable TIM8 CH1"
347+
default n
348+
config BSP_USING_TIM8_PWM_CH2
349+
bool "Enable TIM8 CH2"
350+
default n
351+
config BSP_USING_TIM8_PWM_CH3
352+
bool "Enable TIM8 CH3"
353+
default n
354+
endif#BSP_USING_TIM8_PWM
286355
endif#BSP_USING_PWM
287356
rsource "../../libraries/n32_drivers/Kconfig"
288357

bsp/n32/n32gxx_lxx/n32g45xrl-stb/board/Kconfig

Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,76 @@ menu "On-chip Peripheral Drivers"
282282
bool "Enable TIM3 CH3"
283283
default n
284284
endif#BSP_USING_TIM3_PWM
285-
285+
286+
menuconfig BSP_USING_TIM4_PWM
287+
bool "Enable TIM4 output PWM"
288+
default n
289+
if BSP_USING_TIM4_PWM
290+
choice
291+
prompt "Select Pin"
292+
default TIM4_PB6_PB7_PB8_PB9
293+
config TIM4_PB6_PB7_PB8_PB9
294+
bool "PB6 PB7 PB8 PB9"
295+
config TIM4_PD12_PD13_PD14_PD15
296+
bool "PD12 PD13 PD14 PD15"
297+
endchoice
298+
config BSP_USING_TIM4_PWM_CH0
299+
bool "Enable TIM4 CH0"
300+
default n
301+
config BSP_USING_TIM4_PWM_CH1
302+
bool "Enable TIM4 CH1"
303+
default n
304+
config BSP_USING_TIM4_PWM_CH2
305+
bool "Enable TIM4 CH2"
306+
default n
307+
config BSP_USING_TIM4_PWM_CH3
308+
bool "Enable TIM4 CH3"
309+
default n
310+
endif#BSP_USING_TIM4_PWM
311+
312+
menuconfig BSP_USING_TIM5_PWM
313+
bool "Enable TIM5 output PWM "
314+
default n
315+
if BSP_USING_TIM5_PWM
316+
config BSP_USING_TIM5_PWM_CH0
317+
bool "Enable TIM5 CH0 PA0"
318+
default n
319+
config BSP_USING_TIM5_PWM_CH1
320+
bool "Enable TIM5 CH1 PA1"
321+
default n
322+
config BSP_USING_TIM5_PWM_CH2
323+
bool "Enable TIM5 CH2 PA2"
324+
default n
325+
config BSP_USING_TIM5_PWM_CH3
326+
bool "Enable TIM5 CH3 PA3"
327+
default n
328+
endif#BSP_USING_TIM5_PWM
329+
330+
menuconfig BSP_USING_TIM8_PWM
331+
bool "Enable TIM8 output PWM"
332+
default n
333+
if BSP_USING_TIM8_PWM
334+
choice
335+
prompt "Select Pin"
336+
default TIM8_PC6_PC7_PC8_PC9
337+
config TIM8_PC6_PC7_PC8_PC9
338+
bool "PC6 PC7 PC8 PC9"
339+
config TIM8_PD14_PD15_PC8_PC9
340+
bool "PD14 PD15 PC8 PC9"
341+
endchoice
342+
config BSP_USING_TIM8_PWM_CH0
343+
bool "Enable TIM8 CH0"
344+
default n
345+
config BSP_USING_TIM8_PWM_CH1
346+
bool "Enable TIM8 CH1"
347+
default n
348+
config BSP_USING_TIM8_PWM_CH2
349+
bool "Enable TIM8 CH2"
350+
default n
351+
config BSP_USING_TIM8_PWM_CH3
352+
bool "Enable TIM8 CH3"
353+
default n
354+
endif#BSP_USING_TIM8_PWM
286355
endif#BSP_USING_PWM
287356
rsource "../../libraries/n32_drivers/Kconfig"
288357

bsp/n32/n32gxx_lxx/n32g45xvl-stb/board/Kconfig

Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,76 @@ menu "On-chip Peripheral Drivers"
615615
bool "Enable TIM3 CH3"
616616
default n
617617
endif#BSP_USING_TIM3_PWM
618-
618+
619+
menuconfig BSP_USING_TIM4_PWM
620+
bool "Enable TIM4 output PWM"
621+
default n
622+
if BSP_USING_TIM4_PWM
623+
choice
624+
prompt "Select Pin"
625+
default TIM4_PB6_PB7_PB8_PB9
626+
config TIM4_PB6_PB7_PB8_PB9
627+
bool "PB6 PB7 PB8 PB9"
628+
config TIM4_PD12_PD13_PD14_PD15
629+
bool "PD12 PD13 PD14 PD15"
630+
endchoice
631+
config BSP_USING_TIM4_PWM_CH0
632+
bool "Enable TIM4 CH0"
633+
default n
634+
config BSP_USING_TIM4_PWM_CH1
635+
bool "Enable TIM4 CH1"
636+
default n
637+
config BSP_USING_TIM4_PWM_CH2
638+
bool "Enable TIM4 CH2"
639+
default n
640+
config BSP_USING_TIM4_PWM_CH3
641+
bool "Enable TIM4 CH3"
642+
default n
643+
endif#BSP_USING_TIM4_PWM
644+
645+
menuconfig BSP_USING_TIM5_PWM
646+
bool "Enable TIM5 output PWM "
647+
default n
648+
if BSP_USING_TIM5_PWM
649+
config BSP_USING_TIM5_PWM_CH0
650+
bool "Enable TIM5 CH0 PA0"
651+
default n
652+
config BSP_USING_TIM5_PWM_CH1
653+
bool "Enable TIM5 CH1 PA1"
654+
default n
655+
config BSP_USING_TIM5_PWM_CH2
656+
bool "Enable TIM5 CH2 PA2"
657+
default n
658+
config BSP_USING_TIM5_PWM_CH3
659+
bool "Enable TIM5 CH3 PA3"
660+
default n
661+
endif#BSP_USING_TIM5_PWM
662+
663+
menuconfig BSP_USING_TIM8_PWM
664+
bool "Enable TIM8 output PWM"
665+
default n
666+
if BSP_USING_TIM8_PWM
667+
choice
668+
prompt "Select Pin"
669+
default TIM8_PC6_PC7_PC8_PC9
670+
config TIM8_PC6_PC7_PC8_PC9
671+
bool "PC6 PC7 PC8 PC9"
672+
config TIM8_PD14_PD15_PC8_PC9
673+
bool "PD14 PD15 PC8 PC9"
674+
endchoice
675+
config BSP_USING_TIM8_PWM_CH0
676+
bool "Enable TIM8 CH0"
677+
default n
678+
config BSP_USING_TIM8_PWM_CH1
679+
bool "Enable TIM8 CH1"
680+
default n
681+
config BSP_USING_TIM8_PWM_CH2
682+
bool "Enable TIM8 CH2"
683+
default n
684+
config BSP_USING_TIM8_PWM_CH3
685+
bool "Enable TIM8 CH3"
686+
default n
687+
endif#BSP_USING_TIM8_PWM
619688
endif#BSP_USING_PWM
620689
rsource "../../libraries/n32_drivers/Kconfig"
621690

0 commit comments

Comments
 (0)