atsamd51g/sercom0/usart_int/
length.rs

1#[doc = "Register `LENGTH` reader"]
2pub type R = crate::R<LengthSpec>;
3#[doc = "Register `LENGTH` writer"]
4pub type W = crate::W<LengthSpec>;
5#[doc = "Field `LEN` reader - Data Length"]
6pub type LenR = crate::FieldReader;
7#[doc = "Field `LEN` writer - Data Length"]
8pub type LenW<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9#[doc = "Field `LENEN` reader - Data Length Enable"]
10pub type LenenR = crate::FieldReader;
11#[doc = "Field `LENEN` writer - Data Length Enable"]
12pub type LenenW<'a, REG> = crate::FieldWriter<'a, REG, 2>;
13impl R {
14    #[doc = "Bits 0:7 - Data Length"]
15    #[inline(always)]
16    pub fn len(&self) -> LenR {
17        LenR::new((self.bits & 0xff) as u8)
18    }
19    #[doc = "Bits 8:9 - Data Length Enable"]
20    #[inline(always)]
21    pub fn lenen(&self) -> LenenR {
22        LenenR::new(((self.bits >> 8) & 3) as u8)
23    }
24}
25impl W {
26    #[doc = "Bits 0:7 - Data Length"]
27    #[inline(always)]
28    #[must_use]
29    pub fn len(&mut self) -> LenW<LengthSpec> {
30        LenW::new(self, 0)
31    }
32    #[doc = "Bits 8:9 - Data Length Enable"]
33    #[inline(always)]
34    #[must_use]
35    pub fn lenen(&mut self) -> LenenW<LengthSpec> {
36        LenenW::new(self, 8)
37    }
38}
39#[doc = "USART_INT Length\n\nYou can [`read`](crate::Reg::read) this register and get [`length::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`length::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
40pub struct LengthSpec;
41impl crate::RegisterSpec for LengthSpec {
42    type Ux = u16;
43}
44#[doc = "`read()` method returns [`length::R`](R) reader structure"]
45impl crate::Readable for LengthSpec {}
46#[doc = "`write(|w| ..)` method takes [`length::W`](W) writer structure"]
47impl crate::Writable for LengthSpec {
48    type Safety = crate::Unsafe;
49    const ZERO_TO_MODIFY_FIELDS_BITMAP: u16 = 0;
50    const ONE_TO_MODIFY_FIELDS_BITMAP: u16 = 0;
51}
52#[doc = "`reset()` method sets LENGTH to value 0"]
53impl crate::Resettable for LengthSpec {
54    const RESET_VALUE: u16 = 0;
55}