[drivers][bsp][reness] Add Etherkit bsp and RZ series driver compatibility adaptation
ToolsCI / Tools (push) Waiting to run
AutoTestCI / components/cpp11 (push) Waiting to run
AutoTestCI / kernel/atomic (push) Waiting to run
AutoTestCI / kernel/atomic/riscv64 (push) Waiting to run
AutoTestCI / kernel/atomic_c11 (push) Waiting to run
AutoTestCI / kernel/atomic_c11/riscv64 (push) Waiting to run
AutoTestCI / kernel/device (push) Waiting to run
AutoTestCI / kernel/ipc (push) Waiting to run
AutoTestCI / kernel/irq (push) Waiting to run
AutoTestCI / kernel/mem (push) Waiting to run
AutoTestCI / kernel/mem/riscv64 (push) Waiting to run
AutoTestCI / kernel/thread (push) Waiting to run
AutoTestCI / kernel/timer (push) Waiting to run
AutoTestCI / rtsmart/aarch64 (push) Waiting to run
AutoTestCI / rtsmart/arm (push) Waiting to run
AutoTestCI / rtsmart/riscv64 (push) Waiting to run
AutoTestCI / components/utest (push) Waiting to run
RT-Thread BSP Static Build Check / ESP32C3 (push) Waiting to run
RT-Thread BSP Static Build Check / Infineon_TI_microchip (push) Waiting to run
RT-Thread BSP Static Build Check / RT-Thread Online Packages (STM32F407 RT-Spark) (push) Waiting to run
RT-Thread BSP Static Build Check / RTduino/Arduino Libraries (Raspberry Pico) (push) Waiting to run
RT-Thread BSP Static Build Check / RTduino/Arduino Libraries (STM32F412 Nucleo) (push) Waiting to run
RT-Thread BSP Static Build Check / aarch64 (push) Waiting to run
RT-Thread BSP Static Build Check / gd32_n32_apm32 (push) Waiting to run
RT-Thread BSP Static Build Check / hpmicro (push) Waiting to run
RT-Thread BSP Static Build Check / i386-unknown (push) Waiting to run
RT-Thread BSP Static Build Check / llvm-arm (push) Waiting to run
RT-Thread BSP Static Build Check / mips (push) Waiting to run
RT-Thread BSP Static Build Check / nordic(yml) (push) Waiting to run
RT-Thread BSP Static Build Check / nuvoton (push) Waiting to run
RT-Thread BSP Static Build Check / nxp_renesas (push) Waiting to run
RT-Thread BSP Static Build Check / others_at32_hc32_ht32 (push) Waiting to run
RT-Thread BSP Static Build Check / riscv-none (push) Waiting to run
RT-Thread BSP Static Build Check / riscv64-unknown (push) Waiting to run
RT-Thread BSP Static Build Check / simulator (push) Waiting to run
RT-Thread BSP Static Build Check / stm32_f2_f4 (push) Waiting to run
RT-Thread BSP Static Build Check / stm32_f7_g0_h7_mp15_u5_h5_wb5 (push) Waiting to run
RT-Thread BSP Static Build Check / stm32l4_f0_f1 (push) Waiting to run
BSP compilation with more drivers / BSP Compilation with More Drivers (push) Waiting to run
doc_doxygen / doxygen_doc generate (push) Waiting to run
doc_doxygen / deploy (push) Blocked by required conditions
pkgs_test / change (push) Has been skipped

This commit is contained in:
kurisaw
2025-02-19 13:07:20 +08:00
committed by Rbb666
parent 600e4ab517
commit 96772832f8
211 changed files with 91801 additions and 246 deletions
+1
View File
@@ -248,6 +248,7 @@ jobs:
- "renesas/ra8d1-vision-board"
- "renesas/rzt2m_rsk"
- "renesas/rzn2l_rsk"
- "renesas/rzn2l_etherkit"
- "frdm-k64f"
- "xplorer4330/M4"
- RTT_BSP: "nuvoton"
+1 -1
View File
@@ -55,7 +55,7 @@ if GetDepend(['BSP_USING_TIM']):
if GetDepend(['BSP_USING_ETH']):
src += ['drv_eth.c']
if GetDepend(['BSP_USING_CAN']):
if GetDepend(['BSP_USING_CAN']) or GetDepend('BSP_USING_CANFD'):
src += ['drv_can.c']
if GetDepend(['BSP_USING_SDHI']):
@@ -1,13 +1,13 @@
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2021-07-29 KyleChan first version
* 2022-12-7 Vandoul ADD ra4m2
*/
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2021-07-29 KyleChan first version
* 2022-12-7 Vandoul ADD ra4m2
*/
#ifndef __DRV_CONFIG_H__
#define __DRV_CONFIG_H__
@@ -145,6 +145,10 @@ extern "C"
#include "rzt/uart_config.h"
#include "rzt/timer_config.h"
#ifdef BSP_USING_CANFD
#include "rzt/canfd_config.h"
#endif
#ifdef BSP_USING_PWM
#include "rzt/pwm_config.h"
#endif
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2024, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2024, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2024, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2024, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2024, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2024, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2024, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2024, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2024, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2024, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -28,6 +28,6 @@ typedef enum
#define ENABLE_DOUBLE_BUFFER (1)
#define LCD_BL_PIN BSP_IO_PORT_10_PIN_11
#define LCD_RST_PIN BSP_IO_PORT_11_PIN_04
#define LCD_RST_PIN BSP_IO_PORT_11_PIN_04
#endif
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2024, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -0,0 +1,85 @@
/*
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2025-02-11 kurisaW first version
*/
#ifndef __CAN_CONFIG_H__
#define __CAN_CONFIG_H__
#include <rtthread.h>
#include "hal_data.h"
#ifdef __cplusplus
extern "C"
{
#endif
#if defined(BSP_USING_CAN0)
#ifndef CANFD0_CONFIG
#define CANFD0_CONFIG \
{ \
.name = "canfd0", \
.num_of_mailboxs = 48, \
.p_api_ctrl = &g_canfd0_ctrl, \
.p_cfg = &g_canfd0_cfg, \
}
#endif /* CAN0_CONFIG */
#endif /* BSP_USING_CAN0 */
#if defined(BSP_USING_CAN1)
#ifndef CANFD1_CONFIG
#define CANFD1_CONFIG \
{ \
.name = "canfd1", \
.num_of_mailboxs = 48, \
.p_api_ctrl = &g_canfd1_ctrl, \
.p_cfg = &g_canfd1_cfg, \
}
#endif /* CAN1_CONFIG */
#endif /* BSP_USING_CAN1 */
const canfd_afl_entry_t p_canfd0_afl[CANFD_CFG_AFL_CH0_RULE_NUM] =
{
{
.id =
{
.id = 0x00,
.frame_type = CAN_FRAME_TYPE_DATA,
.id_mode = CAN_ID_MODE_STANDARD
},
.destination =
{
.minimum_dlc = CANFD_MINIMUM_DLC_0,
.rx_buffer = CANFD_RX_MB_NONE,
.fifo_select_flags = CANFD_RX_FIFO_0
}
},
};
const canfd_afl_entry_t p_canfd1_afl[CANFD_CFG_AFL_CH1_RULE_NUM] =
{
{
.id =
{
.id = 0x01,
.frame_type = CAN_FRAME_TYPE_DATA,
.id_mode = CAN_ID_MODE_STANDARD
},
.destination =
{
.minimum_dlc = CANFD_MINIMUM_DLC_1,
.rx_buffer = CANFD_RX_MB_NONE,
.fifo_select_flags = CANFD_RX_FIFO_1
}
},
};
#ifdef __cplusplus
}
#endif
#endif
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2024, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
+28 -5
View File
@@ -1,11 +1,12 @@
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2021-10-29 mazhiyuan first version
* 2025-02-11 kurisaW support can and canfd drivers for RZ family
*/
#include "drv_can.h"
@@ -47,6 +48,18 @@ static const struct ra_baud_rate_tab can_baud_rate_tab[] =
{CAN10kBaud, 4, 14, 5, 1 + 249}
};
#if defined(BSP_USING_CANFD)
#define can_instance_ctrl_t canfd_instance_ctrl_t
#define R_CAN_Open R_CANFD_Open
#define R_BSP_IrqStatusClear R_BSP_IrqClearPending
#define R_CAN_ModeTransition R_CANFD_ModeTransition
#define R_CAN_InfoGet R_CANFD_InfoGet
#define R_CAN_Write R_CANFD_Write
#endif
static rt_uint32_t get_can_baud_index(rt_uint32_t baud)
{
rt_uint32_t len, index;
@@ -66,13 +79,13 @@ static void ra_can_get_config(void)
struct can_configure config = CANDEFAULTCONFIG;
#ifdef BSP_USING_CAN0
can_obj[CAN0_INDEX].can_dev.config = config;
can_obj[CAN0_INDEX].can_dev.config.msgboxsz = CAN_NO_OF_MAILBOXES_g_can0;
can_obj[CAN0_INDEX].can_dev.config.msgboxsz = 32;
can_obj[CAN0_INDEX].can_dev.config.sndboxnumber = 1;
can_obj[CAN0_INDEX].can_dev.config.ticks = 50;
#endif
#ifdef BSP_USING_CAN1
can_obj[CAN1_INDEX].can_dev.config = config;
can_obj[CAN1_INDEX].can_dev.config.msgboxsz = CAN_NO_OF_MAILBOXES_g_can1;
can_obj[CAN1_INDEX].can_dev.config.msgboxsz = 32;
can_obj[CAN1_INDEX].can_dev.config.sndboxnumber = 1;
can_obj[CAN1_INDEX].can_dev.config.ticks = 50;
#endif
@@ -168,7 +181,7 @@ rt_err_t ra_can_control(struct rt_can_device *can_dev, int cmd, void *arg)
}
return RT_EOK;
}
int ra_can_sendmsg(struct rt_can_device *can_dev, const void *buf, rt_uint32_t boxno)
rt_ssize_t ra_can_sendmsg(struct rt_can_device *can_dev, const void *buf, rt_uint32_t boxno)
{
struct ra_can *can;
can_frame_t g_can_tx_frame;
@@ -180,7 +193,13 @@ int ra_can_sendmsg(struct rt_can_device *can_dev, const void *buf, rt_uint32_t b
g_can_tx_frame.id_mode = msg_rt->ide;
g_can_tx_frame.type = msg_rt->rtr;
g_can_tx_frame.data_length_code = msg_rt->len;
#if defined(BSP_USING_CANFD) && defined(BSP_USING_CAN_RZ)
g_can_tx_frame.options = 0;
#elif defined(BSP_USING_CANFD)
g_can_tx_frame.options = CANFD_FRAME_OPTION_FD | CANFD_FRAME_OPTION_BRS;
#else
g_can_tx_frame.options = 0;
#endif
memcpy(g_can_tx_frame.data, msg_rt->data, 8);
can = rt_container_of(can_dev, struct ra_can, can_dev);
RT_ASSERT(boxno < can->config->num_of_mailboxs);
@@ -193,7 +212,7 @@ int ra_can_sendmsg(struct rt_can_device *can_dev, const void *buf, rt_uint32_t b
return RT_EOK;
}
int ra_can_recvmsg(struct rt_can_device *can_dev, void *buf, rt_uint32_t boxno)
rt_ssize_t ra_can_recvmsg(struct rt_can_device *can_dev, void *buf, rt_uint32_t boxno)
{
struct rt_can_msg *msg_rt = (struct rt_can_msg *)buf;
can_frame_t *msg_ra;
@@ -205,7 +224,11 @@ int ra_can_recvmsg(struct rt_can_device *can_dev, void *buf, rt_uint32_t boxno)
RT_ASSERT(boxno < can->config->num_of_mailboxs);
if (can->callback_args->mailbox != boxno)
return 0;
#if defined(BSP_USING_CANFD)
msg_ra = &can->callback_args->frame;
#else
msg_ra = can->callback_args->p_frame;
#endif
msg_rt->id = msg_ra->id;
msg_rt->ide = msg_ra->id_mode;
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*

Some files were not shown because too many files have changed in this diff Show More