rp2040_pac/sio/
fifo_st.rs

1#[doc = "Register `FIFO_ST` reader"]
2pub type R = crate::R<FIFO_ST_SPEC>;
3#[doc = "Register `FIFO_ST` writer"]
4pub type W = crate::W<FIFO_ST_SPEC>;
5#[doc = "Field `VLD` reader - Value is 1 if this core's RX FIFO is not empty (i.e. if FIFO_RD is valid)"]
6pub type VLD_R = crate::BitReader;
7#[doc = "Field `RDY` reader - Value is 1 if this core's TX FIFO is not full (i.e. if FIFO_WR is ready for more data)"]
8pub type RDY_R = crate::BitReader;
9#[doc = "Field `WOF` reader - Sticky flag indicating the TX FIFO was written when full. This write was ignored by the FIFO."]
10pub type WOF_R = crate::BitReader;
11#[doc = "Field `WOF` writer - Sticky flag indicating the TX FIFO was written when full. This write was ignored by the FIFO."]
12pub type WOF_W<'a, REG> = crate::BitWriter1C<'a, REG>;
13#[doc = "Field `ROE` reader - Sticky flag indicating the RX FIFO was read when empty. This read was ignored by the FIFO."]
14pub type ROE_R = crate::BitReader;
15#[doc = "Field `ROE` writer - Sticky flag indicating the RX FIFO was read when empty. This read was ignored by the FIFO."]
16pub type ROE_W<'a, REG> = crate::BitWriter1C<'a, REG>;
17impl R {
18    #[doc = "Bit 0 - Value is 1 if this core's RX FIFO is not empty (i.e. if FIFO_RD is valid)"]
19    #[inline(always)]
20    pub fn vld(&self) -> VLD_R {
21        VLD_R::new((self.bits & 1) != 0)
22    }
23    #[doc = "Bit 1 - Value is 1 if this core's TX FIFO is not full (i.e. if FIFO_WR is ready for more data)"]
24    #[inline(always)]
25    pub fn rdy(&self) -> RDY_R {
26        RDY_R::new(((self.bits >> 1) & 1) != 0)
27    }
28    #[doc = "Bit 2 - Sticky flag indicating the TX FIFO was written when full. This write was ignored by the FIFO."]
29    #[inline(always)]
30    pub fn wof(&self) -> WOF_R {
31        WOF_R::new(((self.bits >> 2) & 1) != 0)
32    }
33    #[doc = "Bit 3 - Sticky flag indicating the RX FIFO was read when empty. This read was ignored by the FIFO."]
34    #[inline(always)]
35    pub fn roe(&self) -> ROE_R {
36        ROE_R::new(((self.bits >> 3) & 1) != 0)
37    }
38}
39impl W {
40    #[doc = "Bit 2 - Sticky flag indicating the TX FIFO was written when full. This write was ignored by the FIFO."]
41    #[inline(always)]
42    #[must_use]
43    pub fn wof(&mut self) -> WOF_W<FIFO_ST_SPEC> {
44        WOF_W::new(self, 2)
45    }
46    #[doc = "Bit 3 - Sticky flag indicating the RX FIFO was read when empty. This read was ignored by the FIFO."]
47    #[inline(always)]
48    #[must_use]
49    pub fn roe(&mut self) -> ROE_W<FIFO_ST_SPEC> {
50        ROE_W::new(self, 3)
51    }
52    #[doc = r" Writes raw bits to the register."]
53    #[doc = r""]
54    #[doc = r" # Safety"]
55    #[doc = r""]
56    #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
57    #[inline(always)]
58    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
59        self.bits = bits;
60        self
61    }
62}
63#[doc = "Status register for inter-core FIFOs (mailboxes).  
64 There is one FIFO in the core 0 -> core 1 direction, and one core 1 -> core 0. Both are 32 bits wide and 8 words deep.  
65 Core 0 can see the read side of the 1->0 FIFO (RX), and the write side of 0->1 FIFO (TX).  
66 Core 1 can see the read side of the 0->1 FIFO (RX), and the write side of 1->0 FIFO (TX).  
67 The SIO IRQ for each core is the logical OR of the VLD, WOF and ROE fields of its FIFO_ST register.  
68
69You can [`read`](crate::generic::Reg::read) this register and get [`fifo_st::R`](R).  You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`fifo_st::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
70pub struct FIFO_ST_SPEC;
71impl crate::RegisterSpec for FIFO_ST_SPEC {
72    type Ux = u32;
73}
74#[doc = "`read()` method returns [`fifo_st::R`](R) reader structure"]
75impl crate::Readable for FIFO_ST_SPEC {}
76#[doc = "`write(|w| ..)` method takes [`fifo_st::W`](W) writer structure"]
77impl crate::Writable for FIFO_ST_SPEC {
78    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
79    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0x0c;
80}
81#[doc = "`reset()` method sets FIFO_ST to value 0x02"]
82impl crate::Resettable for FIFO_ST_SPEC {
83    const RESET_VALUE: u32 = 0x02;
84}