xmc4800/ledts0/
tsval.rs

1#[doc = "Register `TSVAL` reader"]
2pub type R = crate::R<TSVAL_SPEC>;
3#[doc = "Register `TSVAL` writer"]
4pub type W = crate::W<TSVAL_SPEC>;
5#[doc = "Field `TSCTRVALR` reader - Shadow TS-Counter (Read)"]
6pub type TSCTRVALR_R = crate::FieldReader<u16>;
7#[doc = "Field `TSCTRVAL` reader - TS-Counter Value"]
8pub type TSCTRVAL_R = crate::FieldReader<u16>;
9#[doc = "Field `TSCTRVAL` writer - TS-Counter Value"]
10pub type TSCTRVAL_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
11impl R {
12    #[doc = "Bits 0:15 - Shadow TS-Counter (Read)"]
13    #[inline(always)]
14    pub fn tsctrvalr(&self) -> TSCTRVALR_R {
15        TSCTRVALR_R::new((self.bits & 0xffff) as u16)
16    }
17    #[doc = "Bits 16:31 - TS-Counter Value"]
18    #[inline(always)]
19    pub fn tsctrval(&self) -> TSCTRVAL_R {
20        TSCTRVAL_R::new(((self.bits >> 16) & 0xffff) as u16)
21    }
22}
23impl W {
24    #[doc = "Bits 16:31 - TS-Counter Value"]
25    #[inline(always)]
26    pub fn tsctrval(&mut self) -> TSCTRVAL_W<TSVAL_SPEC> {
27        TSCTRVAL_W::new(self, 16)
28    }
29}
30#[doc = "Touch-sense TS-Counter Value\n\nYou can [`read`](crate::Reg::read) this register and get [`tsval::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`tsval::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
31pub struct TSVAL_SPEC;
32impl crate::RegisterSpec for TSVAL_SPEC {
33    type Ux = u32;
34}
35#[doc = "`read()` method returns [`tsval::R`](R) reader structure"]
36impl crate::Readable for TSVAL_SPEC {}
37#[doc = "`write(|w| ..)` method takes [`tsval::W`](W) writer structure"]
38impl crate::Writable for TSVAL_SPEC {
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 TSVAL to value 0"]
44impl crate::Resettable for TSVAL_SPEC {
45    const RESET_VALUE: u32 = 0;
46}