ad7172: Fix RefSource From implementation

Fixes #210.
This commit is contained in:
atse 2025-10-08 16:15:20 +08:00
parent b3f5b82fcd
commit c36470da8a

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,
}
}