max78000_pac/uart0/
status.rs

1#[doc = "Register `STATUS` reader"]
2pub type R = crate::R<StatusSpec>;
3#[doc = "Field `TX_BUSY` reader - Read-only flag indicating the UART transmit status"]
4pub type TxBusyR = crate::BitReader;
5#[doc = "Field `RX_BUSY` reader - Read-only flag indicating the UART receiver status"]
6pub type RxBusyR = crate::BitReader;
7#[doc = "Field `RX_EM` reader - Read-only flag indicating the RX FIFO state"]
8pub type RxEmR = crate::BitReader;
9#[doc = "Field `RX_FULL` reader - Read-only flag indicating the RX FIFO state"]
10pub type RxFullR = crate::BitReader;
11#[doc = "Field `TX_EM` reader - Read-only flag indicating the TX FIFO state"]
12pub type TxEmR = crate::BitReader;
13#[doc = "Field `TX_FULL` reader - Read-only flag indicating the TX FIFO state"]
14pub type TxFullR = crate::BitReader;
15#[doc = "Field `RX_LVL` reader - Indicates the number of bytes currently in the RX FIFO (0-RX FIFO_ELTS)"]
16pub type RxLvlR = crate::FieldReader;
17#[doc = "Field `TX_LVL` reader - Indicates the number of bytes currently in the TX FIFO (0-TX FIFO_ELTS)"]
18pub type TxLvlR = crate::FieldReader;
19impl R {
20    #[doc = "Bit 0 - Read-only flag indicating the UART transmit status"]
21    #[inline(always)]
22    pub fn tx_busy(&self) -> TxBusyR {
23        TxBusyR::new((self.bits & 1) != 0)
24    }
25    #[doc = "Bit 1 - Read-only flag indicating the UART receiver status"]
26    #[inline(always)]
27    pub fn rx_busy(&self) -> RxBusyR {
28        RxBusyR::new(((self.bits >> 1) & 1) != 0)
29    }
30    #[doc = "Bit 4 - Read-only flag indicating the RX FIFO state"]
31    #[inline(always)]
32    pub fn rx_em(&self) -> RxEmR {
33        RxEmR::new(((self.bits >> 4) & 1) != 0)
34    }
35    #[doc = "Bit 5 - Read-only flag indicating the RX FIFO state"]
36    #[inline(always)]
37    pub fn rx_full(&self) -> RxFullR {
38        RxFullR::new(((self.bits >> 5) & 1) != 0)
39    }
40    #[doc = "Bit 6 - Read-only flag indicating the TX FIFO state"]
41    #[inline(always)]
42    pub fn tx_em(&self) -> TxEmR {
43        TxEmR::new(((self.bits >> 6) & 1) != 0)
44    }
45    #[doc = "Bit 7 - Read-only flag indicating the TX FIFO state"]
46    #[inline(always)]
47    pub fn tx_full(&self) -> TxFullR {
48        TxFullR::new(((self.bits >> 7) & 1) != 0)
49    }
50    #[doc = "Bits 8:11 - Indicates the number of bytes currently in the RX FIFO (0-RX FIFO_ELTS)"]
51    #[inline(always)]
52    pub fn rx_lvl(&self) -> RxLvlR {
53        RxLvlR::new(((self.bits >> 8) & 0x0f) as u8)
54    }
55    #[doc = "Bits 12:15 - Indicates the number of bytes currently in the TX FIFO (0-TX FIFO_ELTS)"]
56    #[inline(always)]
57    pub fn tx_lvl(&self) -> TxLvlR {
58        TxLvlR::new(((self.bits >> 12) & 0x0f) as u8)
59    }
60}
61#[doc = "Status register\n\nYou can [`read`](crate::Reg::read) this register and get [`status::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
62pub struct StatusSpec;
63impl crate::RegisterSpec for StatusSpec {
64    type Ux = u32;
65}
66#[doc = "`read()` method returns [`status::R`](R) reader structure"]
67impl crate::Readable for StatusSpec {}
68#[doc = "`reset()` method sets STATUS to value 0"]
69impl crate::Resettable for StatusSpec {
70    const RESET_VALUE: u32 = 0;
71}