Skip to content
This repository has been archived by the owner on Jul 6, 2019. It is now read-only.

Better register and bitfield support #33

Closed
bgamari opened this issue May 9, 2014 · 3 comments
Closed

Better register and bitfield support #33

bgamari opened this issue May 9, 2014 · 3 comments

Comments

@bgamari
Copy link
Contributor

bgamari commented May 9, 2014

Currently the register macros do their job but not terribly well. Read/modify/write is an extremely common task, especially when modifying a single bitfield within a register, yet this task is rather painful with the current interfaces.

The mchck project has shown that having bitfields represented in the type system makes code both substantially easier to read and write.

There have been discussions about adding native bitfield support to Rust in the past. A Rust issue has been created, as well as an RFC. Servo has a bitfield macro that may be ripe for plucking and improvement. Unfortunately, the macro system isn't terribly great at generating accessors until concat_idents! is useful.

@bharrisau
Copy link
Contributor

Suggest we track this in #3. Bit banding support is important too and using a bitfield macro won't support the bit-banding properly.

@farcaller
Copy link
Member

A quick note on this: I've been thinking of masked_set_XXX to do the register access, but that will bloat the code at reg_rw definitions.

@bgamari
Copy link
Contributor Author

bgamari commented May 9, 2014

@bharrisau, thanks! Somehow I missed that one.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants