Closed bollian closed 4 years ago
Thanks for the issue!
That seems like a good idea to me. ufmt is a crate I definitely want to support. I can't think of any downsides of having a write_byte
function. Refactoring HD44780::write_char
to use HD44780::write_byte
internally and documenting the differences between the functions would be a good additional step as well.
I'm currently implementing
uWrite
from theufmt
crate (https://github.com/japaric/ufmt) for this driver. This, similarly tocore::fmt
, wants you to implement the writing of a UTF-8 slice of bytes to the object. As a result, it makes the most sense to simply write each byte to the object in a loop.Would it be possible to add some sort of
write_byte
function to theHD44780
struct to enable this? Obviously thewrite_char
function would work, but it feels weird to convert each byte into a 32bit char, only to convert it back into a byte before writing it to the bus.The current implementation of
core::fmt::Write
also suffers from this issue.