stm32f1_staging/stm32f107/usart1/
gtpr.rs1pub type R = crate::R<GTPRrs>;
3pub type W = crate::W<GTPRrs>;
5pub type PSC_R = crate::FieldReader;
7pub type PSC_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9pub type GT_R = crate::FieldReader;
11pub type GT_W<'a, REG> = crate::FieldWriter<'a, REG, 8, u8, crate::Safe>;
13impl R {
14 #[inline(always)]
16 pub fn psc(&self) -> PSC_R {
17 PSC_R::new((self.bits & 0xff) as u8)
18 }
19 #[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").field("gt", &self.gt()).field("psc", &self.psc()).finish()
28 }
29}
30impl W {
31 #[inline(always)]
33 pub fn psc(&mut self) -> PSC_W<GTPRrs> {
34 PSC_W::new(self, 0)
35 }
36 #[inline(always)]
38 pub fn gt(&mut self) -> GT_W<GTPRrs> {
39 GT_W::new(self, 8)
40 }
41}
42pub struct GTPRrs;
48impl crate::RegisterSpec for GTPRrs {
49 type Ux = u16;
50}
51impl crate::Readable for GTPRrs {}
53impl crate::Writable for GTPRrs {
55 type Safety = crate::Unsafe;
56}
57impl crate::Resettable for GTPRrs {}