Giter VIP home page Giter VIP logo

Comments (2)

hannobraun avatar hannobraun commented on June 21, 2024

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 to 0 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 the impl 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.

hannobraun avatar hannobraun commented on June 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.