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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#[doc = "Register `ESC_RESET_ECAT` reader"]
pub type R = crate::R<READMODE_ESC_RESET_ECAT_SPEC>;
#[doc = "Progress of the reset procedure\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum RESET_CMD_STATE_A {
    #[doc = "1: after writing 0x52"]
    VALUE1 = 1,
    #[doc = "2: after writing 0x45 (if 0x52 was written before)"]
    VALUE2 = 2,
    #[doc = "0: default"]
    VALUE3 = 0,
}
impl From<RESET_CMD_STATE_A> for u8 {
    #[inline(always)]
    fn from(variant: RESET_CMD_STATE_A) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for RESET_CMD_STATE_A {
    type Ux = u8;
}
impl crate::IsEnum for RESET_CMD_STATE_A {}
#[doc = "Field `RESET_CMD_STATE` reader - Progress of the reset procedure"]
pub type RESET_CMD_STATE_R = crate::FieldReader<RESET_CMD_STATE_A>;
impl RESET_CMD_STATE_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<RESET_CMD_STATE_A> {
        match self.bits {
            1 => Some(RESET_CMD_STATE_A::VALUE1),
            2 => Some(RESET_CMD_STATE_A::VALUE2),
            0 => Some(RESET_CMD_STATE_A::VALUE3),
            _ => None,
        }
    }
    #[doc = "after writing 0x52"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == RESET_CMD_STATE_A::VALUE1
    }
    #[doc = "after writing 0x45 (if 0x52 was written before)"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == RESET_CMD_STATE_A::VALUE2
    }
    #[doc = "default"]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == RESET_CMD_STATE_A::VALUE3
    }
}
impl R {
    #[doc = "Bits 0:1 - Progress of the reset procedure"]
    #[inline(always)]
    pub fn reset_cmd_state(&self) -> RESET_CMD_STATE_R {
        RESET_CMD_STATE_R::new(self.bits & 3)
    }
}
#[doc = "ESC Reset ECAT \\[READ Mode\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`readmode_esc_reset_ecat::R`](R).  See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct READMODE_ESC_RESET_ECAT_SPEC;
impl crate::RegisterSpec for READMODE_ESC_RESET_ECAT_SPEC {
    type Ux = u8;
}
#[doc = "`read()` method returns [`readmode_esc_reset_ecat::R`](R) reader structure"]
impl crate::Readable for READMODE_ESC_RESET_ECAT_SPEC {}
#[doc = "`reset()` method sets ESC_RESET_ECAT to value 0"]
impl crate::Resettable for READMODE_ESC_RESET_ECAT_SPEC {
    const RESET_VALUE: u8 = 0;
}