Comments (2)
There's one open question when it comes to implementing support for sub-indices: When accessing only a part of a register, what happens to the getter/setter methods that are generated as part of the R
/W
types for each register?
Here's a wild idea I just had:
- Add two type parameters to the generated
R
/W
types that indicate which part of the register is being accessed. They default to0
and the length of the register (in bytes), but can be set to define any subset of the register. - Each getter/setter is only implemented, if the range defined by the two type parameters includes all the bytes that contain the field (using a
where
clause on theimpl
block).
I think right now this is mostly science fiction, but it should be possible once we get const generics. Maybe it's even possible to get something like this using typenum.
from dw1000-rs.
I'm closing this issue. Support for sub-registers has been added in #22. A more generic mechanism, as described here, seems unnecessary, as most registers are only a few bytes long, and I don't think the additional complexity is worth it to save a few bytes in an SPI transaction.
The only exceptions that I can think of are RX_BUFFER
/TX_BUFFER
, and there's a dedicated issue for those.
from dw1000-rs.
Related Issues (20)
- Stuck in block! HOT 5
- FYI `SYS_STATE` is now available in the datasheet HOT 2
- Merge this repository with braun-embedded/rust-dwm1001 HOT 1
- Add type parameter to `Led` to identify pin
- Add support for the buttons on the dev board
- Apply range bias to distance measurement
- Use latest version of embedded-hal traits
- Overflow and weird reading in ranging examples
- Timeout error in ranging tag example HOT 5
- Publish new cargo crate version? HOT 2
- CI not working
- Is a mega PR welcome? HOT 1
- HL Status Sys Status HOT 4
- RX/TX examples don't seem to work HOT 1
- How to flash for DWM1001? HOT 2
- Version bump? HOT 7
- Bug: ranging on battery panics in compute_distance HOT 3
- Enforce formatting in CI
- Looking for new maintainer HOT 5
- Raspberry pi integration HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dw1000-rs.