The Sensirion SHT4x series uses 8 bit commands and the new function write_command_u8 has been added to support these devices as well.
For the sake of a clean naming scheme, write_command_u16 is provided as a replacement for write_command. The latter is still available but deprecated.
Using suffixes to distinguish between u8 and u16 commands has been chosen because there is no trait for to_be_bytes which would allow to use a generic function. The crate num_traits provides the trait PrimInt which covers to_be but not to_be_bytes. See https://github.com/rust-num/num-traits/issues/189 for details.
The Sensirion SHT4x series uses 8 bit commands and the new function
write_command_u8
has been added to support these devices as well.For the sake of a clean naming scheme,
write_command_u16
is provided as a replacement for write_command. The latter is still available but deprecated.Using suffixes to distinguish between u8 and u16 commands has been chosen because there is no trait for
to_be_bytes
which would allow to use a generic function. The cratenum_traits
provides the traitPrimInt
which coversto_be
but notto_be_bytes
. See https://github.com/rust-num/num-traits/issues/189 for details.