nrf5340_app_pac/cti_s/
ctiapppulse.rs1#[doc = "Register `CTIAPPPULSE` writer"]
2pub struct W(crate::W<CTIAPPPULSE_SPEC>);
3impl core::ops::Deref for W {
4 type Target = crate::W<CTIAPPPULSE_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<CTIAPPPULSE_SPEC>> for W {
17 #[inline(always)]
18 fn from(writer: crate::W<CTIAPPPULSE_SPEC>) -> Self {
19 W(writer)
20 }
21}
22#[doc = "Setting a bit HIGH generates a channel event pulse for the selected channel. There is one bit of the register for each channel.\n\nValue on reset: 0"]
23#[derive(Clone, Copy, Debug, PartialEq)]
24pub enum APPULSE_0_AW {
25 #[doc = "1: Generates an event pulse on channel 0."]
26 GENERATE = 1,
27}
28impl From<APPULSE_0_AW> for bool {
29 #[inline(always)]
30 fn from(variant: APPULSE_0_AW) -> Self {
31 variant as u8 != 0
32 }
33}
34#[doc = "Field `APPULSE_0` writer - Setting a bit HIGH generates a channel event pulse for the selected channel. There is one bit of the register for each channel."]
35pub type APPULSE_0_W<'a, const O: u8> =
36 crate::BitWriter<'a, u32, CTIAPPPULSE_SPEC, APPULSE_0_AW, O>;
37impl<'a, const O: u8> APPULSE_0_W<'a, O> {
38 #[doc = "Generates an event pulse on channel 0."]
39 #[inline(always)]
40 pub fn generate(self) -> &'a mut W {
41 self.variant(APPULSE_0_AW::GENERATE)
42 }
43}
44#[doc = "Setting a bit HIGH generates a channel event pulse for the selected channel. There is one bit of the register for each channel.\n\nValue on reset: 0"]
45#[derive(Clone, Copy, Debug, PartialEq)]
46pub enum APPULSE_1_AW {
47 #[doc = "1: Generates an event pulse on channel 1."]
48 GENERATE = 1,
49}
50impl From<APPULSE_1_AW> for bool {
51 #[inline(always)]
52 fn from(variant: APPULSE_1_AW) -> Self {
53 variant as u8 != 0
54 }
55}
56#[doc = "Field `APPULSE_1` writer - Setting a bit HIGH generates a channel event pulse for the selected channel. There is one bit of the register for each channel."]
57pub type APPULSE_1_W<'a, const O: u8> =
58 crate::BitWriter<'a, u32, CTIAPPPULSE_SPEC, APPULSE_1_AW, O>;
59impl<'a, const O: u8> APPULSE_1_W<'a, O> {
60 #[doc = "Generates an event pulse on channel 1."]
61 #[inline(always)]
62 pub fn generate(self) -> &'a mut W {
63 self.variant(APPULSE_1_AW::GENERATE)
64 }
65}
66#[doc = "Setting a bit HIGH generates a channel event pulse for the selected channel. There is one bit of the register for each channel.\n\nValue on reset: 0"]
67#[derive(Clone, Copy, Debug, PartialEq)]
68pub enum APPULSE_2_AW {
69 #[doc = "1: Generates an event pulse on channel 2."]
70 GENERATE = 1,
71}
72impl From<APPULSE_2_AW> for bool {
73 #[inline(always)]
74 fn from(variant: APPULSE_2_AW) -> Self {
75 variant as u8 != 0
76 }
77}
78#[doc = "Field `APPULSE_2` writer - Setting a bit HIGH generates a channel event pulse for the selected channel. There is one bit of the register for each channel."]
79pub type APPULSE_2_W<'a, const O: u8> =
80 crate::BitWriter<'a, u32, CTIAPPPULSE_SPEC, APPULSE_2_AW, O>;
81impl<'a, const O: u8> APPULSE_2_W<'a, O> {
82 #[doc = "Generates an event pulse on channel 2."]
83 #[inline(always)]
84 pub fn generate(self) -> &'a mut W {
85 self.variant(APPULSE_2_AW::GENERATE)
86 }
87}
88#[doc = "Setting a bit HIGH generates a channel event pulse for the selected channel. There is one bit of the register for each channel.\n\nValue on reset: 0"]
89#[derive(Clone, Copy, Debug, PartialEq)]
90pub enum APPULSE_3_AW {
91 #[doc = "1: Generates an event pulse on channel 3."]
92 GENERATE = 1,
93}
94impl From<APPULSE_3_AW> for bool {
95 #[inline(always)]
96 fn from(variant: APPULSE_3_AW) -> Self {
97 variant as u8 != 0
98 }
99}
100#[doc = "Field `APPULSE_3` writer - Setting a bit HIGH generates a channel event pulse for the selected channel. There is one bit of the register for each channel."]
101pub type APPULSE_3_W<'a, const O: u8> =
102 crate::BitWriter<'a, u32, CTIAPPPULSE_SPEC, APPULSE_3_AW, O>;
103impl<'a, const O: u8> APPULSE_3_W<'a, O> {
104 #[doc = "Generates an event pulse on channel 3."]
105 #[inline(always)]
106 pub fn generate(self) -> &'a mut W {
107 self.variant(APPULSE_3_AW::GENERATE)
108 }
109}
110impl W {
111 #[doc = "Bit 0 - Setting a bit HIGH generates a channel event pulse for the selected channel. There is one bit of the register for each channel."]
112 #[inline(always)]
113 pub fn appulse_0(&mut self) -> APPULSE_0_W<0> {
114 APPULSE_0_W::new(self)
115 }
116 #[doc = "Bit 1 - Setting a bit HIGH generates a channel event pulse for the selected channel. There is one bit of the register for each channel."]
117 #[inline(always)]
118 pub fn appulse_1(&mut self) -> APPULSE_1_W<1> {
119 APPULSE_1_W::new(self)
120 }
121 #[doc = "Bit 2 - Setting a bit HIGH generates a channel event pulse for the selected channel. There is one bit of the register for each channel."]
122 #[inline(always)]
123 pub fn appulse_2(&mut self) -> APPULSE_2_W<2> {
124 APPULSE_2_W::new(self)
125 }
126 #[doc = "Bit 3 - Setting a bit HIGH generates a channel event pulse for the selected channel. There is one bit of the register for each channel."]
127 #[inline(always)]
128 pub fn appulse_3(&mut self) -> APPULSE_3_W<3> {
129 APPULSE_3_W::new(self)
130 }
131 #[doc = "Writes raw bits to the register."]
132 #[inline(always)]
133 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
134 self.0.bits(bits);
135 self
136 }
137}
138#[doc = "CTI Application Pulse register\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 [ctiapppulse](index.html) module"]
139pub struct CTIAPPPULSE_SPEC;
140impl crate::RegisterSpec for CTIAPPPULSE_SPEC {
141 type Ux = u32;
142}
143#[doc = "`write(|w| ..)` method takes [ctiapppulse::W](W) writer structure"]
144impl crate::Writable for CTIAPPPULSE_SPEC {
145 type Writer = W;
146}
147#[doc = "`reset()` method sets CTIAPPPULSE to value 0"]
148impl crate::Resettable for CTIAPPPULSE_SPEC {
149 #[inline(always)]
150 fn reset_value() -> Self::Ux {
151 0
152 }
153}