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
For some communication peripherals it is typical that only partial functionality is used, e.g. only RX or TX for serial or only MOSI for SPI. For these situations we should have filler types which can be used in that case. https://github.com/stm32-rs/stm32f4xx-hal/ already has appropriate implementations which we should be able to reuse for our cause.
I've already started #27, which takes a bit different, but similar approach. I personally prefer the approach with an universal Unused pin implementing all the AF traits, but both approaches are (mostly) equivalent. It's doesn't seem hard to modify it.
I personally prefer the approach with an universal Unused pin implementing all the AF traits, but both approaches are (mostly) equivalent.
Uhm, that's not what your implementation does. I basically just defines an empty shell without any functionality (not even sure why you're using a PhantomData).
I used PhantomData because I wasn't sure if we maybe need to extend it in the future
😲
and without it it's constructable by user code (afaik).
In that case you could use
pub struct Unused {
_0: (),
}
However it doesn't really matter since it's really just an empty shell and there's exactly none functionality attached to it (and true to the meaning never should be...).
For some communication peripherals it is typical that only partial functionality is used, e.g. only RX or TX for serial or only MOSI for SPI. For these situations we should have filler types which can be used in that case. https://github.com/stm32-rs/stm32f4xx-hal/ already has appropriate implementations which we should be able to reuse for our cause.
CC @david-sawatzke
The text was updated successfully, but these errors were encountered: