#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Maxs {
#[doc = "Normal Mode"]
NORMAL = 0x0,
#[doc = "Max Speed Mode enabled"]
MAXIMUM = 0x01,
}
impl Maxs {
#[inline(always)]
pub const fn from_bits(val: u8) -> Maxs {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Maxs {
#[inline(always)]
fn from(val: u8) -> Maxs {
Maxs::from_bits(val)
}
}
impl From<Maxs> for u8 {
#[inline(always)]
fn from(val: Maxs) -> u8 {
Maxs::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Startup {
#[doc = "0 periods of DACClock"]
_0 = 0x0,
#[doc = "8 periods of DACClock"]
_8 = 0x01,
#[doc = "16 periods of DACClock"]
_16 = 0x02,
#[doc = "24 periods of DACClock"]
_24 = 0x03,
#[doc = "64 periods of DACClock"]
_64 = 0x04,
#[doc = "80 periods of DACClock"]
_80 = 0x05,
#[doc = "96 periods of DACClock"]
_96 = 0x06,
#[doc = "112 periods of DACClock"]
_112 = 0x07,
#[doc = "512 periods of DACClock"]
_512 = 0x08,
#[doc = "576 periods of DACClock"]
_576 = 0x09,
#[doc = "640 periods of DACClock"]
_640 = 0x0a,
#[doc = "704 periods of DACClock"]
_704 = 0x0b,
#[doc = "768 periods of DACClock"]
_768 = 0x0c,
#[doc = "832 periods of DACClock"]
_832 = 0x0d,
#[doc = "896 periods of DACClock"]
_896 = 0x0e,
#[doc = "960 periods of DACClock"]
_960 = 0x0f,
#[doc = "1024 periods of DACClock"]
_1024 = 0x10,
#[doc = "1088 periods of DACClock"]
_1088 = 0x11,
#[doc = "1152 periods of DACClock"]
_1152 = 0x12,
#[doc = "1216 periods of DACClock"]
_1216 = 0x13,
#[doc = "1280 periods of DACClock"]
_1280 = 0x14,
#[doc = "1344 periods of DACClock"]
_1344 = 0x15,
#[doc = "1408 periods of DACClock"]
_1408 = 0x16,
#[doc = "1472 periods of DACClock"]
_1472 = 0x17,
#[doc = "1536 periods of DACClock"]
_1536 = 0x18,
#[doc = "1600 periods of DACClock"]
_1600 = 0x19,
#[doc = "1664 periods of DACClock"]
_1664 = 0x1a,
#[doc = "1728 periods of DACClock"]
_1728 = 0x1b,
#[doc = "1792 periods of DACClock"]
_1792 = 0x1c,
#[doc = "1856 periods of DACClock"]
_1856 = 0x1d,
#[doc = "1920 periods of DACClock"]
_1920 = 0x1e,
#[doc = "1984 periods of DACClock"]
_1984 = 0x1f,
_RESERVED_20 = 0x20,
_RESERVED_21 = 0x21,
_RESERVED_22 = 0x22,
_RESERVED_23 = 0x23,
_RESERVED_24 = 0x24,
_RESERVED_25 = 0x25,
_RESERVED_26 = 0x26,
_RESERVED_27 = 0x27,
_RESERVED_28 = 0x28,
_RESERVED_29 = 0x29,
_RESERVED_2a = 0x2a,
_RESERVED_2b = 0x2b,
_RESERVED_2c = 0x2c,
_RESERVED_2d = 0x2d,
_RESERVED_2e = 0x2e,
_RESERVED_2f = 0x2f,
_RESERVED_30 = 0x30,
_RESERVED_31 = 0x31,
_RESERVED_32 = 0x32,
_RESERVED_33 = 0x33,
_RESERVED_34 = 0x34,
_RESERVED_35 = 0x35,
_RESERVED_36 = 0x36,
_RESERVED_37 = 0x37,
_RESERVED_38 = 0x38,
_RESERVED_39 = 0x39,
_RESERVED_3a = 0x3a,
_RESERVED_3b = 0x3b,
_RESERVED_3c = 0x3c,
_RESERVED_3d = 0x3d,
_RESERVED_3e = 0x3e,
_RESERVED_3f = 0x3f,
}
impl Startup {
#[inline(always)]
pub const fn from_bits(val: u8) -> Startup {
unsafe { core::mem::transmute(val & 0x3f) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Startup {
#[inline(always)]
fn from(val: u8) -> Startup {
Startup::from_bits(val)
}
}
impl From<Startup> for u8 {
#[inline(always)]
fn from(val: Startup) -> u8 {
Startup::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Tag {
#[doc = "Tag selection mode disabled. Using USER_SEL to select the channel for the conversion."]
DIS = 0x0,
#[doc = "Tag selection mode enabled"]
EN = 0x01,
}
impl Tag {
#[inline(always)]
pub const fn from_bits(val: u8) -> Tag {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Tag {
#[inline(always)]
fn from(val: u8) -> Tag {
Tag::from_bits(val)
}
}
impl From<Tag> for u8 {
#[inline(always)]
fn from(val: Tag) -> u8 {
Tag::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Trgen {
#[doc = "External trigger mode disabled. DACC in free running mode."]
DIS = 0x0,
#[doc = "External trigger mode enabled."]
EN = 0x01,
}
impl Trgen {
#[inline(always)]
pub const fn from_bits(val: u8) -> Trgen {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Trgen {
#[inline(always)]
fn from(val: u8) -> Trgen {
Trgen::from_bits(val)
}
}
impl From<Trgen> for u8 {
#[inline(always)]
fn from(val: Trgen) -> u8 {
Trgen::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum UserSel {
#[doc = "Channel 0"]
CHANNEL0 = 0x0,
#[doc = "Channel 1"]
CHANNEL1 = 0x01,
_RESERVED_2 = 0x02,
_RESERVED_3 = 0x03,
}
impl UserSel {
#[inline(always)]
pub const fn from_bits(val: u8) -> UserSel {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for UserSel {
#[inline(always)]
fn from(val: u8) -> UserSel {
UserSel::from_bits(val)
}
}
impl From<UserSel> for u8 {
#[inline(always)]
fn from(val: UserSel) -> u8 {
UserSel::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Word {
#[doc = "Half-Word transfer"]
HALF = 0x0,
#[doc = "Word Transfer"]
WORD = 0x01,
}
impl Word {
#[inline(always)]
pub const fn from_bits(val: u8) -> Word {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Word {
#[inline(always)]
fn from(val: u8) -> Word {
Word::from_bits(val)
}
}
impl From<Word> for u8 {
#[inline(always)]
fn from(val: Word) -> u8 {
Word::to_bits(val)
}
}