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

Add proc macro to derive pins and component #2

Open
jamwaffles opened this issue Jan 28, 2020 · 0 comments
Open

Add proc macro to derive pins and component #2

jamwaffles opened this issue Jan 28, 2020 · 0 comments

Comments

@jamwaffles
Copy link
Owner

Similar to the HAL component generator, a proc macro to set up pins, signals and the component would be super kool. Something like:

struct ThingState {
    // Whatever
}

#[derive(halcomp)]
#[halcomp("comp-name")]
pub struct MyComponent {
    #[halcomp(pin = "float-input", input)]
    some_float_input: f32,

    #[halcomp(pin = "a-flag", input)]
    some_flag: bool,

    #[halcomp(pin = "tell-lcnc-about-this", output)]
    out_value: u32,

    /// Some internal value to the component
    something_inside: ThingState
}
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 a pull request may close this issue.

1 participant