stm32wl/stm32wl5x_cm4/usart1/
gtpr.rs

1///Register `GTPR` reader
2pub type R = crate::R<GTPRrs>;
3///Register `GTPR` writer
4pub type W = crate::W<GTPRrs>;
5///Field `PSC` reader - Prescaler value
6pub type PSC_R = crate::FieldReader;
7///Field `PSC` writer - Prescaler value
8pub type PSC_W<'a, REG> = crate::FieldWriter<'a, REG, 8, u8, crate::Safe>;
9///Field `GT` reader - Guard time value
10pub type GT_R = crate::FieldReader;
11///Field `GT` writer - Guard time value
12pub type GT_W<'a, REG> = crate::FieldWriter<'a, REG, 8, u8, crate::Safe>;
13impl R {
14    ///Bits 0:7 - Prescaler value
15    #[inline(always)]
16    pub fn psc(&self) -> PSC_R {
17        PSC_R::new((self.bits & 0xff) as u8)
18    }
19    ///Bits 8:15 - Guard time value
20    #[inline(always)]
21    pub fn gt(&self) -> GT_R {
22        GT_R::new(((self.bits >> 8) & 0xff) as u8)
23    }
24}
25impl core::fmt::Debug for R {
26    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
27        f.debug_struct("GTPR")
28            .field("gt", &self.gt())
29            .field("psc", &self.psc())
30            .finish()
31    }
32}
33impl W {
34    ///Bits 0:7 - Prescaler value
35    #[inline(always)]
36    pub fn psc(&mut self) -> PSC_W<GTPRrs> {
37        PSC_W::new(self, 0)
38    }
39    ///Bits 8:15 - Guard time value
40    #[inline(always)]
41    pub fn gt(&mut self) -> GT_W<GTPRrs> {
42        GT_W::new(self, 8)
43    }
44}
45/**guard time and prescaler register
46
47You can [`read`](crate::Reg::read) this register and get [`gtpr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`gtpr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
48
49See register [structure](https://stm32-rs.github.io/stm32-rs/STM32WL5X_CM4.html#USART1:GTPR)*/
50pub struct GTPRrs;
51impl crate::RegisterSpec for GTPRrs {
52    type Ux = u32;
53}
54///`read()` method returns [`gtpr::R`](R) reader structure
55impl crate::Readable for GTPRrs {}
56///`write(|w| ..)` method takes [`gtpr::W`](W) writer structure
57impl crate::Writable for GTPRrs {
58    type Safety = crate::Unsafe;
59}
60///`reset()` method sets GTPR to value 0
61impl crate::Resettable for GTPRrs {}