atsamd21g/adc/
swtrig.rs
1#[doc = "Register `SWTRIG` reader"]
2pub type R = crate::R<SwtrigSpec>;
3#[doc = "Register `SWTRIG` writer"]
4pub type W = crate::W<SwtrigSpec>;
5#[doc = "Field `FLUSH` reader - ADC Conversion Flush"]
6pub type FlushR = crate::BitReader;
7#[doc = "Field `FLUSH` writer - ADC Conversion Flush"]
8pub type FlushW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `START` reader - ADC Start Conversion"]
10pub type StartR = crate::BitReader;
11#[doc = "Field `START` writer - ADC Start Conversion"]
12pub type StartW<'a, REG> = crate::BitWriter<'a, REG>;
13impl R {
14 #[doc = "Bit 0 - ADC Conversion Flush"]
15 #[inline(always)]
16 pub fn flush(&self) -> FlushR {
17 FlushR::new((self.bits & 1) != 0)
18 }
19 #[doc = "Bit 1 - ADC Start Conversion"]
20 #[inline(always)]
21 pub fn start(&self) -> StartR {
22 StartR::new(((self.bits >> 1) & 1) != 0)
23 }
24}
25impl W {
26 #[doc = "Bit 0 - ADC Conversion Flush"]
27 #[inline(always)]
28 #[must_use]
29 pub fn flush(&mut self) -> FlushW<SwtrigSpec> {
30 FlushW::new(self, 0)
31 }
32 #[doc = "Bit 1 - ADC Start Conversion"]
33 #[inline(always)]
34 #[must_use]
35 pub fn start(&mut self) -> StartW<SwtrigSpec> {
36 StartW::new(self, 1)
37 }
38}
39#[doc = "Software Trigger\n\nYou can [`read`](crate::Reg::read) this register and get [`swtrig::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`swtrig::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
40pub struct SwtrigSpec;
41impl crate::RegisterSpec for SwtrigSpec {
42 type Ux = u8;
43}
44#[doc = "`read()` method returns [`swtrig::R`](R) reader structure"]
45impl crate::Readable for SwtrigSpec {}
46#[doc = "`write(|w| ..)` method takes [`swtrig::W`](W) writer structure"]
47impl crate::Writable for SwtrigSpec {
48 type Safety = crate::Unsafe;
49 const ZERO_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
50 const ONE_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
51}
52#[doc = "`reset()` method sets SWTRIG to value 0"]
53impl crate::Resettable for SwtrigSpec {
54 const RESET_VALUE: u8 = 0;
55}