efm32pg22_pac/efm32pg22c200/i2c1_s/
status.rs

1#[doc = "Register `STATUS` reader"]
2pub struct R(crate::R<STATUS_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<STATUS_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<STATUS_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<STATUS_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `PSTART` reader - Pending START"]
17pub type PSTART_R = crate::BitReader<bool>;
18#[doc = "Field `PSTOP` reader - Pending STOP"]
19pub type PSTOP_R = crate::BitReader<bool>;
20#[doc = "Field `PACK` reader - Pending ACK"]
21pub type PACK_R = crate::BitReader<bool>;
22#[doc = "Field `PNACK` reader - Pending NACK"]
23pub type PNACK_R = crate::BitReader<bool>;
24#[doc = "Field `PCONT` reader - Pending continue"]
25pub type PCONT_R = crate::BitReader<bool>;
26#[doc = "Field `PABORT` reader - Pending abort"]
27pub type PABORT_R = crate::BitReader<bool>;
28#[doc = "Field `TXC` reader - TX Complete"]
29pub type TXC_R = crate::BitReader<bool>;
30#[doc = "Field `TXBL` reader - TX Buffer Level"]
31pub type TXBL_R = crate::BitReader<bool>;
32#[doc = "Field `RXDATAV` reader - RX Data Valid"]
33pub type RXDATAV_R = crate::BitReader<bool>;
34#[doc = "Field `RXFULL` reader - RX FIFO Full"]
35pub type RXFULL_R = crate::BitReader<bool>;
36#[doc = "Field `TXBUFCNT` reader - TX Buffer Count"]
37pub type TXBUFCNT_R = crate::FieldReader<u8, u8>;
38impl R {
39    #[doc = "Bit 0 - Pending START"]
40    #[inline(always)]
41    pub fn pstart(&self) -> PSTART_R {
42        PSTART_R::new((self.bits & 1) != 0)
43    }
44    #[doc = "Bit 1 - Pending STOP"]
45    #[inline(always)]
46    pub fn pstop(&self) -> PSTOP_R {
47        PSTOP_R::new(((self.bits >> 1) & 1) != 0)
48    }
49    #[doc = "Bit 2 - Pending ACK"]
50    #[inline(always)]
51    pub fn pack(&self) -> PACK_R {
52        PACK_R::new(((self.bits >> 2) & 1) != 0)
53    }
54    #[doc = "Bit 3 - Pending NACK"]
55    #[inline(always)]
56    pub fn pnack(&self) -> PNACK_R {
57        PNACK_R::new(((self.bits >> 3) & 1) != 0)
58    }
59    #[doc = "Bit 4 - Pending continue"]
60    #[inline(always)]
61    pub fn pcont(&self) -> PCONT_R {
62        PCONT_R::new(((self.bits >> 4) & 1) != 0)
63    }
64    #[doc = "Bit 5 - Pending abort"]
65    #[inline(always)]
66    pub fn pabort(&self) -> PABORT_R {
67        PABORT_R::new(((self.bits >> 5) & 1) != 0)
68    }
69    #[doc = "Bit 6 - TX Complete"]
70    #[inline(always)]
71    pub fn txc(&self) -> TXC_R {
72        TXC_R::new(((self.bits >> 6) & 1) != 0)
73    }
74    #[doc = "Bit 7 - TX Buffer Level"]
75    #[inline(always)]
76    pub fn txbl(&self) -> TXBL_R {
77        TXBL_R::new(((self.bits >> 7) & 1) != 0)
78    }
79    #[doc = "Bit 8 - RX Data Valid"]
80    #[inline(always)]
81    pub fn rxdatav(&self) -> RXDATAV_R {
82        RXDATAV_R::new(((self.bits >> 8) & 1) != 0)
83    }
84    #[doc = "Bit 9 - RX FIFO Full"]
85    #[inline(always)]
86    pub fn rxfull(&self) -> RXFULL_R {
87        RXFULL_R::new(((self.bits >> 9) & 1) != 0)
88    }
89    #[doc = "Bits 10:11 - TX Buffer Count"]
90    #[inline(always)]
91    pub fn txbufcnt(&self) -> TXBUFCNT_R {
92        TXBUFCNT_R::new(((self.bits >> 10) & 3) as u8)
93    }
94}
95#[doc = "No Description\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [status](index.html) module"]
96pub struct STATUS_SPEC;
97impl crate::RegisterSpec for STATUS_SPEC {
98    type Ux = u32;
99}
100#[doc = "`read()` method returns [status::R](R) reader structure"]
101impl crate::Readable for STATUS_SPEC {
102    type Reader = R;
103}
104#[doc = "`reset()` method sets STATUS to value 0x80"]
105impl crate::Resettable for STATUS_SPEC {
106    const RESET_VALUE: Self::Ux = 0x80;
107}