1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
pub mod gen1;
use crate::error::Error;
use std::str::FromStr;
#[derive(Debug, Clone)]
pub enum PowerTable {
Gen1(gen1::Table),
}
impl FromStr for PowerTable {
type Err = Error;
fn from_str(s: &str) -> Result<Self, Self::Err> {
gen1::Table::from_str(s).map(PowerTable::Gen1)
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct AllowedRanges {
pub sclk: Range,
pub mclk: Option<Range>,
pub vddc: Option<Range>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct Range {
pub min: u32,
pub max: u32,
}