nrf5340_app_pac/dppic_ns/tasks_chg/
en.rs

1#[doc = "Register `EN` writer"]
2pub struct W(crate::W<EN_SPEC>);
3impl core::ops::Deref for W {
4    type Target = crate::W<EN_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<EN_SPEC>> for W {
17    #[inline(always)]
18    fn from(writer: crate::W<EN_SPEC>) -> Self {
19        W(writer)
20    }
21}
22#[doc = "Enable channel group n\n\nValue on reset: 0"]
23#[derive(Clone, Copy, Debug, PartialEq)]
24pub enum EN_AW {
25    #[doc = "1: Trigger task"]
26    TRIGGER = 1,
27}
28impl From<EN_AW> for bool {
29    #[inline(always)]
30    fn from(variant: EN_AW) -> Self {
31        variant as u8 != 0
32    }
33}
34#[doc = "Field `EN` writer - Enable channel group n"]
35pub type EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, EN_SPEC, EN_AW, O>;
36impl<'a, const O: u8> EN_W<'a, O> {
37    #[doc = "Trigger task"]
38    #[inline(always)]
39    pub fn trigger(self) -> &'a mut W {
40        self.variant(EN_AW::TRIGGER)
41    }
42}
43impl W {
44    #[doc = "Bit 0 - Enable channel group n"]
45    #[inline(always)]
46    pub fn en(&mut self) -> EN_W<0> {
47        EN_W::new(self)
48    }
49    #[doc = "Writes raw bits to the register."]
50    #[inline(always)]
51    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
52        self.0.bits(bits);
53        self
54    }
55}
56#[doc = "Description cluster: Enable channel group n\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 [en](index.html) module"]
57pub struct EN_SPEC;
58impl crate::RegisterSpec for EN_SPEC {
59    type Ux = u32;
60}
61#[doc = "`write(|w| ..)` method takes [en::W](W) writer structure"]
62impl crate::Writable for EN_SPEC {
63    type Writer = W;
64}
65#[doc = "`reset()` method sets EN to value 0"]
66impl crate::Resettable for EN_SPEC {
67    #[inline(always)]
68    fn reset_value() -> Self::Ux {
69        0
70    }
71}