efm32gg11b/eth/
pbufrxcutthru.rs

1#[doc = "Reader of register PBUFRXCUTTHRU"]
2pub type R = crate::R<u32, super::PBUFRXCUTTHRU>;
3#[doc = "Writer for register PBUFRXCUTTHRU"]
4pub type W = crate::W<u32, super::PBUFRXCUTTHRU>;
5#[doc = "Register PBUFRXCUTTHRU `reset()`'s with value 0x03ff"]
6impl crate::ResetValue for super::PBUFRXCUTTHRU {
7    type Type = u32;
8    #[inline(always)]
9    fn reset_value() -> Self::Type { 0x03ff }
10}
11#[doc = "Reader of field `DMARXCUTTHRUTHR`"]
12pub type DMARXCUTTHRUTHR_R = crate::R<u16, u16>;
13#[doc = "Write proxy for field `DMARXCUTTHRUTHR`"]
14pub struct DMARXCUTTHRUTHR_W<'a> {
15    w: &'a mut W,
16}
17impl<'a> DMARXCUTTHRUTHR_W<'a> {
18    #[doc = r"Writes raw bits to the field"]
19    #[inline(always)]
20    pub unsafe fn bits(self, value: u16) -> &'a mut W {
21        self.w.bits = (self.w.bits & !0x03ff) | ((value as u32) & 0x03ff);
22        self.w
23    }
24}
25#[doc = "Reader of field `DMARXCUTTHRU`"]
26pub type DMARXCUTTHRU_R = crate::R<bool, bool>;
27#[doc = "Write proxy for field `DMARXCUTTHRU`"]
28pub struct DMARXCUTTHRU_W<'a> {
29    w: &'a mut W,
30}
31impl<'a> DMARXCUTTHRU_W<'a> {
32    #[doc = r"Sets the field bit"]
33    #[inline(always)]
34    pub fn set_bit(self) -> &'a mut W { self.bit(true) }
35    #[doc = r"Clears the field bit"]
36    #[inline(always)]
37    pub fn clear_bit(self) -> &'a mut W { self.bit(false) }
38    #[doc = r"Writes raw bits to the field"]
39    #[inline(always)]
40    pub fn bit(self, value: bool) -> &'a mut W {
41        self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31);
42        self.w
43    }
44}
45impl R {
46    #[doc = "Bits 0:9 - Watermark value"]
47    #[inline(always)]
48    pub fn dmarxcutthruthr(&self) -> DMARXCUTTHRUTHR_R {
49        DMARXCUTTHRUTHR_R::new((self.bits & 0x03ff) as u16)
50    }
51    #[doc = "Bit 31 - Enable RX partial store and forward operation"]
52    #[inline(always)]
53    pub fn dmarxcutthru(&self) -> DMARXCUTTHRU_R {
54        DMARXCUTTHRU_R::new(((self.bits >> 31) & 0x01) != 0)
55    }
56}
57impl W {
58    #[doc = "Bits 0:9 - Watermark value"]
59    #[inline(always)]
60    pub fn dmarxcutthruthr(&mut self) -> DMARXCUTTHRUTHR_W { DMARXCUTTHRUTHR_W { w: self } }
61    #[doc = "Bit 31 - Enable RX partial store and forward operation"]
62    #[inline(always)]
63    pub fn dmarxcutthru(&mut self) -> DMARXCUTTHRU_W { DMARXCUTTHRU_W { w: self } }
64}