atsam4e8c_pac/udp/
frm_num.rs

1#[doc = "Register `FRM_NUM` reader"]
2pub struct R(crate::R<FRM_NUM_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<FRM_NUM_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<FRM_NUM_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<FRM_NUM_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `FRM_NUM` reader - Frame Number as Defined in the Packet Field Formats"]
17pub type FRM_NUM_R = crate::FieldReader<u16, u16>;
18#[doc = "Field `FRM_ERR` reader - Frame Error"]
19pub type FRM_ERR_R = crate::BitReader<bool>;
20#[doc = "Field `FRM_OK` reader - Frame OK"]
21pub type FRM_OK_R = crate::BitReader<bool>;
22impl R {
23    #[doc = "Bits 0:10 - Frame Number as Defined in the Packet Field Formats"]
24    #[inline(always)]
25    pub fn frm_num(&self) -> FRM_NUM_R {
26        FRM_NUM_R::new((self.bits & 0x07ff) as u16)
27    }
28    #[doc = "Bit 16 - Frame Error"]
29    #[inline(always)]
30    pub fn frm_err(&self) -> FRM_ERR_R {
31        FRM_ERR_R::new(((self.bits >> 16) & 1) != 0)
32    }
33    #[doc = "Bit 17 - Frame OK"]
34    #[inline(always)]
35    pub fn frm_ok(&self) -> FRM_OK_R {
36        FRM_OK_R::new(((self.bits >> 17) & 1) != 0)
37    }
38}
39#[doc = "Frame Number Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [frm_num](index.html) module"]
40pub struct FRM_NUM_SPEC;
41impl crate::RegisterSpec for FRM_NUM_SPEC {
42    type Ux = u32;
43}
44#[doc = "`read()` method returns [frm_num::R](R) reader structure"]
45impl crate::Readable for FRM_NUM_SPEC {
46    type Reader = R;
47}
48#[doc = "`reset()` method sets FRM_NUM to value 0"]
49impl crate::Resettable for FRM_NUM_SPEC {
50    const RESET_VALUE: Self::Ux = 0;
51}