Skip to content

Commit a0b34e7

Browse files
committed
[bsp][renesas][ra4m1-ek] add a new bsp for ra4m1-ek board
1 parent fdb6acd commit a0b34e7

File tree

217 files changed

+127777
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

217 files changed

+127777
-0
lines changed

.github/ALL_BSP_COMPILE.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@
256256
"renesas/ra6e2-ek",
257257
"renesas/ra6e2-fpb",
258258
"renesas/ra4e2-eco",
259+
"renesas/ra4m1-ek",
259260
"renesas/ra4m2-eco",
260261
"renesas/ra2l1-cpk",
261262
"renesas/ra8m1-ek",

bsp/renesas/libraries/HAL_Drivers/drivers/config/drv_config.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,26 @@ extern "C"
138138
#endif
139139
#endif /* SOC_SERIES_R7FA4E2 */
140140

141+
#ifdef SOC_SERIES_R7FA4M1
142+
#include "ra4m1/uart_config.h"
143+
144+
#ifdef BSP_USING_ADC
145+
#include "ra4m1/adc_config.h"
146+
#endif
147+
148+
#ifdef BSP_USING_DAC
149+
#include "ra4m1/dac_config.h"
150+
#endif
151+
152+
#ifdef BSP_USING_PWM
153+
#include "ra4m1/pwm_config.h"
154+
#endif
155+
156+
#ifdef BSP_USING_CAN
157+
#include "ra4m1/can_config.h"
158+
#endif
159+
#endif /* SOC_SERIES_R7FA4M1 */
160+
141161
#ifdef SOC_SERIES_R7FA4M2
142162
#include "ra4m2/uart_config.h"
143163

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+
* 2021-08-19 Mr.Tiger 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+
* 2021-10-29 mazhiyuan 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+
* 2021-08-19 Mr.Tiger 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+
* 2021-10-26 KevinXu 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: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
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+
* 2021-07-29 KyleChan 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_UART2)
44+
#ifndef UART2_CONFIG
45+
#define UART2_CONFIG \
46+
{ \
47+
.name = "uart2", \
48+
.p_api_ctrl = &g_uart2_ctrl, \
49+
.p_cfg = &g_uart2_cfg, \
50+
}
51+
#endif /* UART2_CONFIG */
52+
#endif /* BSP_USING_UART2 */
53+
54+
#if defined(BSP_USING_UART3)
55+
#ifndef UART3_CONFIG
56+
#define UART3_CONFIG \
57+
{ \
58+
.name = "uart3", \
59+
.p_api_ctrl = &g_uart3_ctrl, \
60+
.p_cfg = &g_uart3_cfg, \
61+
}
62+
#endif /* UART3_CONFIG */
63+
#endif /* BSP_USING_UART3 */
64+
65+
#if defined(BSP_USING_UART4)
66+
#ifndef UART4_CONFIG
67+
#define UART4_CONFIG \
68+
{ \
69+
.name = "uart4", \
70+
.p_api_ctrl = &g_uart4_ctrl, \
71+
.p_cfg = &g_uart4_cfg, \
72+
}
73+
#endif /* UART4_CONFIG */
74+
#endif /* BSP_USING_UART4 */
75+
76+
#if defined(BSP_USING_UART5)
77+
#ifndef UART5_CONFIG
78+
#define UART5_CONFIG \
79+
{ \
80+
.name = "uart5", \
81+
.p_api_ctrl = &g_uart5_ctrl, \
82+
.p_cfg = &g_uart5_cfg, \
83+
}
84+
#endif /* UART5_CONFIG */
85+
#endif /* BSP_USING_UART5 */
86+
87+
88+
#if defined(BSP_USING_UART6)
89+
#ifndef UART6_CONFIG
90+
#define UART6_CONFIG \
91+
{ \
92+
.name = "uart6", \
93+
.p_api_ctrl = &g_uart6_ctrl, \
94+
.p_cfg = &g_uart6_cfg, \
95+
}
96+
#endif /* UART6_CONFIG */
97+
#endif /* BSP_USING_UART6 */
98+
99+
#if defined(BSP_USING_UART7)
100+
#ifndef UART7_CONFIG
101+
#define UART7_CONFIG \
102+
{ \
103+
.name = "uart7", \
104+
.p_api_ctrl = &g_uart7_ctrl, \
105+
.p_cfg = &g_uart7_cfg, \
106+
}
107+
#endif /* UART7_CONFIG */
108+
#endif /* BSP_USING_UART7 */
109+
110+
#if defined(BSP_USING_UART8)
111+
#ifndef UART8_CONFIG
112+
#define UART8_CONFIG \
113+
{ \
114+
.name = "uart8", \
115+
.p_api_ctrl = &g_uart8_ctrl, \
116+
.p_cfg = &g_uart8_cfg, \
117+
}
118+
#endif /* UART8_CONFIG */
119+
#endif /* BSP_USING_UART8 */
120+
121+
#if defined(BSP_USING_UART9)
122+
#ifndef UART9_CONFIG
123+
#define UART9_CONFIG \
124+
{ \
125+
.name = "uart9", \
126+
.p_api_ctrl = &g_uart9_ctrl, \
127+
.p_cfg = &g_uart9_cfg, \
128+
}
129+
#endif /* UART9_CONFIG */
130+
#endif /* BSP_USING_UART9 */
131+
132+
#ifdef __cplusplus
133+
}
134+
#endif
135+
136+
#endif

bsp/renesas/libraries/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ config SOC_SERIES_R7FA4E2
4343
select SOC_FAMILY_RENESAS_RA
4444
default n
4545

46+
config SOC_SERIES_R7FA4M1
47+
bool
48+
select ARCH_ARM_CORTEX_M4
49+
select SOC_FAMILY_RENESAS_RA
50+
default n
51+
4652
config SOC_SERIES_R7FA4M2
4753
bool
4854
select ARCH_ARM_CORTEX_M4

bsp/renesas/ra4m1-ek/.api_xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<ddscApi/>

0 commit comments

Comments
 (0)