Skip to content

Conversation

@tomjielii
Copy link
Contributor

@tomjielii tomjielii commented Sep 13, 2025

拉取/合并请求描述:(PR description)

[

为什么提交这份PR (why to submit this PR)

增加对 EK-RA2E2 其他设备驱动的支持,包括 i2c, spi, adc, pwm, flash, gpio interrupt

你的解决方案是什么 (what is your solution)

请提供验证的bsp和config (provide the config and bsp)

  • BSP: bsp/renesas/ra2e2-ek
  • .config: CONFIG_RT_NAME_MAX=16; CONFIG_RT_USING_EVENT=y
  • action:

]

当前拉取/合并请求的状态 Intent for your PR

必须选择一项 Choose one (Mandatory):

  • 本拉取/合并请求是一个草稿版本 This PR is for a code-review and is intended to get feedback
  • 本拉取/合并请求是一个成熟版本 This PR is mature, and ready to be integrated into the repo

代码质量 Code Quality:

我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:

  • 已经仔细查看过代码改动的对比 Already check the difference between PR and old code
  • 代码风格正确,包括缩进空格,命名及其他风格 Style guide is adhered to, including spacing, naming and other styles
  • 没有垃圾代码,代码尽量精简,不包含#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up
  • 所有变更均有原因及合理的,并且不会影响到其他软件组件代码或BSP All modifications are justified and not affect other components or BSP
  • 对难懂代码均提供对应的注释 I've commented appropriately where code is tricky
  • 代码是高质量的 Code in this PR is of high quality
  • 已经使用formatting 等源码格式化工具确保格式符合RT-Thread代码规范 This PR complies with RT-Thread code specification
  • 如果是新增bsp, 已经添加ci检查到.github/ALL_BSP_COMPILE.json 详细请参考链接BSP自查

@tomjielii tomjielii requested a review from Rbb666 as a code owner September 13, 2025 14:00
@github-actions github-actions bot added BSP BSP: Renesas BSP related with Renesas labels Sep 13, 2025
@github-actions
Copy link

github-actions bot commented Sep 13, 2025

📌 Code Review Assignment

🏷️ Tag: bsp_renesas

Reviewers: kurisaW

Changed Files (Click to expand)
  • bsp/renesas/libraries/HAL_Drivers/drivers/config/drv_config.h
  • bsp/renesas/libraries/HAL_Drivers/drivers/config/ra2e2/adc_config.h
  • bsp/renesas/libraries/HAL_Drivers/drivers/config/ra2e2/pwm_config.h
  • bsp/renesas/libraries/HAL_Drivers/drivers/drv_flash.c
  • bsp/renesas/libraries/HAL_Drivers/drivers/drv_gpio.c
  • bsp/renesas/libraries/HAL_Drivers/drivers/drv_i2c.c
  • bsp/renesas/ra2e2-ek/.config
  • bsp/renesas/ra2e2-ek/README.md
  • bsp/renesas/ra2e2-ek/SConstruct
  • bsp/renesas/ra2e2-ek/board/Kconfig
  • bsp/renesas/ra2e2-ek/board/ports/fal_cfg.h
  • bsp/renesas/ra2e2-ek/configuration.xml
  • bsp/renesas/ra2e2-ek/ra/fsp/src/bsp/cmsis/Device/RENESAS/Source/startup.c
  • bsp/renesas/ra2e2-ek/ra_gen/pin_data.c
  • bsp/renesas/ra2e2-ek/rtconfig.h

📊 Current Review Status (Last Updated: 2025-09-15 11:27 CST)

  • kurisaW Pending Review

📝 Review Instructions

  1. 维护者可以通过单击此处来刷新审查状态: 🔄 刷新状态
    Maintainers can refresh the review status by clicking here: 🔄 Refresh Status

  2. 确认审核通过后评论 LGTM/lgtm
    Comment LGTM/lgtm after confirming approval

  3. PR合并前需至少一位维护者确认
    PR must be confirmed by at least one maintainer before merging

ℹ️ 刷新CI状态操作需要具备仓库写入权限。
ℹ️ Refresh CI status operation requires repository Write permission.

@Rbb666 Rbb666 requested review from Copilot and kurisaW September 14, 2025 19:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for additional device drivers to the EK-RA2E2 BSP, including I2C, SPI, ADC, PWM, flash, and GPIO interrupt functionality. The changes enhance the board's peripheral driver support and update configuration files to enable these new capabilities.

Key Changes:

  • Added I2C hardware driver support with compatibility layer for RA2E2 series
  • Integrated SPI, PWM, and ADC driver configurations
  • Enhanced flash driver with low-power flash support and callback functionality
  • Updated build system with startup check and configuration adjustments

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
bsp/renesas/ra2e2-ek/rtconfig.h Updated RT_NAME_MAX and enabled event support
bsp/renesas/ra2e2-ek/ra_gen/pin_data.c Removed I2C pin configurations from static setup
bsp/renesas/ra2e2-ek/ra/fsp/src/bsp/cmsis/Device/RENESAS/Source/startup.c Enhanced startup sequence with multi-compiler support
bsp/renesas/ra2e2-ek/configuration.xml Updated pin configuration from I2C to GPT timer modes
bsp/renesas/ra2e2-ek/board/ports/fal_cfg.h Added flash abstraction layer configuration
bsp/renesas/ra2e2-ek/board/Kconfig Added hardware driver menu configurations for I2C, SPI, PWM, ADC
bsp/renesas/ra2e2-ek/SConstruct Integrated startup check functionality
bsp/renesas/ra2e2-ek/README.md Updated board reference and RTC support status
bsp/renesas/ra2e2-ek/.config Applied configuration changes for name length and event support
bsp/renesas/libraries/HAL_Drivers/drivers/drv_i2c.c Added RA2E2 compatibility macros for I2C driver
bsp/renesas/libraries/HAL_Drivers/drivers/drv_gpio.c Fixed missing semicolon in PIN2IRQX_TABLE macro
bsp/renesas/libraries/HAL_Drivers/drivers/drv_flash.c Enhanced flash driver with LP flash support and callback
bsp/renesas/libraries/HAL_Drivers/drivers/config/ra2e2/pwm_config.h Added PWM configuration header for RA2E2
bsp/renesas/libraries/HAL_Drivers/drivers/config/ra2e2/adc_config.h Added ADC configuration header for RA2E2
bsp/renesas/libraries/HAL_Drivers/drivers/config/drv_config.h Integrated RA2E2 PWM and ADC configurations


void flash_callback(flash_callback_args_t * p_args)
{

Copy link

Copilot AI Sep 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

English: Empty callback function should include a comment explaining its purpose or implement basic functionality like setting completion flags. Consider adding parameter validation or basic event handling.

中文: 空的回调函数应该包含注释说明其用途,或实现基本功能如设置完成标志。建议添加参数验证或基本事件处理。

Suggested change
/*
* This callback is intentionally left empty.
* No action is required on flash events in this application.
* If event handling is needed, implement it here.
*/

Copilot uses AI. Check for mistakes.
#define RA_SCI_EVENT_ALL BITS(0,3)

#ifdef SOC_SERIES_R7FA2E2
#define R_IIC_MASTER_Open R_IIC_B_MASTER_Open
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里格式化有问题

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

用 astyle 格式化好了

@kurisaW
Copy link
Member

kurisaW commented Sep 14, 2025

另外每个外设请提交运行测试截图

@tomjielii
Copy link
Contributor Author

tomjielii commented Sep 15, 2025

另外每个外设请提交运行测试截图

按键输入中断1 按键输入中断2 PWM4_TIMER_1 PWM4_TIMER_2 SPI_MASTER_1 SPI_MASTER_2 I2C_MASTER_1 I2C_MASTER_2 flash_1 flash_2 ADC_1

@kurisaW kurisaW merged commit 8a646c5 into RT-Thread:master Sep 17, 2025
39 of 40 checks passed
@Rbb666 Rbb666 added this to the v5.2.2 milestone Sep 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BSP: Renesas BSP related with Renesas BSP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants