max78000_pac/pt0/
loop_.rs

1#[doc = "Register `LOOP` reader"]
2pub type R = crate::R<LoopSpec>;
3#[doc = "Register `LOOP` writer"]
4pub type W = crate::W<LoopSpec>;
5#[doc = "Field `count` reader - Number of loops for this pulse train to repeat."]
6pub type CountR = crate::FieldReader<u16>;
7#[doc = "Field `count` writer - Number of loops for this pulse train to repeat."]
8pub type CountW<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
9#[doc = "Field `delay` reader - Delay between loops of the Pulse Train in PT Peripheral Clock cycles"]
10pub type DelayR = crate::FieldReader<u16>;
11#[doc = "Field `delay` writer - Delay between loops of the Pulse Train in PT Peripheral Clock cycles"]
12pub type DelayW<'a, REG> = crate::FieldWriter<'a, REG, 12, u16>;
13impl R {
14    #[doc = "Bits 0:15 - Number of loops for this pulse train to repeat."]
15    #[inline(always)]
16    pub fn count(&self) -> CountR {
17        CountR::new((self.bits & 0xffff) as u16)
18    }
19    #[doc = "Bits 16:27 - Delay between loops of the Pulse Train in PT Peripheral Clock cycles"]
20    #[inline(always)]
21    pub fn delay(&self) -> DelayR {
22        DelayR::new(((self.bits >> 16) & 0x0fff) as u16)
23    }
24}
25impl W {
26    #[doc = "Bits 0:15 - Number of loops for this pulse train to repeat."]
27    #[inline(always)]
28    pub fn count(&mut self) -> CountW<LoopSpec> {
29        CountW::new(self, 0)
30    }
31    #[doc = "Bits 16:27 - Delay between loops of the Pulse Train in PT Peripheral Clock cycles"]
32    #[inline(always)]
33    pub fn delay(&mut self) -> DelayW<LoopSpec> {
34        DelayW::new(self, 16)
35    }
36}
37#[doc = "Pulse Train Loop Count\n\nYou can [`read`](crate::Reg::read) this register and get [`loop_::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`loop_::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
38pub struct LoopSpec;
39impl crate::RegisterSpec for LoopSpec {
40    type Ux = u32;
41}
42#[doc = "`read()` method returns [`loop_::R`](R) reader structure"]
43impl crate::Readable for LoopSpec {}
44#[doc = "`write(|w| ..)` method takes [`loop_::W`](W) writer structure"]
45impl crate::Writable for LoopSpec {
46    type Safety = crate::Unsafe;
47    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
48    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
49}
50#[doc = "`reset()` method sets LOOP to value 0"]
51impl crate::Resettable for LoopSpec {
52    const RESET_VALUE: u32 = 0;
53}