Skip to content

Commit 7291b7b

Browse files
committed
添加RA RAW61 BSP
1 parent b7eb6fb commit 7291b7b

195 files changed

Lines changed: 121498 additions & 5 deletions

File tree

Some content is hidden

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

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,12 @@ extern "C"
287287
#endif
288288
#endif /* SOC_SERIES_R7FA2A1 */
289289

290+
#if defined(SOC_FAMILY_RENESAS_RA_WIRELESS)
291+
#if defined(SOC_SERIES_R7SA6W1)
292+
#include "raw/ra6w1/uart_config.h"
293+
#endif /* SOC_SERIES_R7SA6W1 */
294+
#endif /* SOC_FAMILY_RENESAS_RA_WIRELESS */
295+
290296
#ifdef __cplusplus
291297
}
292298
#endif
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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 __RAW61_UART_CONFIG_H__
12+
#define __RAW61_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+
#ifdef __cplusplus
33+
}
34+
#endif
35+
36+
#endif /* __RAW61_UART_CONFIG_H__ */

bsp/renesas/libraries/HAL_Drivers/drivers/drv_usart_v2.c

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,17 @@ static rt_err_t ra_uart_configure(struct rt_serial_device *serial, struct serial
211211
uart = rt_container_of(serial, struct ra_uart, serial);
212212
RT_ASSERT(uart != RT_NULL);
213213

214-
#if defined(SOC_SERIES_R7FA8M85) || defined(SOC_SERIES_R7KA8P1)
214+
#if defined(SOC_FAMILY_RENESAS_RA_WIRELESS)
215+
uart_w_extended_cfg_t *p_extend = (uart_w_extended_cfg_t *)uart->config->p_cfg->p_extend;
216+
RT_ASSERT(p_extend != RT_NULL);
217+
RT_ASSERT(p_extend->p_baud_setting != RT_NULL);
218+
219+
err = R_UART_W_BaudCalculate(cfg->baud_rate, p_extend->p_baud_setting);
220+
if (FSP_SUCCESS == err)
221+
{
222+
err = R_UART_W_Open(uart->config->p_api_ctrl, uart->config->p_cfg);
223+
}
224+
#elif defined(SOC_SERIES_R7FA8M85) || defined(SOC_SERIES_R7KA8P1)
215225
err = R_SCI_B_UART_Open(uart->config->p_api_ctrl, uart->config->p_cfg);
216226
#else
217227
err = R_SCI_UART_Open(uart->config->p_api_ctrl, uart->config->p_cfg);
@@ -237,18 +247,39 @@ static int ra_uart_putc(struct rt_serial_device *serial, char c)
237247
uart = rt_container_of(serial, struct ra_uart, serial);
238248
RT_ASSERT(uart != RT_NULL);
239249

240-
#if defined(SOC_SERIES_R7FA8M85) || defined(SOC_SERIES_R7KA8P1)
250+
#if defined(SOC_FAMILY_RENESAS_RA_WIRELESS)
251+
uart_w_instance_ctrl_t *p_ctrl = (uart_w_instance_ctrl_t *)uart->config->p_api_ctrl;
252+
253+
if (!R_UART_W_IsOpened(uart->config->p_api_ctrl))
254+
{
255+
return -1;
256+
}
257+
258+
while (p_ctrl->p_reg->UART_FR_REG_b.TXFF)
259+
{
260+
}
261+
262+
(*(volatile rt_uint8_t *) &p_ctrl->p_reg->UART_DR_REG) = (rt_uint8_t)c;
263+
264+
while (p_ctrl->p_reg->UART_FR_REG_b.BUSY)
265+
{
266+
}
267+
#elif defined(SOC_SERIES_R7FA8M85) || defined(SOC_SERIES_R7KA8P1)
241268
sci_b_uart_instance_ctrl_t *p_ctrl = (sci_b_uart_instance_ctrl_t *)uart->config->p_api_ctrl;
269+
270+
p_ctrl->p_reg->TDR = c;
271+
272+
while ((p_ctrl->p_reg->CSR_b.TEND) == 0);
242273
#else
243274
sci_uart_instance_ctrl_t *p_ctrl = (sci_uart_instance_ctrl_t *)uart->config->p_api_ctrl;
244-
#endif
245275

246276
p_ctrl->p_reg->TDR = c;
247277

248-
#if defined(SOC_SERIES_R7FA8M85) || defined(SOC_SERIES_R9A07G0) || defined(SOC_SERIES_R7KA8P1)
278+
#if defined(SOC_SERIES_R9A07G0)
249279
while ((p_ctrl->p_reg->CSR_b.TEND) == 0);
250-
#else
280+
#else
251281
while ((p_ctrl->p_reg->SSR_b.TEND) == 0);
282+
#endif
252283
#endif
253284

254285
return RT_EOK;

bsp/renesas/libraries/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ config SOC_FAMILY_RENESAS_RA
33
bool
44
default n
55

6+
config SOC_FAMILY_RENESAS_RA_WIRELESS
7+
bool
8+
default n
9+
610
config SOC_FAMILY_RENESAS_RZ
711
bool
812
default n
@@ -79,6 +83,12 @@ config SOC_SERIES_R7FA6E2
7983
select SOC_FAMILY_RENESAS_RA
8084
default n
8185

86+
config SOC_SERIES_R7SA6W1
87+
bool
88+
select ARCH_ARM_CORTEX_M33
89+
select SOC_FAMILY_RENESAS_RA_WIRELESS
90+
default n
91+
8292
config SOC_SERIES_R7FA2A1
8393
bool
8494
select ARCH_ARM_CORTEX_M23

0 commit comments

Comments
 (0)