Ad7172-2: u8 -> RefSource is Incorrect #210
Owner
src/ad7172/mod.rs
Lines 109 to 130 in 38e92c4042
/// Reference source for ADC conversion |
||
#[repr(u8)] |
||
pub enum RefSource { |
||
/// External reference |
||
External = 0b00, |
||
/// Internal 2.5V reference |
||
Internal = 0b10, |
||
/// AVDD1 − AVSS |
||
Avdd1MinusAvss = 0b11, |
||
Invalid = 0b01, |
||
} |
||
impl From<u8> for RefSource { |
||
fn from(x: u8) -> Self { |
||
match x { |
||
0 => RefSource::External, |
||
1 => RefSource::Internal, |
||
2 => RefSource::Avdd1MinusAvss, |
||
_ => RefSource::Invalid, |
||
} |
||
} |
||
} |
https://git.m-labs.hk/M-Labs/thermostat/src/commit/38e92c40424bb2e075e08fdf07c2dcb23fd6fc9d/src/ad7172/mod.rs#L109-L130
ad7172: Fix RefSource `From` implementation #212
ad7172: Fix RefSource `From` implementation
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?