esp32p4/usb_device/
jfifo_st.rs

1#[doc = "Register `JFIFO_ST` reader"]
2pub type R = crate::R<JFIFO_ST_SPEC>;
3#[doc = "Register `JFIFO_ST` writer"]
4pub type W = crate::W<JFIFO_ST_SPEC>;
5#[doc = "Field `IN_FIFO_CNT` reader - JTAT in fifo counter."]
6pub type IN_FIFO_CNT_R = crate::FieldReader;
7#[doc = "Field `IN_FIFO_EMPTY` reader - 1: JTAG in fifo is empty."]
8pub type IN_FIFO_EMPTY_R = crate::BitReader;
9#[doc = "Field `IN_FIFO_FULL` reader - 1: JTAG in fifo is full."]
10pub type IN_FIFO_FULL_R = crate::BitReader;
11#[doc = "Field `OUT_FIFO_CNT` reader - JTAT out fifo counter."]
12pub type OUT_FIFO_CNT_R = crate::FieldReader;
13#[doc = "Field `OUT_FIFO_EMPTY` reader - 1: JTAG out fifo is empty."]
14pub type OUT_FIFO_EMPTY_R = crate::BitReader;
15#[doc = "Field `OUT_FIFO_FULL` reader - 1: JTAG out fifo is full."]
16pub type OUT_FIFO_FULL_R = crate::BitReader;
17#[doc = "Field `IN_FIFO_RESET` reader - Write 1 to reset JTAG in fifo."]
18pub type IN_FIFO_RESET_R = crate::BitReader;
19#[doc = "Field `IN_FIFO_RESET` writer - Write 1 to reset JTAG in fifo."]
20pub type IN_FIFO_RESET_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `OUT_FIFO_RESET` reader - Write 1 to reset JTAG out fifo."]
22pub type OUT_FIFO_RESET_R = crate::BitReader;
23#[doc = "Field `OUT_FIFO_RESET` writer - Write 1 to reset JTAG out fifo."]
24pub type OUT_FIFO_RESET_W<'a, REG> = crate::BitWriter<'a, REG>;
25impl R {
26    #[doc = "Bits 0:1 - JTAT in fifo counter."]
27    #[inline(always)]
28    pub fn in_fifo_cnt(&self) -> IN_FIFO_CNT_R {
29        IN_FIFO_CNT_R::new((self.bits & 3) as u8)
30    }
31    #[doc = "Bit 2 - 1: JTAG in fifo is empty."]
32    #[inline(always)]
33    pub fn in_fifo_empty(&self) -> IN_FIFO_EMPTY_R {
34        IN_FIFO_EMPTY_R::new(((self.bits >> 2) & 1) != 0)
35    }
36    #[doc = "Bit 3 - 1: JTAG in fifo is full."]
37    #[inline(always)]
38    pub fn in_fifo_full(&self) -> IN_FIFO_FULL_R {
39        IN_FIFO_FULL_R::new(((self.bits >> 3) & 1) != 0)
40    }
41    #[doc = "Bits 4:5 - JTAT out fifo counter."]
42    #[inline(always)]
43    pub fn out_fifo_cnt(&self) -> OUT_FIFO_CNT_R {
44        OUT_FIFO_CNT_R::new(((self.bits >> 4) & 3) as u8)
45    }
46    #[doc = "Bit 6 - 1: JTAG out fifo is empty."]
47    #[inline(always)]
48    pub fn out_fifo_empty(&self) -> OUT_FIFO_EMPTY_R {
49        OUT_FIFO_EMPTY_R::new(((self.bits >> 6) & 1) != 0)
50    }
51    #[doc = "Bit 7 - 1: JTAG out fifo is full."]
52    #[inline(always)]
53    pub fn out_fifo_full(&self) -> OUT_FIFO_FULL_R {
54        OUT_FIFO_FULL_R::new(((self.bits >> 7) & 1) != 0)
55    }
56    #[doc = "Bit 8 - Write 1 to reset JTAG in fifo."]
57    #[inline(always)]
58    pub fn in_fifo_reset(&self) -> IN_FIFO_RESET_R {
59        IN_FIFO_RESET_R::new(((self.bits >> 8) & 1) != 0)
60    }
61    #[doc = "Bit 9 - Write 1 to reset JTAG out fifo."]
62    #[inline(always)]
63    pub fn out_fifo_reset(&self) -> OUT_FIFO_RESET_R {
64        OUT_FIFO_RESET_R::new(((self.bits >> 9) & 1) != 0)
65    }
66}
67#[cfg(feature = "impl-register-debug")]
68impl core::fmt::Debug for R {
69    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
70        f.debug_struct("JFIFO_ST")
71            .field(
72                "in_fifo_cnt",
73                &format_args!("{}", self.in_fifo_cnt().bits()),
74            )
75            .field(
76                "in_fifo_empty",
77                &format_args!("{}", self.in_fifo_empty().bit()),
78            )
79            .field(
80                "in_fifo_full",
81                &format_args!("{}", self.in_fifo_full().bit()),
82            )
83            .field(
84                "out_fifo_cnt",
85                &format_args!("{}", self.out_fifo_cnt().bits()),
86            )
87            .field(
88                "out_fifo_empty",
89                &format_args!("{}", self.out_fifo_empty().bit()),
90            )
91            .field(
92                "out_fifo_full",
93                &format_args!("{}", self.out_fifo_full().bit()),
94            )
95            .field(
96                "in_fifo_reset",
97                &format_args!("{}", self.in_fifo_reset().bit()),
98            )
99            .field(
100                "out_fifo_reset",
101                &format_args!("{}", self.out_fifo_reset().bit()),
102            )
103            .finish()
104    }
105}
106#[cfg(feature = "impl-register-debug")]
107impl core::fmt::Debug for crate::generic::Reg<JFIFO_ST_SPEC> {
108    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
109        core::fmt::Debug::fmt(&self.read(), f)
110    }
111}
112impl W {
113    #[doc = "Bit 8 - Write 1 to reset JTAG in fifo."]
114    #[inline(always)]
115    #[must_use]
116    pub fn in_fifo_reset(&mut self) -> IN_FIFO_RESET_W<JFIFO_ST_SPEC> {
117        IN_FIFO_RESET_W::new(self, 8)
118    }
119    #[doc = "Bit 9 - Write 1 to reset JTAG out fifo."]
120    #[inline(always)]
121    #[must_use]
122    pub fn out_fifo_reset(&mut self) -> OUT_FIFO_RESET_W<JFIFO_ST_SPEC> {
123        OUT_FIFO_RESET_W::new(self, 9)
124    }
125}
126#[doc = "JTAG FIFO status and control registers.\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`jfifo_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 [`jfifo_st::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
127pub struct JFIFO_ST_SPEC;
128impl crate::RegisterSpec for JFIFO_ST_SPEC {
129    type Ux = u32;
130}
131#[doc = "`read()` method returns [`jfifo_st::R`](R) reader structure"]
132impl crate::Readable for JFIFO_ST_SPEC {}
133#[doc = "`write(|w| ..)` method takes [`jfifo_st::W`](W) writer structure"]
134impl crate::Writable for JFIFO_ST_SPEC {
135    type Safety = crate::Unsafe;
136    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
137    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
138}
139#[doc = "`reset()` method sets JFIFO_ST to value 0x44"]
140impl crate::Resettable for JFIFO_ST_SPEC {
141    const RESET_VALUE: u32 = 0x44;
142}