ad7172: Fix RefSource From implementation

Fixes #210.
This commit is contained in:
2025-10-08 16:15:20 +08:00
parent 38e92c4042
commit 1b117e9bf9

View File

@@ -121,9 +121,9 @@ pub enum RefSource {
impl From<u8> for RefSource {
fn from(x: u8) -> Self {
match x {
0 => RefSource::External,
1 => RefSource::Internal,
2 => RefSource::Avdd1MinusAvss,
0b00 => RefSource::External,
0b10 => RefSource::Internal,
0b11 => RefSource::Avdd1MinusAvss,
_ => RefSource::Invalid,
}
}