Skip to content

[Question] Dynamic register offset #12

Open
@rmsyn

Description

@rmsyn

In some peripherals, a register offset is defined by reading the value of another register at runtime.

For example, the USB XHCI op and run registers:

The structure of the register clusters are static, and it looks like the value for those registers is likely to be static per actual implementation.

Is there a way to define these type of registers in SVD?

Something like leaving the addressOffset empty, and requiring the generated code to supply the offset as a parameter?

Another alternative I guess would be to run code on the board to query the values of the relevant registers, and use the result in the SVD per-implementation.

It may just be that higher-level abstractions (like actual drivers or HALs) are a better place to handle register definitions like those above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions