File tree Expand file tree Collapse file tree 3 files changed +92
-0
lines changed
libraries/HAL_Drivers/drivers/config Expand file tree Collapse file tree 3 files changed +92
-0
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,11 @@ extern "C"
8787
8888#ifdef SOC_SERIES_R7FA2E2
8989#include "ra2e2/uart_config.h"
90+
91+ #ifdef BSP_USING_PWM
92+ #include "ra2e2/pwm_config.h"
93+ #endif
94+
9095#endif /* SOC_SERIES_R7FA2E2 */
9196
9297#ifdef SOC_SERIES_R7FA2L1
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (c) 2006-2025, RT-Thread Development Team
3+ *
4+ * SPDX-License-Identifier: Apache-2.0
5+ *
6+ * Change Logs:
7+ * Date Author Notes
8+ * 2025-08-17 CYFS first version
9+ */
10+ #ifndef __PWM_CONFIG_H__
11+ #define __PWM_CONFIG_H__
12+
13+ #include <rtthread.h>
14+ #include <drv_config.h>
15+ #include "hal_data.h"
16+
17+ #ifdef __cplusplus
18+ extern "C" {
19+ #endif
20+
21+ enum
22+ {
23+ #ifdef BSP_USING_PWM4
24+ BSP_PWM4_INDEX ,
25+ #endif
26+ #ifdef BSP_USING_PWM5
27+ BSP_PWM5_INDEX ,
28+ #endif
29+ #ifdef BSP_USING_PWM6
30+ BSP_PWM6_INDEX ,
31+ #endif
32+ #ifdef BSP_USING_PWM7
33+ BSP_PWM7_INDEX ,
34+ #endif
35+ #ifdef BSP_USING_PWM8
36+ BSP_PWM8_INDEX ,
37+ #endif
38+ #ifdef BSP_USING_PWM9
39+ BSP_PWM9_INDEX ,
40+ #endif
41+ BSP_PWMS_NUM
42+ };
43+
44+ #define PWM_DRV_INITIALIZER (num ) \
45+ { \
46+ .name = "pwm"#num , \
47+ .g_cfg = &g_timer##num##_cfg, \
48+ .g_ctrl = &g_timer##num##_ctrl, \
49+ .g_timer = &g_timer##num, \
50+ }
51+
52+ #ifdef __cplusplus
53+ }
54+ #endif
55+
56+ #endif /* __PWM_CONFIG_H__ */
Original file line number Diff line number Diff line change @@ -63,6 +63,37 @@ menu "Hardware Drivers Config"
6363 default n
6464 endif
6565
66+ menuconfig BSP_USING_PWM
67+ bool "Enable PWM"
68+ default n
69+ select RT_USING_PWM
70+ if BSP_USING_PWM
71+ config BSP_USING_PWM4
72+ bool "Enable GPT4 (16-Bits) output PWM"
73+ default n
74+
75+ config BSP_USING_PWM5
76+ bool "Enable GPT5 (16-Bits) output PWM"
77+ default n
78+
79+ config BSP_USING_PWM6
80+ bool "Enable GPT6 (16-Bits) output PWM"
81+ default n
82+
83+ config BSP_USING_PWM7
84+ bool "Enable GPT7 (16-Bits) output PWM"
85+ default n
86+
87+ config BSP_USING_PWM8
88+ bool "Enable GPT8 (16-Bits) output PWM"
89+ default n
90+
91+ config BSP_USING_PWM9
92+ bool "Enable GPT9 (16-Bits) output PWM"
93+ default n
94+
95+ endif
96+
6697 endmenu
6798
6899 menu "Board extended module Drivers"
You can’t perform that action at this time.
0 commit comments