Enum tcn75a::Resolution [−][src]
pub enum Resolution { Bits9, Bits10, Bits11, Bits12, }
Expand description
ADC Resolution bits in the Sensor Configuration Register.
Consult the TCN75A datasheet for information on the meanings of each variant.
Variant names will be similar to the datasheet (changes in the datasheet names or resolutions in
subsequent silicon revisions may constitute a breaking API change. As of this writing, the
supported resolutions are 9
, 10
, 11
, and 12
bits, corresponding to 0.5
, 0.25
, 0.125
,
and 0.0625
degrees Celsius precision).
Examples
You can convert the u8
values 9
, 10
, 11
, and 12
into a Resolution
and
vice-versa using TryFrom<u8>
and From<Resolution>
respectively:
let res: Resolution = 9u8.try_into().unwrap(); let res_as_int: u8 = Resolution::Bits10.into(); let try_res_fail: Result<Resolution, ConfigRegValueError> = 13u8.try_into(); assert_eq!(res, Resolution::Bits9); assert_eq!(res_as_int, 10u8); assert!(try_res_fail.is_err());
Variants
Trait Implementations
Performs the conversion.
type Error = ConfigRegValueError
type Error = ConfigRegValueError
The type returned in the event of a conversion error.
Auto Trait Implementations
impl RefUnwindSafe for Resolution
impl Send for Resolution
impl Sync for Resolution
impl Unpin for Resolution
impl UnwindSafe for Resolution
Blanket Implementations
Mutably borrows from an owned value. Read more
Casts the value.
Performs the conversion.
Performs the conversion.
Casts the value.
type Output = T
type Output = T
Should always be Self
Casts the value.
Casts the value.
Casts the value.