nrf9160_pac/tad_s/
clockstop.rs

1#[doc = "Register `CLOCKSTOP` writer"]
2pub struct W(crate::W<CLOCKSTOP_SPEC>);
3impl core::ops::Deref for W {
4    type Target = crate::W<CLOCKSTOP_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<CLOCKSTOP_SPEC>> for W {
17    #[inline(always)]
18    fn from(writer: crate::W<CLOCKSTOP_SPEC>) -> Self {
19        W(writer)
20    }
21}
22#[doc = "\n\nValue on reset: 0"]
23#[derive(Clone, Copy, Debug, PartialEq)]
24pub enum STOP_AW {
25    #[doc = "1: Stop all trace and debug clocks."]
26    STOP = 1,
27}
28impl From<STOP_AW> for bool {
29    #[inline(always)]
30    fn from(variant: STOP_AW) -> Self {
31        variant as u8 != 0
32    }
33}
34#[doc = "Field `STOP` writer - "]
35pub type STOP_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLOCKSTOP_SPEC, STOP_AW, O>;
36impl<'a, const O: u8> STOP_W<'a, O> {
37    #[doc = "Stop all trace and debug clocks."]
38    #[inline(always)]
39    pub fn stop(self) -> &'a mut W {
40        self.variant(STOP_AW::STOP)
41    }
42}
43impl W {
44    #[doc = "Bit 0"]
45    #[inline(always)]
46    pub fn stop(&mut self) -> STOP_W<0> {
47        STOP_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 = "Stop all trace and debug clocks.\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 [clockstop](index.html) module"]
57pub struct CLOCKSTOP_SPEC;
58impl crate::RegisterSpec for CLOCKSTOP_SPEC {
59    type Ux = u32;
60}
61#[doc = "`write(|w| ..)` method takes [clockstop::W](W) writer structure"]
62impl crate::Writable for CLOCKSTOP_SPEC {
63    type Writer = W;
64}
65#[doc = "`reset()` method sets CLOCKSTOP to value 0"]
66impl crate::Resettable for CLOCKSTOP_SPEC {
67    #[inline(always)]
68    fn reset_value() -> Self::Ux {
69        0
70    }
71}