Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support "partially derive" #893

Open
burrbull opened this issue Dec 23, 2024 · 0 comments
Open

Support "partially derive" #893

burrbull opened this issue Dec 23, 2024 · 0 comments

Comments

@burrbull
Copy link
Member

burrbull commented Dec 23, 2024

For example such case:

REG1:
   description: REG1
   addressOffset: 0x0
   resetValue: 0x0
   fields:
        FIELD1: {}
        FIELD2: {}
        FIELD3: {}
REG2:
   addressOffset: 0x4
   derivedFrom: REG1
REG3:
   description: REG3
   addressOffset: 0x8
   resetValue: 0xF0
   derivedFrom: REG1

we should get something like this:

/// REG1
pub mod reg1 {
  // Fields
}
pub struct Reg1Spec;
/// REG1
pub type Reg1 = Reg<Reg1Spec>;

/// REG1
pub use reg1 as reg2; // same module
/// REG1
pub use Reg1 as Reg2; // same register

/// REG3
pub use reg1 as reg3;
pub struct Reg3Spec; // same module
/// REG3
pub type Reg3 = Reg<Reg3Spec>; // different registers

cc @Emilgardis

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

No branches or pull requests

1 participant