Open bugadani opened 2 hours ago
- too implicit?
There's some precedence for this in the I8080 driver. Just want to note that the decision made here could also be made there as well, for consistency sake.
enum Address {Seven(u8), Ten(u16)}
Might be worth considering whether this can also be reused for the slave driver in future, as that may influence the decision.
There's some precedence for this in the I8080 driver
I'm just not entirely in love with the idea that users will need to add _u8
or _u16
at the end of their addresses, always. Though I guess we can implement TryFrom<i32>
as well and pick one option (or "narrowest that fits") for a bare numeric literal.
As noted by https://github.com/esp-rs/esp-hal/issues/2493#issuecomment-2464822742
We have a few options to support 10-bit addressing in inherent methods:
_10b
methodsenum Address {Seven(u8), Ten(u16)}
- too verbose?impl TryInto<Address>
and let the user pass eitheru8
oru16
- too implicit?AddressMode
enum, and always takeaddress: u16
Any other, perhaps better ideas?