gd32e5/gd32e508/timer5/
psc.rs

1#[doc = "Register `PSC` reader"]
2pub type R = crate::R<PscSpec>;
3#[doc = "Register `PSC` writer"]
4pub type W = crate::W<PscSpec>;
5#[doc = "Field `PSC` reader - Prescaler value of the counter clock"]
6pub type PscR = crate::FieldReader<u16>;
7#[doc = "Field `PSC` writer - Prescaler value of the counter clock"]
8pub type PscW<'a, REG> = crate::FieldWriterSafe<'a, REG, 16, u16>;
9impl R {
10    #[doc = "Bits 0:15 - Prescaler value of the counter clock"]
11    #[inline(always)]
12    pub fn psc(&self) -> PscR {
13        PscR::new((self.bits & 0xffff) as u16)
14    }
15}
16impl W {
17    #[doc = "Bits 0:15 - Prescaler value of the counter clock"]
18    #[inline(always)]
19    #[must_use]
20    pub fn psc(&mut self) -> PscW<PscSpec> {
21        PscW::new(self, 0)
22    }
23}
24#[doc = "Prescaler register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`psc::R`](R).  You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`psc::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
25pub struct PscSpec;
26impl crate::RegisterSpec for PscSpec {
27    type Ux = u32;
28}
29#[doc = "`read()` method returns [`psc::R`](R) reader structure"]
30impl crate::Readable for PscSpec {}
31#[doc = "`write(|w| ..)` method takes [`psc::W`](W) writer structure"]
32impl crate::Writable for PscSpec {
33    type Safety = crate::Unsafe;
34    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
35    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
36}
37#[doc = "`reset()` method sets PSC to value 0"]
38impl crate::Resettable for PscSpec {
39    const RESET_VALUE: u32 = 0;
40}