stm32wb_pac/usart1/
rtor.rs1#[doc = "Reader of register RTOR"]
2pub type R = crate::R<u32, super::RTOR>;
3#[doc = "Writer for register RTOR"]
4pub type W = crate::W<u32, super::RTOR>;
5#[doc = "Register RTOR `reset()`'s with value 0"]
6impl crate::ResetValue for super::RTOR {
7 type Type = u32;
8 #[inline(always)]
9 fn reset_value() -> Self::Type {
10 0
11 }
12}
13#[doc = "Reader of field `BLEN`"]
14pub type BLEN_R = crate::R<u8, u8>;
15#[doc = "Write proxy for field `BLEN`"]
16pub struct BLEN_W<'a> {
17 w: &'a mut W,
18}
19impl<'a> BLEN_W<'a> {
20 #[doc = r"Writes raw bits to the field"]
21 #[inline(always)]
22 pub unsafe fn bits(self, value: u8) -> &'a mut W {
23 self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24);
24 self.w
25 }
26}
27#[doc = "Reader of field `RTO`"]
28pub type RTO_R = crate::R<u32, u32>;
29#[doc = "Write proxy for field `RTO`"]
30pub struct RTO_W<'a> {
31 w: &'a mut W,
32}
33impl<'a> RTO_W<'a> {
34 #[doc = r"Writes raw bits to the field"]
35 #[inline(always)]
36 pub unsafe fn bits(self, value: u32) -> &'a mut W {
37 self.w.bits = (self.w.bits & !0x00ff_ffff) | ((value as u32) & 0x00ff_ffff);
38 self.w
39 }
40}
41impl R {
42 #[doc = "Bits 24:31 - Block Length"]
43 #[inline(always)]
44 pub fn blen(&self) -> BLEN_R {
45 BLEN_R::new(((self.bits >> 24) & 0xff) as u8)
46 }
47 #[doc = "Bits 0:23 - Receiver timeout value"]
48 #[inline(always)]
49 pub fn rto(&self) -> RTO_R {
50 RTO_R::new((self.bits & 0x00ff_ffff) as u32)
51 }
52}
53impl W {
54 #[doc = "Bits 24:31 - Block Length"]
55 #[inline(always)]
56 pub fn blen(&mut self) -> BLEN_W {
57 BLEN_W { w: self }
58 }
59 #[doc = "Bits 0:23 - Receiver timeout value"]
60 #[inline(always)]
61 pub fn rto(&mut self) -> RTO_W {
62 RTO_W { w: self }
63 }
64}