esp32/emac_mac/
pmt_csr.rs1#[doc = "Register `PMT_CSR` reader"]
2pub type R = crate::R<PMT_CSR_SPEC>;
3#[doc = "Field `PWRDWN` reader - When set the MAC receiver drops all received frames until it receives the expected magic packet or remote wake-up frame.This bit must only be set when MGKPKTEN GLBLUCAST or RWKPKTEN bit is set high."]
4pub type PWRDWN_R = crate::BitReader;
5#[doc = "Field `MGKPKTEN` reader - When set enables generation of a power management event because of magic packet reception."]
6pub type MGKPKTEN_R = crate::BitReader;
7#[doc = "Field `RWKPKTEN` reader - When set enables generation of a power management event because of remote wake-up frame reception"]
8pub type RWKPKTEN_R = crate::BitReader;
9#[doc = "Field `MGKPRCVD` reader - When set this bit indicates that the power management event is generated because of the reception of a magic packet. This bit is cleared by a Read into this register."]
10pub type MGKPRCVD_R = crate::BitReader;
11#[doc = "Field `RWKPRCVD` reader - When set this bit indicates the power management event is generated because of the reception of a remote wake-up frame. This bit is cleared by a Read into this register."]
12pub type RWKPRCVD_R = crate::BitReader;
13#[doc = "Field `GLBLUCAST` reader - When set enables any unicast packet filtered by the MAC (DAFilter) address recognition to be a remote wake-up frame."]
14pub type GLBLUCAST_R = crate::BitReader;
15#[doc = "Field `RWKPTR` reader - The maximum value of the pointer is 7 the detail information please refer to PMT_RWUFFR."]
16pub type RWKPTR_R = crate::FieldReader;
17#[doc = "Field `RWKFILTRST` reader - When this bit is set it resets the RWKPTR register to 3’b000."]
18pub type RWKFILTRST_R = crate::BitReader;
19impl R {
20 #[doc = "Bit 0 - When set the MAC receiver drops all received frames until it receives the expected magic packet or remote wake-up frame.This bit must only be set when MGKPKTEN GLBLUCAST or RWKPKTEN bit is set high."]
21 #[inline(always)]
22 pub fn pwrdwn(&self) -> PWRDWN_R {
23 PWRDWN_R::new((self.bits & 1) != 0)
24 }
25 #[doc = "Bit 1 - When set enables generation of a power management event because of magic packet reception."]
26 #[inline(always)]
27 pub fn mgkpkten(&self) -> MGKPKTEN_R {
28 MGKPKTEN_R::new(((self.bits >> 1) & 1) != 0)
29 }
30 #[doc = "Bit 2 - When set enables generation of a power management event because of remote wake-up frame reception"]
31 #[inline(always)]
32 pub fn rwkpkten(&self) -> RWKPKTEN_R {
33 RWKPKTEN_R::new(((self.bits >> 2) & 1) != 0)
34 }
35 #[doc = "Bit 5 - When set this bit indicates that the power management event is generated because of the reception of a magic packet. This bit is cleared by a Read into this register."]
36 #[inline(always)]
37 pub fn mgkprcvd(&self) -> MGKPRCVD_R {
38 MGKPRCVD_R::new(((self.bits >> 5) & 1) != 0)
39 }
40 #[doc = "Bit 6 - When set this bit indicates the power management event is generated because of the reception of a remote wake-up frame. This bit is cleared by a Read into this register."]
41 #[inline(always)]
42 pub fn rwkprcvd(&self) -> RWKPRCVD_R {
43 RWKPRCVD_R::new(((self.bits >> 6) & 1) != 0)
44 }
45 #[doc = "Bit 9 - When set enables any unicast packet filtered by the MAC (DAFilter) address recognition to be a remote wake-up frame."]
46 #[inline(always)]
47 pub fn glblucast(&self) -> GLBLUCAST_R {
48 GLBLUCAST_R::new(((self.bits >> 9) & 1) != 0)
49 }
50 #[doc = "Bits 24:28 - The maximum value of the pointer is 7 the detail information please refer to PMT_RWUFFR."]
51 #[inline(always)]
52 pub fn rwkptr(&self) -> RWKPTR_R {
53 RWKPTR_R::new(((self.bits >> 24) & 0x1f) as u8)
54 }
55 #[doc = "Bit 31 - When this bit is set it resets the RWKPTR register to 3’b000."]
56 #[inline(always)]
57 pub fn rwkfiltrst(&self) -> RWKFILTRST_R {
58 RWKFILTRST_R::new(((self.bits >> 31) & 1) != 0)
59 }
60}
61#[cfg(feature = "impl-register-debug")]
62impl core::fmt::Debug for R {
63 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
64 f.debug_struct("PMT_CSR")
65 .field("pwrdwn", &self.pwrdwn())
66 .field("mgkpkten", &self.mgkpkten())
67 .field("rwkpkten", &self.rwkpkten())
68 .field("mgkprcvd", &self.mgkprcvd())
69 .field("rwkprcvd", &self.rwkprcvd())
70 .field("glblucast", &self.glblucast())
71 .field("rwkptr", &self.rwkptr())
72 .field("rwkfiltrst", &self.rwkfiltrst())
73 .finish()
74 }
75}
76#[doc = "PMT Control and Status\n\nYou can [`read`](crate::Reg::read) this register and get [`pmt_csr::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
77pub struct PMT_CSR_SPEC;
78impl crate::RegisterSpec for PMT_CSR_SPEC {
79 type Ux = u32;
80}
81#[doc = "`read()` method returns [`pmt_csr::R`](R) reader structure"]
82impl crate::Readable for PMT_CSR_SPEC {}
83#[doc = "`reset()` method sets PMT_CSR to value 0"]
84impl crate::Resettable for PMT_CSR_SPEC {
85 const RESET_VALUE: u32 = 0;
86}