efm32tg11b_pac/efm32tg11b540/lesense/
buf1_data.rs1#[doc = "Register `BUF1_DATA` reader"]
2pub struct R(crate::R<BUF1_DATA_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<BUF1_DATA_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<BUF1_DATA_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<BUF1_DATA_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `BUF1_DATA` writer"]
17pub struct W(crate::W<BUF1_DATA_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<BUF1_DATA_SPEC>;
20 #[inline(always)]
21 fn deref(&self) -> &Self::Target {
22 &self.0
23 }
24}
25impl core::ops::DerefMut for W {
26 #[inline(always)]
27 fn deref_mut(&mut self) -> &mut Self::Target {
28 &mut self.0
29 }
30}
31impl From<crate::W<BUF1_DATA_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<BUF1_DATA_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `DATA` reader - Scan Result Buffer"]
38pub type DATA_R = crate::FieldReader<u16, u16>;
39#[doc = "Field `DATA` writer - Scan Result Buffer"]
40pub type DATA_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BUF1_DATA_SPEC, u16, u16, 16, O>;
41#[doc = "Field `DATASRC` reader - Result Data Source"]
42pub type DATASRC_R = crate::FieldReader<u8, u8>;
43impl R {
44 #[doc = "Bits 0:15 - Scan Result Buffer"]
45 #[inline(always)]
46 pub fn data(&self) -> DATA_R {
47 DATA_R::new((self.bits & 0xffff) as u16)
48 }
49 #[doc = "Bits 16:19 - Result Data Source"]
50 #[inline(always)]
51 pub fn datasrc(&self) -> DATASRC_R {
52 DATASRC_R::new(((self.bits >> 16) & 0x0f) as u8)
53 }
54}
55impl W {
56 #[doc = "Bits 0:15 - Scan Result Buffer"]
57 #[inline(always)]
58 #[must_use]
59 pub fn data(&mut self) -> DATA_W<0> {
60 DATA_W::new(self)
61 }
62 #[doc = "Writes raw bits to the register."]
63 #[inline(always)]
64 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
65 self.0.bits(bits);
66 self
67 }
68}
69#[doc = "Scan Results\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [buf1_data](index.html) module"]
70pub struct BUF1_DATA_SPEC;
71impl crate::RegisterSpec for BUF1_DATA_SPEC {
72 type Ux = u32;
73}
74#[doc = "`read()` method returns [buf1_data::R](R) reader structure"]
75impl crate::Readable for BUF1_DATA_SPEC {
76 type Reader = R;
77}
78#[doc = "`write(|w| ..)` method takes [buf1_data::W](W) writer structure"]
79impl crate::Writable for BUF1_DATA_SPEC {
80 type Writer = W;
81 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
82 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
83}
84#[doc = "`reset()` method sets BUF1_DATA to value 0"]
85impl crate::Resettable for BUF1_DATA_SPEC {
86 const RESET_VALUE: Self::Ux = 0;
87}