use crate::time::Hertz;
#[derive(Clone, Copy)]
pub struct Clocks {
pub osc: Hertz,
pub sysclk: Hertz,
}
#[derive(Copy, Clone)]
pub enum RunMode {
Run,
Sleep,
DeepSleep,
}
#[derive(Copy, Clone)]
pub enum PowerState {
Off,
On,
}
impl Clocks {
pub fn osc(self) -> Hertz {
self.osc
}
pub fn sysclk(self) -> Hertz {
self.sysclk
}
}
pub mod chip_id {
#[derive(Debug)]
pub enum Error {
UnknownDid0Ver(u8),
UnknownDid1Ver(u8),
}
#[derive(Debug)]
pub enum DeviceClass {
StellarisBlizzard,
Snowflake,
Unknown,
}
#[derive(Debug)]
pub enum PinCount {
_28,
_48,
_100,
_64,
_144,
_157,
_168,
Unknown,
}
#[derive(Debug)]
pub enum TempRange {
Commercial,
Industrial,
Extended,
IndustrialOrExtended,
Unknown,
}
#[derive(Debug)]
pub enum Package {
Soic,
Lqfp,
Bga,
Unknown,
}
#[derive(Debug)]
pub enum Qualification {
EngineeringSample,
PilotProduction,
FullyQualified,
Unknown,
}
#[derive(Debug)]
pub enum PartNo {
Tm4c123gh6pm,
Lm4f120h5qr,
Tm4c1294ncpdt,
Tm4c129encpdt,
Unknown(u8),
}
#[derive(Debug)]
pub struct ChipId {
pub device_class: DeviceClass,
pub major: u8,
pub minor: u8,
pub pin_count: PinCount,
pub temp_range: TempRange,
pub package: Package,
pub rohs_compliant: bool,
pub qualification: Qualification,
pub part_no: PartNo,
}
}