Skip to main content

rp235x_pac/inner/rosc/
count.rs

1#[doc = "Register `COUNT` reader"]
2pub type R = crate::R<COUNT_SPEC>;
3#[doc = "Register `COUNT` writer"]
4pub type W = crate::W<COUNT_SPEC>;
5#[doc = "Field `COUNT` reader - "]
6pub type COUNT_R = crate::FieldReader<u16>;
7#[doc = "Field `COUNT` writer - "]
8pub type COUNT_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
9impl R {
10    #[doc = "Bits 0:15"]
11    #[inline(always)]
12    pub fn count(&self) -> COUNT_R {
13        COUNT_R::new((self.bits & 0xffff) as u16)
14    }
15}
16impl W {
17    #[doc = "Bits 0:15"]
18    #[inline(always)]
19    #[must_use]
20    pub fn count(&mut self) -> COUNT_W<COUNT_SPEC> {
21        COUNT_W::new(self, 0)
22    }
23}
24#[doc = "A down counter running at the ROSC frequency which counts to zero and stops. To start the counter write a non-zero value. Can be used for short software pauses when setting up time sensitive hardware.  
25
26You can [`read`](crate::Reg::read) this register and get [`count::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`count::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
27pub struct COUNT_SPEC;
28impl crate::RegisterSpec for COUNT_SPEC {
29    type Ux = u32;
30}
31#[doc = "`read()` method returns [`count::R`](R) reader structure"]
32impl crate::Readable for COUNT_SPEC {}
33#[doc = "`write(|w| ..)` method takes [`count::W`](W) writer structure"]
34impl crate::Writable for COUNT_SPEC {
35    type Safety = crate::Unsafe;
36    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
37    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
38}
39#[doc = "`reset()` method sets COUNT to value 0"]
40impl crate::Resettable for COUNT_SPEC {
41    const RESET_VALUE: u32 = 0;
42}