moondancer_pac/generated/timer0/
mode.rs

1#[doc = "Register `mode` reader"]
2pub type R = crate::R<MODE_SPEC>;
3#[doc = "Register `mode` writer"]
4pub type W = crate::W<MODE_SPEC>;
5#[doc = "Field `periodic` reader - periodic field"]
6pub type PERIODIC_R = crate::BitReader;
7#[doc = "Field `periodic` writer - periodic field"]
8pub type PERIODIC_W<'a, REG> = crate::BitWriter<'a, REG>;
9impl R {
10    #[doc = "Bit 0 - periodic field"]
11    #[inline(always)]
12    pub fn periodic(&self) -> PERIODIC_R {
13        PERIODIC_R::new((self.bits & 1) != 0)
14    }
15}
16impl W {
17    #[doc = "Bit 0 - periodic field"]
18    #[inline(always)]
19    pub fn periodic(&mut self) -> PERIODIC_W<MODE_SPEC> {
20        PERIODIC_W::new(self, 0)
21    }
22}
23#[doc = "Timer mode. When ``periodic`` is set to 1 the counter will automatically be reset to the reload value.\n\nYou can [`read`](crate::Reg::read) this register and get [`mode::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mode::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
24pub struct MODE_SPEC;
25impl crate::RegisterSpec for MODE_SPEC {
26    type Ux = u8;
27}
28#[doc = "`read()` method returns [`mode::R`](R) reader structure"]
29impl crate::Readable for MODE_SPEC {}
30#[doc = "`write(|w| ..)` method takes [`mode::W`](W) writer structure"]
31impl crate::Writable for MODE_SPEC {
32    type Safety = crate::Unsafe;
33    const ZERO_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
34    const ONE_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
35}
36#[doc = "`reset()` method sets mode to value 0"]
37impl crate::Resettable for MODE_SPEC {
38    const RESET_VALUE: u8 = 0;
39}