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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
#[doc = "Register `AL_CONTROL` reader"]
pub type R = crate::R<AlControlSpec>;
#[doc = "Initiate State Transition of the Device StateMachine\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Ist {
    #[doc = "1: Request Init State"]
    Value1 = 1,
    #[doc = "2: Request Pre-Operational State"]
    Value2 = 2,
    #[doc = "3: Request Bootstrap State"]
    Value3 = 3,
    #[doc = "4: Request Safe-Operational State"]
    Value4 = 4,
    #[doc = "8: Request Operational State"]
    Value5 = 8,
}
impl From<Ist> for u8 {
    #[inline(always)]
    fn from(variant: Ist) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Ist {
    type Ux = u8;
}
#[doc = "Field `IST` reader - Initiate State Transition of the Device StateMachine"]
pub type IstR = crate::FieldReader<Ist>;
impl IstR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<Ist> {
        match self.bits {
            1 => Some(Ist::Value1),
            2 => Some(Ist::Value2),
            3 => Some(Ist::Value3),
            4 => Some(Ist::Value4),
            8 => Some(Ist::Value5),
            _ => None,
        }
    }
    #[doc = "Request Init State"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Ist::Value1
    }
    #[doc = "Request Pre-Operational State"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Ist::Value2
    }
    #[doc = "Request Bootstrap State"]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == Ist::Value3
    }
    #[doc = "Request Safe-Operational State"]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == Ist::Value4
    }
    #[doc = "Request Operational State"]
    #[inline(always)]
    pub fn is_value5(&self) -> bool {
        *self == Ist::Value5
    }
}
#[doc = "Error Ind Ack\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Eia {
    #[doc = "0: No Ack of Error Ind in AL status register"]
    Value1 = 0,
    #[doc = "1: Ack of Error Ind in AL status register"]
    Value2 = 1,
}
impl From<Eia> for bool {
    #[inline(always)]
    fn from(variant: Eia) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `EIA` reader - Error Ind Ack"]
pub type EiaR = crate::BitReader<Eia>;
impl EiaR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Eia {
        match self.bits {
            false => Eia::Value1,
            true => Eia::Value2,
        }
    }
    #[doc = "No Ack of Error Ind in AL status register"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Eia::Value1
    }
    #[doc = "Ack of Error Ind in AL status register"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Eia::Value2
    }
}
#[doc = "Device Identification\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Did {
    #[doc = "0: No request"]
    Value1 = 0,
    #[doc = "1: Device Identification request"]
    Value2 = 1,
}
impl From<Did> for bool {
    #[inline(always)]
    fn from(variant: Did) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `DID` reader - Device Identification"]
pub type DidR = crate::BitReader<Did>;
impl DidR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Did {
        match self.bits {
            false => Did::Value1,
            true => Did::Value2,
        }
    }
    #[doc = "No request"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Did::Value1
    }
    #[doc = "Device Identification request"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Did::Value2
    }
}
impl R {
    #[doc = "Bits 0:3 - Initiate State Transition of the Device StateMachine"]
    #[inline(always)]
    pub fn ist(&self) -> IstR {
        IstR::new((self.bits & 0x0f) as u8)
    }
    #[doc = "Bit 4 - Error Ind Ack"]
    #[inline(always)]
    pub fn eia(&self) -> EiaR {
        EiaR::new(((self.bits >> 4) & 1) != 0)
    }
    #[doc = "Bit 5 - Device Identification"]
    #[inline(always)]
    pub fn did(&self) -> DidR {
        DidR::new(((self.bits >> 5) & 1) != 0)
    }
}
#[doc = "AL Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`al_control::R`](R).  See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct AlControlSpec;
impl crate::RegisterSpec for AlControlSpec {
    type Ux = u16;
}
#[doc = "`read()` method returns [`al_control::R`](R) reader structure"]
impl crate::Readable for AlControlSpec {}
#[doc = "`reset()` method sets AL_CONTROL to value 0x01"]
impl crate::Resettable for AlControlSpec {
    const RESET_VALUE: u16 = 0x01;
}