cc2538_pac/uart1/
ninebitamask.rs1#[doc = "Register `NINEBITAMASK` reader"]
2pub type R = crate::R<NinebitamaskSpec>;
3#[doc = "Register `NINEBITAMASK` writer"]
4pub type W = crate::W<NinebitamaskSpec>;
5#[doc = "Field `MASK` reader - Self Address Mask for 9-Bit Mode This field contains the address mask that creates a range of addresses that should be matched."]
6pub type MaskR = crate::FieldReader;
7#[doc = "Field `MASK` writer - Self Address Mask for 9-Bit Mode This field contains the address mask that creates a range of addresses that should be matched."]
8pub type MaskW<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9#[doc = "Field `RANGE` reader - Self address range for 9-bit mode Writing to the RANGE field does not have any effect; reading it reflects the ANDed output of the ADDR field in the UART9BITADDR register and the MASK field."]
10pub type RangeR = crate::FieldReader;
11impl R {
12 #[doc = "Bits 0:7 - Self Address Mask for 9-Bit Mode This field contains the address mask that creates a range of addresses that should be matched."]
13 #[inline(always)]
14 pub fn mask(&self) -> MaskR {
15 MaskR::new((self.bits & 0xff) as u8)
16 }
17 #[doc = "Bits 8:15 - Self address range for 9-bit mode Writing to the RANGE field does not have any effect; reading it reflects the ANDed output of the ADDR field in the UART9BITADDR register and the MASK field."]
18 #[inline(always)]
19 pub fn range(&self) -> RangeR {
20 RangeR::new(((self.bits >> 8) & 0xff) as u8)
21 }
22}
23impl W {
24 #[doc = "Bits 0:7 - Self Address Mask for 9-Bit Mode This field contains the address mask that creates a range of addresses that should be matched."]
25 #[inline(always)]
26 pub fn mask(&mut self) -> MaskW<NinebitamaskSpec> {
27 MaskW::new(self, 0)
28 }
29}
30#[doc = "UART 9-bit self address mask The NINEBITAMASK register is used to enable the address mask for 9-bit mode. The lower address bits are masked to create a range of address to be matched with the received address byte.\n\nYou can [`read`](crate::Reg::read) this register and get [`ninebitamask::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ninebitamask::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
31pub struct NinebitamaskSpec;
32impl crate::RegisterSpec for NinebitamaskSpec {
33 type Ux = u32;
34}
35#[doc = "`read()` method returns [`ninebitamask::R`](R) reader structure"]
36impl crate::Readable for NinebitamaskSpec {}
37#[doc = "`write(|w| ..)` method takes [`ninebitamask::W`](W) writer structure"]
38impl crate::Writable for NinebitamaskSpec {
39 type Safety = crate::Unsafe;
40 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
41 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
42}
43#[doc = "`reset()` method sets NINEBITAMASK to value 0"]
44impl crate::Resettable for NinebitamaskSpec {
45 const RESET_VALUE: u32 = 0;
46}