efm32g230_pac/leuart1/
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 `RXENS` reader - Receiver Enable Status"]
17pub type RXENS_R = crate::BitReader<bool>;
18#[doc = "Field `TXENS` reader - Transmitter Enable Status"]
19pub type TXENS_R = crate::BitReader<bool>;
20#[doc = "Field `RXBLOCK` reader - Block Incoming Data"]
21pub type RXBLOCK_R = crate::BitReader<bool>;
22#[doc = "Field `TXC` reader - TX Complete"]
23pub type TXC_R = crate::BitReader<bool>;
24#[doc = "Field `TXBL` reader - TX Buffer Level"]
25pub type TXBL_R = crate::BitReader<bool>;
26#[doc = "Field `RXDATAV` reader - RX Data Valid"]
27pub type RXDATAV_R = crate::BitReader<bool>;
28impl R {
29    #[doc = "Bit 0 - Receiver Enable Status"]
30    #[inline(always)]
31    pub fn rxens(&self) -> RXENS_R {
32        RXENS_R::new((self.bits & 1) != 0)
33    }
34    #[doc = "Bit 1 - Transmitter Enable Status"]
35    #[inline(always)]
36    pub fn txens(&self) -> TXENS_R {
37        TXENS_R::new(((self.bits >> 1) & 1) != 0)
38    }
39    #[doc = "Bit 2 - Block Incoming Data"]
40    #[inline(always)]
41    pub fn rxblock(&self) -> RXBLOCK_R {
42        RXBLOCK_R::new(((self.bits >> 2) & 1) != 0)
43    }
44    #[doc = "Bit 3 - TX Complete"]
45    #[inline(always)]
46    pub fn txc(&self) -> TXC_R {
47        TXC_R::new(((self.bits >> 3) & 1) != 0)
48    }
49    #[doc = "Bit 4 - TX Buffer Level"]
50    #[inline(always)]
51    pub fn txbl(&self) -> TXBL_R {
52        TXBL_R::new(((self.bits >> 4) & 1) != 0)
53    }
54    #[doc = "Bit 5 - RX Data Valid"]
55    #[inline(always)]
56    pub fn rxdatav(&self) -> RXDATAV_R {
57        RXDATAV_R::new(((self.bits >> 5) & 1) != 0)
58    }
59}
60#[doc = "Status Register\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"]
61pub struct STATUS_SPEC;
62impl crate::RegisterSpec for STATUS_SPEC {
63    type Ux = u32;
64}
65#[doc = "`read()` method returns [status::R](R) reader structure"]
66impl crate::Readable for STATUS_SPEC {
67    type Reader = R;
68}
69#[doc = "`reset()` method sets STATUS to value 0x10"]
70impl crate::Resettable for STATUS_SPEC {
71    #[inline(always)]
72    fn reset_value() -> Self::Ux {
73        0x10
74    }
75}