Skip to content

Commit 84d20ef

Browse files
committed
在pwm_config里新增对BSP_USING_PWM10到BSP_USING_PWM12的定义
1 parent a5eb2fa commit 84d20ef

File tree

5 files changed

+257
-0
lines changed

5 files changed

+257
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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+
11+
#ifndef __ADC_CONFIG_H__
12+
#define __ADC_CONFIG_H__
13+
14+
#include <rtthread.h>
15+
#include <rtdevice.h>
16+
#include "hal_data.h"
17+
#ifdef __cplusplus
18+
extern "C" {
19+
#endif
20+
21+
#if defined(BSP_USING_ADC0) || defined(BSP_USING_ADC1)
22+
23+
struct rt_adc_dev
24+
{
25+
struct rt_adc_ops ops;
26+
struct rt_adc_device adc_device;
27+
};
28+
29+
struct ra_adc_map
30+
{
31+
const char *device_name;
32+
const adc_cfg_t *g_cfg;
33+
const adc_ctrl_t *g_ctrl;
34+
const adc_channel_cfg_t *g_channel_cfg;
35+
};
36+
#endif
37+
#endif
38+
39+
#ifdef __cplusplus
40+
}
41+
#endif
42+
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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+
11+
#ifndef __CAN_CONFIG_H__
12+
#define __CAN_CONFIG_H__
13+
14+
#include <rtthread.h>
15+
#include "hal_data.h"
16+
17+
#ifdef __cplusplus
18+
extern "C" {
19+
#endif
20+
21+
#if defined(BSP_USING_CAN0)
22+
#ifndef CAN0_CONFIG
23+
#define CAN0_CONFIG \
24+
{ \
25+
.name = "can0", \
26+
.num_of_mailboxs = CAN_NO_OF_MAILBOXES_g_can0, \
27+
.p_api_ctrl = &g_can0_ctrl, \
28+
.p_cfg = &g_can0_cfg, \
29+
}
30+
#endif /* CAN0_CONFIG */
31+
#endif /* BSP_USING_CAN0 */
32+
33+
#if defined(BSP_USING_CAN1)
34+
#ifndef CAN1_CONFIG
35+
#define CAN1_CONFIG \
36+
{ \
37+
.name = "can1", \
38+
.num_of_mailboxs = CAN_NO_OF_MAILBOXES_g_can1, \
39+
.p_api_ctrl = &g_can1_ctrl, \
40+
.p_cfg = &g_can1_cfg, \
41+
}
42+
#endif /* CAN1_CONFIG */
43+
#endif /* BSP_USING_CAN1 */
44+
45+
#ifdef __cplusplus
46+
}
47+
#endif
48+
#endif
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
11+
#ifndef __DAC_CONFIG_H__
12+
#define __DAC_CONFIG_H__
13+
14+
#include <rtthread.h>
15+
#include <rtdevice.h>
16+
#include "hal_data.h"
17+
#ifdef __cplusplus
18+
extern "C" {
19+
#endif
20+
21+
#ifdef BSP_USING_DAC
22+
struct ra_dac_map
23+
{
24+
char name;
25+
const struct st_dac_cfg *g_cfg;
26+
const struct st_dac_instance_ctrl *g_ctrl;
27+
};
28+
29+
struct ra_dac_dev
30+
{
31+
rt_dac_device_t ra_dac_device_t;
32+
struct ra_dac_map *ra_dac_map_dev;
33+
};
34+
#endif
35+
36+
#endif
37+
38+
#ifdef __cplusplus
39+
}
40+
#endif
41+
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
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_PWM0
24+
BSP_PWM0_INDEX,
25+
#endif
26+
#ifdef BSP_USING_PWM1
27+
BSP_PWM1_INDEX,
28+
#endif
29+
#ifdef BSP_USING_PWM2
30+
BSP_PWM2_INDEX,
31+
#endif
32+
#ifdef BSP_USING_PWM3
33+
BSP_PWM3_INDEX,
34+
#endif
35+
#ifdef BSP_USING_PWM4
36+
BSP_PWM4_INDEX,
37+
#endif
38+
#ifdef BSP_USING_PWM5
39+
BSP_PWM5_INDEX,
40+
#endif
41+
#ifdef BSP_USING_PWM6
42+
BSP_PWM6_INDEX,
43+
#endif
44+
#ifdef BSP_USING_PWM7
45+
BSP_PWM7_INDEX,
46+
#endif
47+
#ifdef BSP_USING_PWM8
48+
BSP_PWM8_INDEX,
49+
#endif
50+
#ifdef BSP_USING_PWM9
51+
BSP_PWM9_INDEX,
52+
#endif
53+
BSP_PWMS_NUM
54+
};
55+
56+
#define PWM_DRV_INITIALIZER(num) \
57+
{ \
58+
.name = "pwm"#num , \
59+
.g_cfg = &g_timer##num##_cfg, \
60+
.g_ctrl = &g_timer##num##_ctrl, \
61+
.g_timer = &g_timer##num, \
62+
}
63+
64+
#ifdef __cplusplus
65+
}
66+
#endif
67+
68+
#endif /* __PWM_CONFIG_H__ */
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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+
11+
#ifndef __UART_CONFIG_H__
12+
#define __UART_CONFIG_H__
13+
14+
#include <rtthread.h>
15+
#include "hal_data.h"
16+
17+
#ifdef __cplusplus
18+
extern "C" {
19+
#endif
20+
21+
#if defined(BSP_USING_UART0)
22+
#ifndef UART0_CONFIG
23+
#define UART0_CONFIG \
24+
{ \
25+
.name = "uart0", \
26+
.p_api_ctrl = &g_uart0_ctrl, \
27+
.p_cfg = &g_uart0_cfg, \
28+
}
29+
#endif /* UART0_CONFIG */
30+
#endif /* BSP_USING_UART0 */
31+
32+
#if defined(BSP_USING_UART1)
33+
#ifndef UART1_CONFIG
34+
#define UART1_CONFIG \
35+
{ \
36+
.name = "uart1", \
37+
.p_api_ctrl = &g_uart1_ctrl, \
38+
.p_cfg = &g_uart1_cfg, \
39+
}
40+
#endif /* UART1_CONFIG */
41+
#endif /* BSP_USING_UART1 */
42+
43+
#if defined(BSP_USING_UART9)
44+
#ifndef UART9_CONFIG
45+
#define UART9_CONFIG \
46+
{ \
47+
.name = "uart9", \
48+
.p_api_ctrl = &g_uart9_ctrl, \
49+
.p_cfg = &g_uart9_cfg, \
50+
}
51+
#endif /* UART9_CONFIG */
52+
#endif /* BSP_USING_UART9 */
53+
54+
#ifdef __cplusplus
55+
}
56+
#endif
57+
58+
#endif

0 commit comments

Comments
 (0)