1#[doc = "Register `VLAN_TAG` reader"]
2pub type R = crate::R<VLAN_TAG_SPEC>;
3#[doc = "Register `VLAN_TAG` writer"]
4pub type W = crate::W<VLAN_TAG_SPEC>;
5#[doc = "Field `VL` reader - VLAN Tag Identifier for Receive Frames"]
6pub type VL_R = crate::FieldReader<u16>;
7#[doc = "Field `VL` writer - VLAN Tag Identifier for Receive Frames"]
8pub type VL_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
9#[doc = "Field `ETV` reader - Enable 12-Bit VLAN Tag Comparison"]
10pub type ETV_R = crate::BitReader;
11#[doc = "Field `ETV` writer - Enable 12-Bit VLAN Tag Comparison"]
12pub type ETV_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `VTIM` reader - VLAN Tag Inverse Match Enable"]
14pub type VTIM_R = crate::BitReader;
15#[doc = "Field `VTIM` writer - VLAN Tag Inverse Match Enable"]
16pub type VTIM_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `ESVL` reader - Enable S-VLAN"]
18pub type ESVL_R = crate::BitReader;
19#[doc = "Field `ESVL` writer - Enable S-VLAN"]
20pub type ESVL_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `VTHM` reader - VLAN Tag Hash Table Match Enable"]
22pub type VTHM_R = crate::BitReader;
23impl R {
24 #[doc = "Bits 0:15 - VLAN Tag Identifier for Receive Frames"]
25 #[inline(always)]
26 pub fn vl(&self) -> VL_R {
27 VL_R::new((self.bits & 0xffff) as u16)
28 }
29 #[doc = "Bit 16 - Enable 12-Bit VLAN Tag Comparison"]
30 #[inline(always)]
31 pub fn etv(&self) -> ETV_R {
32 ETV_R::new(((self.bits >> 16) & 1) != 0)
33 }
34 #[doc = "Bit 17 - VLAN Tag Inverse Match Enable"]
35 #[inline(always)]
36 pub fn vtim(&self) -> VTIM_R {
37 VTIM_R::new(((self.bits >> 17) & 1) != 0)
38 }
39 #[doc = "Bit 18 - Enable S-VLAN"]
40 #[inline(always)]
41 pub fn esvl(&self) -> ESVL_R {
42 ESVL_R::new(((self.bits >> 18) & 1) != 0)
43 }
44 #[doc = "Bit 19 - VLAN Tag Hash Table Match Enable"]
45 #[inline(always)]
46 pub fn vthm(&self) -> VTHM_R {
47 VTHM_R::new(((self.bits >> 19) & 1) != 0)
48 }
49}
50impl W {
51 #[doc = "Bits 0:15 - VLAN Tag Identifier for Receive Frames"]
52 #[inline(always)]
53 pub fn vl(&mut self) -> VL_W<VLAN_TAG_SPEC> {
54 VL_W::new(self, 0)
55 }
56 #[doc = "Bit 16 - Enable 12-Bit VLAN Tag Comparison"]
57 #[inline(always)]
58 pub fn etv(&mut self) -> ETV_W<VLAN_TAG_SPEC> {
59 ETV_W::new(self, 16)
60 }
61 #[doc = "Bit 17 - VLAN Tag Inverse Match Enable"]
62 #[inline(always)]
63 pub fn vtim(&mut self) -> VTIM_W<VLAN_TAG_SPEC> {
64 VTIM_W::new(self, 17)
65 }
66 #[doc = "Bit 18 - Enable S-VLAN"]
67 #[inline(always)]
68 pub fn esvl(&mut self) -> ESVL_W<VLAN_TAG_SPEC> {
69 ESVL_W::new(self, 18)
70 }
71}
72#[doc = "VLAN Tag Register\n\nYou can [`read`](crate::Reg::read) this register and get [`vlan_tag::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`vlan_tag::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
73pub struct VLAN_TAG_SPEC;
74impl crate::RegisterSpec for VLAN_TAG_SPEC {
75 type Ux = u32;
76}
77#[doc = "`read()` method returns [`vlan_tag::R`](R) reader structure"]
78impl crate::Readable for VLAN_TAG_SPEC {}
79#[doc = "`write(|w| ..)` method takes [`vlan_tag::W`](W) writer structure"]
80impl crate::Writable for VLAN_TAG_SPEC {
81 type Safety = crate::Unsafe;
82 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
83 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
84}
85#[doc = "`reset()` method sets VLAN_TAG to value 0"]
86impl crate::Resettable for VLAN_TAG_SPEC {
87 const RESET_VALUE: u32 = 0;
88}