esp32p4/axi_dma/in_ch/
in_pri.rs

1#[doc = "Register `IN_PRI` reader"]
2pub type R = crate::R<IN_PRI_SPEC>;
3#[doc = "Register `IN_PRI` writer"]
4pub type W = crate::W<IN_PRI_SPEC>;
5#[doc = "Field `RX_PRI` reader - The priority of Rx channel 0. The larger of the value the higher of the priority."]
6pub type RX_PRI_R = crate::FieldReader;
7#[doc = "Field `RX_PRI` writer - The priority of Rx channel 0. The larger of the value the higher of the priority."]
8pub type RX_PRI_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
9#[doc = "Field `RX_CH_ARB_WEIGH` reader - The weight of Rx channel 0"]
10pub type RX_CH_ARB_WEIGH_R = crate::FieldReader;
11#[doc = "Field `RX_CH_ARB_WEIGH` writer - The weight of Rx channel 0"]
12pub type RX_CH_ARB_WEIGH_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
13#[doc = "Field `RX_ARB_WEIGH_OPT_DIR` reader - 0: mean not optimazation weight function ,1: mean optimazation"]
14pub type RX_ARB_WEIGH_OPT_DIR_R = crate::BitReader;
15#[doc = "Field `RX_ARB_WEIGH_OPT_DIR` writer - 0: mean not optimazation weight function ,1: mean optimazation"]
16pub type RX_ARB_WEIGH_OPT_DIR_W<'a, REG> = crate::BitWriter<'a, REG>;
17impl R {
18    #[doc = "Bits 0:3 - The priority of Rx channel 0. The larger of the value the higher of the priority."]
19    #[inline(always)]
20    pub fn rx_pri(&self) -> RX_PRI_R {
21        RX_PRI_R::new((self.bits & 0x0f) as u8)
22    }
23    #[doc = "Bits 4:7 - The weight of Rx channel 0"]
24    #[inline(always)]
25    pub fn rx_ch_arb_weigh(&self) -> RX_CH_ARB_WEIGH_R {
26        RX_CH_ARB_WEIGH_R::new(((self.bits >> 4) & 0x0f) as u8)
27    }
28    #[doc = "Bit 8 - 0: mean not optimazation weight function ,1: mean optimazation"]
29    #[inline(always)]
30    pub fn rx_arb_weigh_opt_dir(&self) -> RX_ARB_WEIGH_OPT_DIR_R {
31        RX_ARB_WEIGH_OPT_DIR_R::new(((self.bits >> 8) & 1) != 0)
32    }
33}
34#[cfg(feature = "impl-register-debug")]
35impl core::fmt::Debug for R {
36    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
37        f.debug_struct("IN_PRI")
38            .field("rx_pri", &format_args!("{}", self.rx_pri().bits()))
39            .field(
40                "rx_ch_arb_weigh",
41                &format_args!("{}", self.rx_ch_arb_weigh().bits()),
42            )
43            .field(
44                "rx_arb_weigh_opt_dir",
45                &format_args!("{}", self.rx_arb_weigh_opt_dir().bit()),
46            )
47            .finish()
48    }
49}
50#[cfg(feature = "impl-register-debug")]
51impl core::fmt::Debug for crate::generic::Reg<IN_PRI_SPEC> {
52    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
53        core::fmt::Debug::fmt(&self.read(), f)
54    }
55}
56impl W {
57    #[doc = "Bits 0:3 - The priority of Rx channel 0. The larger of the value the higher of the priority."]
58    #[inline(always)]
59    #[must_use]
60    pub fn rx_pri(&mut self) -> RX_PRI_W<IN_PRI_SPEC> {
61        RX_PRI_W::new(self, 0)
62    }
63    #[doc = "Bits 4:7 - The weight of Rx channel 0"]
64    #[inline(always)]
65    #[must_use]
66    pub fn rx_ch_arb_weigh(&mut self) -> RX_CH_ARB_WEIGH_W<IN_PRI_SPEC> {
67        RX_CH_ARB_WEIGH_W::new(self, 4)
68    }
69    #[doc = "Bit 8 - 0: mean not optimazation weight function ,1: mean optimazation"]
70    #[inline(always)]
71    #[must_use]
72    pub fn rx_arb_weigh_opt_dir(&mut self) -> RX_ARB_WEIGH_OPT_DIR_W<IN_PRI_SPEC> {
73        RX_ARB_WEIGH_OPT_DIR_W::new(self, 8)
74    }
75}
76#[doc = "Priority register of Rx channel 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`in_pri::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 [`in_pri::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
77pub struct IN_PRI_SPEC;
78impl crate::RegisterSpec for IN_PRI_SPEC {
79    type Ux = u32;
80}
81#[doc = "`read()` method returns [`in_pri::R`](R) reader structure"]
82impl crate::Readable for IN_PRI_SPEC {}
83#[doc = "`write(|w| ..)` method takes [`in_pri::W`](W) writer structure"]
84impl crate::Writable for IN_PRI_SPEC {
85    type Safety = crate::Unsafe;
86    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
87    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
88}
89#[doc = "`reset()` method sets IN_PRI to value 0"]
90impl crate::Resettable for IN_PRI_SPEC {
91    const RESET_VALUE: u32 = 0;
92}