use enumset::EnumSetType;
#[derive(Debug)]
pub enum Error {
Busy,
Timeout,
Over,
Calibrate,
}
#[derive(Debug)]
pub enum ClockMode {
PCLK = 0,
PLCK_DIV2 = 1,
PCLK_DIV4 = 2,
PCLK_DIV8 = 3,
PCLK_DIV16 = 4,
PCLK_DIV32 = 5,
PCLK_DIV64 = 6,
HSI = 0b1000,
HSI_DIV2 = 0b1001,
HSI_DIV4 = 0b1010,
HSI_DIV8 = 0b1011,
HSI_DIV16 = 0b1100,
HSI_DIV32 = 0b1101,
HSI_DIV64 = 0b1110,
}
#[derive(Clone, Copy, PartialEq)]
pub enum AdcChannel {
Channel0 = 0,
Channel1 = 1,
Channel2 = 2,
Channel3 = 3,
Channel4 = 4,
Channel5 = 5,
Channel6 = 6,
Channel7 = 7,
Channel8 = 8,
Channel9 = 9,
Channel11 = 11,
Channel12 = 12,
}
#[derive(PartialEq)]
pub enum ConversionMode {
Single,
Continuous,
Discontinuous,
}
#[derive(PartialEq)]
pub enum TrigleSignal {
Soft,
Rising(ExitTrigleSource),
Falling(ExitTrigleSource),
RisingFalling(ExitTrigleSource),
}
#[derive(PartialEq)]
pub enum ExitTrigleSource {
TIM1_TRG0 = 0,
TIM1_CC4 = 1,
TIM3_TRGP = 3,
}
#[derive(PartialEq)]
pub enum Align {
Right,
Left,
}
pub enum Resolution {
Bit12 = 0,
Bit10 = 1,
Bit8 = 2,
Bit6 = 3,
}
#[derive(PartialEq)]
pub enum ScanDir {
Up,
Down,
}
pub enum SampleCycles {
Cycle_3_5 = 0,
Cycle_5_5 = 1,
Cycle_7_5 = 2,
Cycle_13_5 = 3,
Cycle_28_5 = 4,
Cycle_41_5 = 5,
Cycle_71_5 = 6,
Cycle_239_5 = 7,
}
#[derive(Clone, Copy, PartialEq)]
pub enum CalibrationSampleTime {
Cycle_1 = 3,
Cycle_2 = 0,
Cycle_4 = 1,
Cycle_8 = 2,
}
#[derive(Clone, Copy, PartialEq)]
pub enum CalibrationSelect {
Offset = 0,
OffsetLinearity = 1,
}
#[derive(EnumSetType, Debug)]
pub enum Event {
EOSMP,
EOC,
EOSEQ,
OVR,
AWD,
}