Adding AFE functions
This commit is contained in:
parent
e746e2a12c
commit
4169cd8251
@ -20,6 +20,18 @@ pub struct ProgrammableGainAmplifier<A0, A1> {
|
|||||||
a1: A1,
|
a1: A1,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Gain {
|
||||||
|
/// Get the AFE gain as a multiplying integer.
|
||||||
|
pub fn to_multiplier(&self) -> u8 {
|
||||||
|
match self {
|
||||||
|
Gain::G1 => 1,
|
||||||
|
Gain::G2 => 2,
|
||||||
|
Gain::G5 => 5,
|
||||||
|
Gain::G10 => 10,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl TryFrom<u8> for Gain {
|
impl TryFrom<u8> for Gain {
|
||||||
type Error = ();
|
type Error = ();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user