bl808_pac/uart/
bit_period.rs1#[doc = "Register `bit_period` reader"]
2pub struct R(crate::R<BIT_PERIOD_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<BIT_PERIOD_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<BIT_PERIOD_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<BIT_PERIOD_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `bit_period` writer"]
17pub struct W(crate::W<BIT_PERIOD_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<BIT_PERIOD_SPEC>;
20 #[inline(always)]
21 fn deref(&self) -> &Self::Target {
22 &self.0
23 }
24}
25impl core::ops::DerefMut for W {
26 #[inline(always)]
27 fn deref_mut(&mut self) -> &mut Self::Target {
28 &mut self.0
29 }
30}
31impl From<crate::W<BIT_PERIOD_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<BIT_PERIOD_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `transmit` reader - Period of each transmit bit\n\n This field relates to baudrate."]
38pub type TRANSMIT_R = crate::FieldReader<u16, u16>;
39#[doc = "Field `transmit` writer - Period of each transmit bit\n\n This field relates to baudrate."]
40pub type TRANSMIT_W<'a, const O: u8> =
41 crate::FieldWriter<'a, u32, BIT_PERIOD_SPEC, u16, u16, 16, O>;
42#[doc = "Field `receive` reader - Period of each receive bit\n\n This field relates to baudrate."]
43pub type RECEIVE_R = crate::FieldReader<u16, u16>;
44#[doc = "Field `receive` writer - Period of each receive bit\n\n This field relates to baudrate."]
45pub type RECEIVE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BIT_PERIOD_SPEC, u16, u16, 16, O>;
46impl R {
47 #[doc = "Bits 0:15 - Period of each transmit bit\n\n This field relates to baudrate."]
48 #[inline(always)]
49 pub fn transmit(&self) -> TRANSMIT_R {
50 TRANSMIT_R::new((self.bits & 0xffff) as u16)
51 }
52 #[doc = "Bits 16:31 - Period of each receive bit\n\n This field relates to baudrate."]
53 #[inline(always)]
54 pub fn receive(&self) -> RECEIVE_R {
55 RECEIVE_R::new(((self.bits >> 16) & 0xffff) as u16)
56 }
57}
58impl W {
59 #[doc = "Bits 0:15 - Period of each transmit bit\n\n This field relates to baudrate."]
60 #[inline(always)]
61 pub fn transmit(&mut self) -> TRANSMIT_W<0> {
62 TRANSMIT_W::new(self)
63 }
64 #[doc = "Bits 16:31 - Period of each receive bit\n\n This field relates to baudrate."]
65 #[inline(always)]
66 pub fn receive(&mut self) -> RECEIVE_W<16> {
67 RECEIVE_W::new(self)
68 }
69 #[doc = "Writes raw bits to the register."]
70 #[inline(always)]
71 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
72 self.0.bits(bits);
73 self
74 }
75}
76#[doc = "Bit period control register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [bit_period](index.html) module"]
77pub struct BIT_PERIOD_SPEC;
78impl crate::RegisterSpec for BIT_PERIOD_SPEC {
79 type Ux = u32;
80}
81#[doc = "`read()` method returns [bit_period::R](R) reader structure"]
82impl crate::Readable for BIT_PERIOD_SPEC {
83 type Reader = R;
84}
85#[doc = "`write(|w| ..)` method takes [bit_period::W](W) writer structure"]
86impl crate::Writable for BIT_PERIOD_SPEC {
87 type Writer = W;
88}
89#[doc = "`reset()` method sets bit_period to value 0x00ff_00ff"]
90impl crate::Resettable for BIT_PERIOD_SPEC {
91 #[inline(always)]
92 fn reset_value() -> Self::Ux {
93 0x00ff_00ff
94 }
95}