esp32p4/h264_dma/in_ch/
state.rs

1#[doc = "Register `STATE` reader"]
2pub type R = crate::R<STATE_SPEC>;
3#[doc = "Field `INLINK_DSCR_ADDR` reader - This register stores the current inlink descriptor's address."]
4pub type INLINK_DSCR_ADDR_R = crate::FieldReader<u32>;
5#[doc = "Field `IN_DSCR_STATE` reader - This register stores the current descriptor state machine state."]
6pub type IN_DSCR_STATE_R = crate::FieldReader;
7#[doc = "Field `IN_STATE` reader - This register stores the current control module state machine state."]
8pub type IN_STATE_R = crate::FieldReader;
9#[doc = "Field `IN_RESET_AVAIL` reader - This register indicate that if the channel reset is safety."]
10pub type IN_RESET_AVAIL_R = crate::BitReader;
11impl R {
12    #[doc = "Bits 0:17 - This register stores the current inlink descriptor's address."]
13    #[inline(always)]
14    pub fn inlink_dscr_addr(&self) -> INLINK_DSCR_ADDR_R {
15        INLINK_DSCR_ADDR_R::new(self.bits & 0x0003_ffff)
16    }
17    #[doc = "Bits 18:19 - This register stores the current descriptor state machine state."]
18    #[inline(always)]
19    pub fn in_dscr_state(&self) -> IN_DSCR_STATE_R {
20        IN_DSCR_STATE_R::new(((self.bits >> 18) & 3) as u8)
21    }
22    #[doc = "Bits 20:22 - This register stores the current control module state machine state."]
23    #[inline(always)]
24    pub fn in_state(&self) -> IN_STATE_R {
25        IN_STATE_R::new(((self.bits >> 20) & 7) as u8)
26    }
27    #[doc = "Bit 23 - This register indicate that if the channel reset is safety."]
28    #[inline(always)]
29    pub fn in_reset_avail(&self) -> IN_RESET_AVAIL_R {
30        IN_RESET_AVAIL_R::new(((self.bits >> 23) & 1) != 0)
31    }
32}
33#[cfg(feature = "impl-register-debug")]
34impl core::fmt::Debug for R {
35    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
36        f.debug_struct("STATE")
37            .field(
38                "inlink_dscr_addr",
39                &format_args!("{}", self.inlink_dscr_addr().bits()),
40            )
41            .field(
42                "in_dscr_state",
43                &format_args!("{}", self.in_dscr_state().bits()),
44            )
45            .field("in_state", &format_args!("{}", self.in_state().bits()))
46            .field(
47                "in_reset_avail",
48                &format_args!("{}", self.in_reset_avail().bit()),
49            )
50            .finish()
51    }
52}
53#[cfg(feature = "impl-register-debug")]
54impl core::fmt::Debug for crate::generic::Reg<STATE_SPEC> {
55    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
56        core::fmt::Debug::fmt(&self.read(), f)
57    }
58}
59#[doc = "RX CHx state register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`state::R`](R).  See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
60pub struct STATE_SPEC;
61impl crate::RegisterSpec for STATE_SPEC {
62    type Ux = u32;
63}
64#[doc = "`read()` method returns [`state::R`](R) reader structure"]
65impl crate::Readable for STATE_SPEC {}
66#[doc = "`reset()` method sets STATE to value 0x0080_0000"]
67impl crate::Resettable for STATE_SPEC {
68    const RESET_VALUE: u32 = 0x0080_0000;
69}