Skip to main content

max3263x/adc/
data.rs

1#[doc = "Register `DATA` reader"]
2pub struct R(crate::R<DATA_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<DATA_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<DATA_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<DATA_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `DATA` writer"]
17pub struct W(crate::W<DATA_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<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<DATA_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<DATA_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `adc_data` reader - ADC Converted Sample Data Output"]
38pub type ADC_DATA_R = crate::FieldReader<u16, u16>;
39impl R {
40    #[doc = "Bits 0:15 - ADC Converted Sample Data Output"]
41    #[inline(always)]
42    pub fn adc_data(&self) -> ADC_DATA_R {
43        ADC_DATA_R::new((self.bits & 0xffff) as u16)
44    }
45}
46impl W {
47    #[doc = "Writes raw bits to the register."]
48    #[inline(always)]
49    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
50        self.0.bits(bits);
51        self
52    }
53}
54#[doc = "ADC Output Data\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 [data](index.html) module"]
55pub struct DATA_SPEC;
56impl crate::RegisterSpec for DATA_SPEC {
57    type Ux = u32;
58}
59#[doc = "`read()` method returns [data::R](R) reader structure"]
60impl crate::Readable for DATA_SPEC {
61    type Reader = R;
62}
63#[doc = "`write(|w| ..)` method takes [data::W](W) writer structure"]
64impl crate::Writable for DATA_SPEC {
65    type Writer = W;
66}
67#[doc = "`reset()` method sets DATA to value 0"]
68impl crate::Resettable for DATA_SPEC {
69    #[inline(always)]
70    fn reset_value() -> Self::Ux {
71        0
72    }
73}