Type Definition atsaml21e16b::generic::FieldWriterSafe

source ·
pub type FieldWriterSafe<'a, U, REG, N, FI, const WI: u8, const O: u8> = FieldWriterRaw<'a, U, REG, N, FI, Safe, WI, O>;
Expand description

Write field Proxy with safe bits

Implementations§

Field width

Writes raw bits to the field

Examples found in repository?
src/generic.rs (line 528)
527
528
529
    pub fn variant(self, variant: FI) -> &'a mut REG::Writer {
        self.bits(N::from(variant))
    }

Writes variant to the field

Examples found in repository?
src/oscctrl/osc16mctrl.rs (line 102)
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
    pub fn _4(self) -> &'a mut W {
        self.variant(FSELSELECT_A::_4)
    }
    #[doc = "8MHz"]
    #[inline(always)]
    pub fn _8(self) -> &'a mut W {
        self.variant(FSELSELECT_A::_8)
    }
    #[doc = "12MHz"]
    #[inline(always)]
    pub fn _12(self) -> &'a mut W {
        self.variant(FSELSELECT_A::_12)
    }
    #[doc = "16MHz"]
    #[inline(always)]
    pub fn _16(self) -> &'a mut W {
        self.variant(FSELSELECT_A::_16)
    }
More examples
Hide additional examples
src/tc0/count16/evctrl.rs (line 130)
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
    pub fn off(self) -> &'a mut W {
        self.variant(EVACTSELECT_A::OFF)
    }
    #[doc = "Start, restart or retrigger TC on event"]
    #[inline(always)]
    pub fn retrigger(self) -> &'a mut W {
        self.variant(EVACTSELECT_A::RETRIGGER)
    }
    #[doc = "Count on event"]
    #[inline(always)]
    pub fn count(self) -> &'a mut W {
        self.variant(EVACTSELECT_A::COUNT)
    }
    #[doc = "Start TC on event"]
    #[inline(always)]
    pub fn start(self) -> &'a mut W {
        self.variant(EVACTSELECT_A::START)
    }
    #[doc = "Time stamp capture"]
    #[inline(always)]
    pub fn stamp(self) -> &'a mut W {
        self.variant(EVACTSELECT_A::STAMP)
    }
    #[doc = "Period captured in CC0, pulse width in CC1"]
    #[inline(always)]
    pub fn ppw(self) -> &'a mut W {
        self.variant(EVACTSELECT_A::PPW)
    }
    #[doc = "Period captured in CC1, pulse width in CC0"]
    #[inline(always)]
    pub fn pwp(self) -> &'a mut W {
        self.variant(EVACTSELECT_A::PWP)
    }
    #[doc = "Pulse width capture"]
    #[inline(always)]
    pub fn pw(self) -> &'a mut W {
        self.variant(EVACTSELECT_A::PW)
    }
src/tc0/count32/evctrl.rs (line 130)
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
    pub fn off(self) -> &'a mut W {
        self.variant(EVACTSELECT_A::OFF)
    }
    #[doc = "Start, restart or retrigger TC on event"]
    #[inline(always)]
    pub fn retrigger(self) -> &'a mut W {
        self.variant(EVACTSELECT_A::RETRIGGER)
    }
    #[doc = "Count on event"]
    #[inline(always)]
    pub fn count(self) -> &'a mut W {
        self.variant(EVACTSELECT_A::COUNT)
    }
    #[doc = "Start TC on event"]
    #[inline(always)]
    pub fn start(self) -> &'a mut W {
        self.variant(EVACTSELECT_A::START)
    }
    #[doc = "Time stamp capture"]
    #[inline(always)]
    pub fn stamp(self) -> &'a mut W {
        self.variant(EVACTSELECT_A::STAMP)
    }
    #[doc = "Period captured in CC0, pulse width in CC1"]
    #[inline(always)]
    pub fn ppw(self) -> &'a mut W {
        self.variant(EVACTSELECT_A::PPW)
    }
    #[doc = "Period captured in CC1, pulse width in CC0"]
    #[inline(always)]
    pub fn pwp(self) -> &'a mut W {
        self.variant(EVACTSELECT_A::PWP)
    }
    #[doc = "Pulse width capture"]
    #[inline(always)]
    pub fn pw(self) -> &'a mut W {
        self.variant(EVACTSELECT_A::PW)
    }
src/tc0/count8/evctrl.rs (line 130)
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
    pub fn off(self) -> &'a mut W {
        self.variant(EVACTSELECT_A::OFF)
    }
    #[doc = "Start, restart or retrigger TC on event"]
    #[inline(always)]
    pub fn retrigger(self) -> &'a mut W {
        self.variant(EVACTSELECT_A::RETRIGGER)
    }
    #[doc = "Count on event"]
    #[inline(always)]
    pub fn count(self) -> &'a mut W {
        self.variant(EVACTSELECT_A::COUNT)
    }
    #[doc = "Start TC on event"]
    #[inline(always)]
    pub fn start(self) -> &'a mut W {
        self.variant(EVACTSELECT_A::START)
    }
    #[doc = "Time stamp capture"]
    #[inline(always)]
    pub fn stamp(self) -> &'a mut W {
        self.variant(EVACTSELECT_A::STAMP)
    }
    #[doc = "Period captured in CC0, pulse width in CC1"]
    #[inline(always)]
    pub fn ppw(self) -> &'a mut W {
        self.variant(EVACTSELECT_A::PPW)
    }
    #[doc = "Period captured in CC1, pulse width in CC0"]
    #[inline(always)]
    pub fn pwp(self) -> &'a mut W {
        self.variant(EVACTSELECT_A::PWP)
    }
    #[doc = "Pulse width capture"]
    #[inline(always)]
    pub fn pw(self) -> &'a mut W {
        self.variant(EVACTSELECT_A::PW)
    }
src/usb/device/ctrlb.rs (line 106)
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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
    pub fn fs(self) -> &'a mut W {
        self.variant(SPDCONFSELECT_A::FS)
    }
    #[doc = "LS : Low Speed"]
    #[inline(always)]
    pub fn ls(self) -> &'a mut W {
        self.variant(SPDCONFSELECT_A::LS)
    }
    #[doc = "HS : High Speed capable"]
    #[inline(always)]
    pub fn hs(self) -> &'a mut W {
        self.variant(SPDCONFSELECT_A::HS)
    }
    #[doc = "HSTM: High Speed Test Mode (force high-speed mode for test mode)"]
    #[inline(always)]
    pub fn hstm(self) -> &'a mut W {
        self.variant(SPDCONFSELECT_A::HSTM)
    }
}
#[doc = "Field `NREPLY` reader - No Reply"]
pub type NREPLY_R = crate::BitReader<bool>;
#[doc = "Field `NREPLY` writer - No Reply"]
pub type NREPLY_W<'a, const O: u8> = crate::BitWriter<'a, u16, CTRLB_SPEC, bool, O>;
#[doc = "Field `TSTJ` reader - Test mode J"]
pub type TSTJ_R = crate::BitReader<bool>;
#[doc = "Field `TSTJ` writer - Test mode J"]
pub type TSTJ_W<'a, const O: u8> = crate::BitWriter<'a, u16, CTRLB_SPEC, bool, O>;
#[doc = "Field `TSTK` reader - Test mode K"]
pub type TSTK_R = crate::BitReader<bool>;
#[doc = "Field `TSTK` writer - Test mode K"]
pub type TSTK_W<'a, const O: u8> = crate::BitWriter<'a, u16, CTRLB_SPEC, bool, O>;
#[doc = "Field `TSTPCKT` reader - Test packet mode"]
pub type TSTPCKT_R = crate::BitReader<bool>;
#[doc = "Field `TSTPCKT` writer - Test packet mode"]
pub type TSTPCKT_W<'a, const O: u8> = crate::BitWriter<'a, u16, CTRLB_SPEC, bool, O>;
#[doc = "Field `OPMODE2` reader - Specific Operational Mode"]
pub type OPMODE2_R = crate::BitReader<bool>;
#[doc = "Field `OPMODE2` writer - Specific Operational Mode"]
pub type OPMODE2_W<'a, const O: u8> = crate::BitWriter<'a, u16, CTRLB_SPEC, bool, O>;
#[doc = "Field `GNAK` reader - Global NAK"]
pub type GNAK_R = crate::BitReader<bool>;
#[doc = "Field `GNAK` writer - Global NAK"]
pub type GNAK_W<'a, const O: u8> = crate::BitWriter<'a, u16, CTRLB_SPEC, bool, O>;
#[doc = "Field `LPMHDSK` reader - Link Power Management Handshake"]
pub type LPMHDSK_R = crate::FieldReader<u8, LPMHDSKSELECT_A>;
#[doc = "Link Power Management Handshake\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum LPMHDSKSELECT_A {
    #[doc = "0: No handshake. LPM is not supported"]
    NO = 0,
    #[doc = "1: ACK"]
    ACK = 1,
    #[doc = "2: NYET"]
    NYET = 2,
    #[doc = "3: STALL"]
    STALL = 3,
}
impl From<LPMHDSKSELECT_A> for u8 {
    #[inline(always)]
    fn from(variant: LPMHDSKSELECT_A) -> Self {
        variant as _
    }
}
impl LPMHDSK_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> LPMHDSKSELECT_A {
        match self.bits {
            0 => LPMHDSKSELECT_A::NO,
            1 => LPMHDSKSELECT_A::ACK,
            2 => LPMHDSKSELECT_A::NYET,
            3 => LPMHDSKSELECT_A::STALL,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `NO`"]
    #[inline(always)]
    pub fn is_no(&self) -> bool {
        *self == LPMHDSKSELECT_A::NO
    }
    #[doc = "Checks if the value of the field is `ACK`"]
    #[inline(always)]
    pub fn is_ack(&self) -> bool {
        *self == LPMHDSKSELECT_A::ACK
    }
    #[doc = "Checks if the value of the field is `NYET`"]
    #[inline(always)]
    pub fn is_nyet(&self) -> bool {
        *self == LPMHDSKSELECT_A::NYET
    }
    #[doc = "Checks if the value of the field is `STALL`"]
    #[inline(always)]
    pub fn is_stall(&self) -> bool {
        *self == LPMHDSKSELECT_A::STALL
    }
}
#[doc = "Field `LPMHDSK` writer - Link Power Management Handshake"]
pub type LPMHDSK_W<'a, const O: u8> =
    crate::FieldWriterSafe<'a, u16, CTRLB_SPEC, u8, LPMHDSKSELECT_A, 2, O>;
impl<'a, const O: u8> LPMHDSK_W<'a, O> {
    #[doc = "No handshake. LPM is not supported"]
    #[inline(always)]
    pub fn no(self) -> &'a mut W {
        self.variant(LPMHDSKSELECT_A::NO)
    }
    #[doc = "ACK"]
    #[inline(always)]
    pub fn ack(self) -> &'a mut W {
        self.variant(LPMHDSKSELECT_A::ACK)
    }
    #[doc = "NYET"]
    #[inline(always)]
    pub fn nyet(self) -> &'a mut W {
        self.variant(LPMHDSKSELECT_A::NYET)
    }
    #[doc = "STALL"]
    #[inline(always)]
    pub fn stall(self) -> &'a mut W {
        self.variant(LPMHDSKSELECT_A::STALL)
    }
src/supc/bbps.rs (line 98)
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
    pub fn none(self) -> &'a mut W {
        self.variant(CONFSELECT_A::NONE)
    }
    #[doc = "The power switch is handled by the automatic power switch"]
    #[inline(always)]
    pub fn apws(self) -> &'a mut W {
        self.variant(CONFSELECT_A::APWS)
    }
    #[doc = "The backup domain is always supplied by battery backup power"]
    #[inline(always)]
    pub fn forced(self) -> &'a mut W {
        self.variant(CONFSELECT_A::FORCED)
    }
    #[doc = "The power switch is handled by the BOD33"]
    #[inline(always)]
    pub fn bod33(self) -> &'a mut W {
        self.variant(CONFSELECT_A::BOD33)
    }