Skip to content

HPM: pins and clocks come from the project; HPMI2C and HPMPWM call no board functions - #25

Merged
Jiu-xiao merged 1 commit into
devfrom
docs/hpm-no-board-helpers
Oct 6, 2026
Merged

Jiu-xiao merged 1 commit into
devfrom
docs/hpm-no-board-helpers

Conversation

@Jiu-xiao

@Jiu-xiao Jiu-xiao commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Follows xrobot-org/libxr#332. The HPM page (zh and en) says that the project sets up pins and clocks before creating LibXR objects and that the drivers call no board.c functions, shows the new HPMI2C/HPMPWM constructors, and replaces the I2C notes on DMA/board helpers with the dma_mgr requirement and the controller-based bus recovery. Merge after libxr#332.

Summary by Sourcery

Document project-owned HPM peripheral setup and update the HPM I2C integration requirements.

Enhancements:

  • Clarify that HPM projects configure peripheral pin muxes and clocks before creating LibXR objects, while HPM drivers rely solely on SDK drivers rather than board-level functions.
  • Document the dma_mgr requirement for HPM I2C and the controller-based bus recovery behavior.

Documentation:

  • Update Chinese and English HPM setup documentation with the new HPMI2C and HPMPWM construction model and revised I2C prerequisites.

@sourcery-ai

sourcery-ai Bot commented Oct 6, 2026

Copy link
Copy Markdown

Sorry @Jiu-xiao, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 3 days and 20 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Oct 6, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates the Chinese and English HPM setup guides to reflect project-owned pin/clock initialization, direct SDK-only HPM driver behavior, the current I2C/PWM constructors, the dma_mgr prerequisite, and controller-based I2C bus recovery.

Sequence diagram for project-owned HPM peripheral initialization

sequenceDiagram
    participant Project
    participant HPM_SDK as HPM SDK
    participant HPMI2C
    participant HPMPWM

    Project->>HPM_SDK: pin and clock functions
    Project->>HPMI2C: HPMI2C(HPM_I2C3, clock_i2c3, {100000})
    Project->>HPMPWM: HPMPWM(HPM_PWM0, clock_mot0, 0, 0, Polarity::NORMAL)
    HPMI2C->>HPM_SDK: SDK driver calls
    HPMPWM->>HPM_SDK: SDK driver calls
Loading

Flow diagram for HPM I2C prerequisites and bus recovery

flowchart LR
    A[Project enables CONFIG_DMA_MGR] --> B[Project configures pins and clocks]
    B --> C[Create HPMI2C]
    C --> D[Use I2C controller reset signal]
    D --> E[9 SCL pulses for bus recovery]
Loading

File-Level Changes

Change Details Files
Document project-owned pin and clock initialization before constructing HPM LibXR drivers, with constructors that receive the SDK peripheral and clock identifiers.
  • Add Chinese and English examples for HPMI2C and HPMPWM construction.
  • Clarify that HPM drivers use SDK APIs directly and do not call board.c functions.
  • State that pin mux and clocks must be configured before object creation.
docs/env_setup/hpm.md
i18n/en/docusaurus-plugin-content-docs/current/env_setup/hpm.md
Update HPM I2C prerequisites and bus-recovery documentation to match the SDK and controller-based implementation.
  • Replace generic DMA/interrupt-helper guidance with the required dma_mgr component and CONFIG_DMA_MGR build requirement.
  • Document controller-generated recovery using nine SCL pulses instead of board-level recovery paths.
docs/env_setup/hpm.md
i18n/en/docusaurus-plugin-content-docs/current/env_setup/hpm.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@Jiu-xiao
Jiu-xiao merged commit 0ee2405 into dev Oct 6, 2026
3 checks passed
@Jiu-xiao
Jiu-xiao deleted the docs/hpm-no-board-helpers branch October 11, 2026 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant