avr_device/devices/atmega4809/evsys/
strobe.rs

1#[doc = "Register `STROBE` writer"]
2pub struct W(crate::W<STROBE_SPEC>);
3impl core::ops::Deref for W {
4    type Target = crate::W<STROBE_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl core::ops::DerefMut for W {
11    #[inline(always)]
12    fn deref_mut(&mut self) -> &mut Self::Target {
13        &mut self.0
14    }
15}
16impl From<crate::W<STROBE_SPEC>> for W {
17    #[inline(always)]
18    fn from(writer: crate::W<STROBE_SPEC>) -> Self {
19        W(writer)
20    }
21}
22#[doc = "Software event on channels\n\nValue on reset: 0"]
23#[derive(Clone, Copy, Debug, PartialEq, Eq)]
24#[repr(u8)]
25pub enum STROBE0_AW {
26    #[doc = "1: No Description."]
27    EV_STROBE_CH0 = 1,
28    #[doc = "2: No Description."]
29    EV_STROBE_CH1 = 2,
30    #[doc = "4: No Description."]
31    EV_STROBE_CH2 = 4,
32    #[doc = "8: No Description."]
33    EV_STROBE_CH3 = 8,
34    #[doc = "16: No Description."]
35    EV_STROBE_CH4 = 16,
36    #[doc = "32: No Description."]
37    EV_STROBE_CH5 = 32,
38    #[doc = "64: No Description."]
39    EV_STROBE_CH6 = 64,
40    #[doc = "128: No Description."]
41    EV_STROBE_CH7 = 128,
42}
43impl From<STROBE0_AW> for u8 {
44    #[inline(always)]
45    fn from(variant: STROBE0_AW) -> Self {
46        variant as _
47    }
48}
49#[doc = "Field `STROBE0` writer - Software event on channels"]
50pub type STROBE0_W<'a, const O: u8> = crate::FieldWriter<'a, u8, STROBE_SPEC, u8, STROBE0_AW, 8, O>;
51impl<'a, const O: u8> STROBE0_W<'a, O> {
52    #[doc = "No Description."]
53    #[inline(always)]
54    pub fn ev_strobe_ch0(self) -> &'a mut W {
55        self.variant(STROBE0_AW::EV_STROBE_CH0)
56    }
57    #[doc = "No Description."]
58    #[inline(always)]
59    pub fn ev_strobe_ch1(self) -> &'a mut W {
60        self.variant(STROBE0_AW::EV_STROBE_CH1)
61    }
62    #[doc = "No Description."]
63    #[inline(always)]
64    pub fn ev_strobe_ch2(self) -> &'a mut W {
65        self.variant(STROBE0_AW::EV_STROBE_CH2)
66    }
67    #[doc = "No Description."]
68    #[inline(always)]
69    pub fn ev_strobe_ch3(self) -> &'a mut W {
70        self.variant(STROBE0_AW::EV_STROBE_CH3)
71    }
72    #[doc = "No Description."]
73    #[inline(always)]
74    pub fn ev_strobe_ch4(self) -> &'a mut W {
75        self.variant(STROBE0_AW::EV_STROBE_CH4)
76    }
77    #[doc = "No Description."]
78    #[inline(always)]
79    pub fn ev_strobe_ch5(self) -> &'a mut W {
80        self.variant(STROBE0_AW::EV_STROBE_CH5)
81    }
82    #[doc = "No Description."]
83    #[inline(always)]
84    pub fn ev_strobe_ch6(self) -> &'a mut W {
85        self.variant(STROBE0_AW::EV_STROBE_CH6)
86    }
87    #[doc = "No Description."]
88    #[inline(always)]
89    pub fn ev_strobe_ch7(self) -> &'a mut W {
90        self.variant(STROBE0_AW::EV_STROBE_CH7)
91    }
92}
93impl W {
94    #[doc = "Bits 0:7 - Software event on channels"]
95    #[inline(always)]
96    #[must_use]
97    pub fn strobe0(&mut self) -> STROBE0_W<0> {
98        STROBE0_W::new(self)
99    }
100    #[doc = "Writes raw bits to the register."]
101    #[inline(always)]
102    pub unsafe fn bits(&mut self, bits: u8) -> &mut Self {
103        self.0.bits(bits);
104        self
105    }
106}
107#[doc = "Channel Strobe\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [strobe](index.html) module"]
108pub struct STROBE_SPEC;
109impl crate::RegisterSpec for STROBE_SPEC {
110    type Ux = u8;
111}
112#[doc = "`write(|w| ..)` method takes [strobe::W](W) writer structure"]
113impl crate::Writable for STROBE_SPEC {
114    type Writer = W;
115    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
116    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
117}
118#[doc = "`reset()` method sets STROBE to value 0"]
119impl crate::Resettable for STROBE_SPEC {
120    const RESET_VALUE: Self::Ux = 0;
121}