Skip to main content

rk3399_pac/pcie_client/
msg_code0.rs

1#[doc = "Register `MSG_CODE0` reader"]
2pub type R = crate::R<MsgCode0Spec>;
3#[doc = "Register `MSG_CODE0` writer"]
4pub type W = crate::W<MsgCode0Spec>;
5#[doc = "Field `MTPAT1` reader - Match pattern 1\n\nPattern 1"]
6pub type Mtpat1R = crate::FieldReader;
7#[doc = "Field `MTPAT1` writer - Match pattern 1\n\nPattern 1"]
8pub type Mtpat1W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9#[doc = "Field `MTPAT2` reader - Match pattern 2\n\nPattern2"]
10pub type Mtpat2R = crate::FieldReader;
11#[doc = "Field `MTPAT2` writer - Match pattern 2\n\nPattern2"]
12pub type Mtpat2W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
13#[doc = "Field `MTPAT3` reader - Match pattern 3\n\nPattern3"]
14pub type Mtpat3R = crate::FieldReader;
15#[doc = "Field `MTPAT3` writer - Match pattern 3\n\nPattern3"]
16pub type Mtpat3W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
17#[doc = "Field `MTPAT4` reader - Match pattern 4\n\nPattern4"]
18pub type Mtpat4R = crate::FieldReader;
19#[doc = "Field `MTPAT4` writer - Match pattern 4\n\nPattern4"]
20pub type Mtpat4W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
21impl R {
22    #[doc = "Bits 0:7 - Match pattern 1\n\nPattern 1"]
23    #[inline(always)]
24    pub fn mtpat1(&self) -> Mtpat1R {
25        Mtpat1R::new((self.bits & 0xff) as u8)
26    }
27    #[doc = "Bits 8:15 - Match pattern 2\n\nPattern2"]
28    #[inline(always)]
29    pub fn mtpat2(&self) -> Mtpat2R {
30        Mtpat2R::new(((self.bits >> 8) & 0xff) as u8)
31    }
32    #[doc = "Bits 16:23 - Match pattern 3\n\nPattern3"]
33    #[inline(always)]
34    pub fn mtpat3(&self) -> Mtpat3R {
35        Mtpat3R::new(((self.bits >> 16) & 0xff) as u8)
36    }
37    #[doc = "Bits 24:31 - Match pattern 4\n\nPattern4"]
38    #[inline(always)]
39    pub fn mtpat4(&self) -> Mtpat4R {
40        Mtpat4R::new(((self.bits >> 24) & 0xff) as u8)
41    }
42}
43impl W {
44    #[doc = "Bits 0:7 - Match pattern 1\n\nPattern 1"]
45    #[inline(always)]
46    #[must_use]
47    pub fn mtpat1(&mut self) -> Mtpat1W<MsgCode0Spec> {
48        Mtpat1W::new(self, 0)
49    }
50    #[doc = "Bits 8:15 - Match pattern 2\n\nPattern2"]
51    #[inline(always)]
52    #[must_use]
53    pub fn mtpat2(&mut self) -> Mtpat2W<MsgCode0Spec> {
54        Mtpat2W::new(self, 8)
55    }
56    #[doc = "Bits 16:23 - Match pattern 3\n\nPattern3"]
57    #[inline(always)]
58    #[must_use]
59    pub fn mtpat3(&mut self) -> Mtpat3W<MsgCode0Spec> {
60        Mtpat3W::new(self, 16)
61    }
62    #[doc = "Bits 24:31 - Match pattern 4\n\nPattern4"]
63    #[inline(always)]
64    #[must_use]
65    pub fn mtpat4(&mut self) -> Mtpat4W<MsgCode0Spec> {
66        Mtpat4W::new(self, 24)
67    }
68}
69#[doc = "Message code 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`msg_code0::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 [`msg_code0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
70pub struct MsgCode0Spec;
71impl crate::RegisterSpec for MsgCode0Spec {
72    type Ux = u32;
73}
74#[doc = "`read()` method returns [`msg_code0::R`](R) reader structure"]
75impl crate::Readable for MsgCode0Spec {}
76#[doc = "`write(|w| ..)` method takes [`msg_code0::W`](W) writer structure"]
77impl crate::Writable for MsgCode0Spec {
78    type Safety = crate::Unsafe;
79    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
80    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
81}
82#[doc = "`reset()` method sets MSG_CODE0 to value 0"]
83impl crate::Resettable for MsgCode0Spec {
84    const RESET_VALUE: u32 = 0;
85}