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

Bits9
Bits10
Bits11
Bits12

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

The amount of bits used by the specifier.

The base type of the specifier. Read more

The interface type of the specifier. Read more

Converts some bytes into the in-out type. Read more

Converts the given bytes into the in-out type. Read more

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Casts the value.

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Casts the value.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Casts the value.

Should always be Self

Casts the value.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Casts the value.

Casts the value.