atsamd11c/mtb/
flow.rs
1#[doc = "Register `FLOW` reader"]
2pub type R = crate::R<FlowSpec>;
3#[doc = "Register `FLOW` writer"]
4pub type W = crate::W<FlowSpec>;
5#[doc = "Field `AUTOSTOP` reader - Auto Stop Tracing"]
6pub type AutostopR = crate::BitReader;
7#[doc = "Field `AUTOSTOP` writer - Auto Stop Tracing"]
8pub type AutostopW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `AUTOHALT` reader - Auto Halt Request"]
10pub type AutohaltR = crate::BitReader;
11#[doc = "Field `AUTOHALT` writer - Auto Halt Request"]
12pub type AutohaltW<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `WATERMARK` reader - Watermark value"]
14pub type WatermarkR = crate::FieldReader<u32>;
15#[doc = "Field `WATERMARK` writer - Watermark value"]
16pub type WatermarkW<'a, REG> = crate::FieldWriter<'a, REG, 29, u32>;
17impl R {
18 #[doc = "Bit 0 - Auto Stop Tracing"]
19 #[inline(always)]
20 pub fn autostop(&self) -> AutostopR {
21 AutostopR::new((self.bits & 1) != 0)
22 }
23 #[doc = "Bit 1 - Auto Halt Request"]
24 #[inline(always)]
25 pub fn autohalt(&self) -> AutohaltR {
26 AutohaltR::new(((self.bits >> 1) & 1) != 0)
27 }
28 #[doc = "Bits 3:31 - Watermark value"]
29 #[inline(always)]
30 pub fn watermark(&self) -> WatermarkR {
31 WatermarkR::new((self.bits >> 3) & 0x1fff_ffff)
32 }
33}
34impl W {
35 #[doc = "Bit 0 - Auto Stop Tracing"]
36 #[inline(always)]
37 #[must_use]
38 pub fn autostop(&mut self) -> AutostopW<FlowSpec> {
39 AutostopW::new(self, 0)
40 }
41 #[doc = "Bit 1 - Auto Halt Request"]
42 #[inline(always)]
43 #[must_use]
44 pub fn autohalt(&mut self) -> AutohaltW<FlowSpec> {
45 AutohaltW::new(self, 1)
46 }
47 #[doc = "Bits 3:31 - Watermark value"]
48 #[inline(always)]
49 #[must_use]
50 pub fn watermark(&mut self) -> WatermarkW<FlowSpec> {
51 WatermarkW::new(self, 3)
52 }
53}
54#[doc = "MTB Flow\n\nYou can [`read`](crate::Reg::read) this register and get [`flow::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`flow::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
55pub struct FlowSpec;
56impl crate::RegisterSpec for FlowSpec {
57 type Ux = u32;
58}
59#[doc = "`read()` method returns [`flow::R`](R) reader structure"]
60impl crate::Readable for FlowSpec {}
61#[doc = "`write(|w| ..)` method takes [`flow::W`](W) writer structure"]
62impl crate::Writable for FlowSpec {
63 type Safety = crate::Unsafe;
64 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
65 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
66}
67#[doc = "`reset()` method sets FLOW to value 0"]
68impl crate::Resettable for FlowSpec {
69 const RESET_VALUE: u32 = 0;
70}