You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The DW1000 register interface allows for addressing within a register by using a sub-index. This can be required for accessing larger registers, especially since the nRF52832's[1] SPIM peripheral is somewhat restricted in the buffer sizes it supports (also see jamesmunns/nrf52-hal#14).
[1] The nRF52832 is especially relevant to this crate, as it's the microcontroller used on the DWM1001 board.
The text was updated successfully, but these errors were encountered:
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.
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.
The DW1000 register interface allows for addressing within a register by using a sub-index. This can be required for accessing larger registers, especially since the nRF52832's[1] SPIM peripheral is somewhat restricted in the buffer sizes it supports (also see jamesmunns/nrf52-hal#14).
[1] The nRF52832 is especially relevant to this crate, as it's the microcontroller used on the DWM1001 board.
The text was updated successfully, but these errors were encountered: