stm32wb_pac/lcd/
sr.rs

1#[doc = "Reader of register SR"]
2pub type R = crate::R<u32, super::SR>;
3#[doc = "Writer for register SR"]
4pub type W = crate::W<u32, super::SR>;
5#[doc = "Register SR `reset()`'s with value 0x20"]
6impl crate::ResetValue for super::SR {
7    type Type = u32;
8    #[inline(always)]
9    fn reset_value() -> Self::Type {
10        0x20
11    }
12}
13#[doc = "Reader of field `FCRSF`"]
14pub type FCRSF_R = crate::R<bool, bool>;
15#[doc = "Reader of field `RDY`"]
16pub type RDY_R = crate::R<bool, bool>;
17#[doc = "Reader of field `UDD`"]
18pub type UDD_R = crate::R<bool, bool>;
19#[doc = "Reader of field `UDR`"]
20pub type UDR_R = crate::R<bool, bool>;
21#[doc = "Write proxy for field `UDR`"]
22pub struct UDR_W<'a> {
23    w: &'a mut W,
24}
25impl<'a> UDR_W<'a> {
26    #[doc = r"Sets the field bit"]
27    #[inline(always)]
28    pub fn set_bit(self) -> &'a mut W {
29        self.bit(true)
30    }
31    #[doc = r"Clears the field bit"]
32    #[inline(always)]
33    pub fn clear_bit(self) -> &'a mut W {
34        self.bit(false)
35    }
36    #[doc = r"Writes raw bits to the field"]
37    #[inline(always)]
38    pub fn bit(self, value: bool) -> &'a mut W {
39        self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2);
40        self.w
41    }
42}
43#[doc = "Reader of field `SOF`"]
44pub type SOF_R = crate::R<bool, bool>;
45#[doc = "Reader of field `ENS`"]
46pub type ENS_R = crate::R<bool, bool>;
47impl R {
48    #[doc = "Bit 5 - LCD Frame Control Register Synchronization flag"]
49    #[inline(always)]
50    pub fn fcrsf(&self) -> FCRSF_R {
51        FCRSF_R::new(((self.bits >> 5) & 0x01) != 0)
52    }
53    #[doc = "Bit 4 - Ready flag"]
54    #[inline(always)]
55    pub fn rdy(&self) -> RDY_R {
56        RDY_R::new(((self.bits >> 4) & 0x01) != 0)
57    }
58    #[doc = "Bit 3 - Update Display Done"]
59    #[inline(always)]
60    pub fn udd(&self) -> UDD_R {
61        UDD_R::new(((self.bits >> 3) & 0x01) != 0)
62    }
63    #[doc = "Bit 2 - Update display request"]
64    #[inline(always)]
65    pub fn udr(&self) -> UDR_R {
66        UDR_R::new(((self.bits >> 2) & 0x01) != 0)
67    }
68    #[doc = "Bit 1 - Start of frame flag"]
69    #[inline(always)]
70    pub fn sof(&self) -> SOF_R {
71        SOF_R::new(((self.bits >> 1) & 0x01) != 0)
72    }
73    #[doc = "Bit 0 - ENS"]
74    #[inline(always)]
75    pub fn ens(&self) -> ENS_R {
76        ENS_R::new((self.bits & 0x01) != 0)
77    }
78}
79impl W {
80    #[doc = "Bit 2 - Update display request"]
81    #[inline(always)]
82    pub fn udr(&mut self) -> UDR_W {
83        UDR_W { w: self }
84    }
85}