atsamd11c/port/
pincfg0_.rs

1#[doc = "Register `PINCFG0_%s` reader"]
2pub type R = crate::R<Pincfg0_Spec>;
3#[doc = "Register `PINCFG0_%s` writer"]
4pub type W = crate::W<Pincfg0_Spec>;
5#[doc = "Field `PMUXEN` reader - Peripheral Multiplexer Enable"]
6pub type PmuxenR = crate::BitReader;
7#[doc = "Field `PMUXEN` writer - Peripheral Multiplexer Enable"]
8pub type PmuxenW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `INEN` reader - Input Enable"]
10pub type InenR = crate::BitReader;
11#[doc = "Field `INEN` writer - Input Enable"]
12pub type InenW<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `PULLEN` reader - Pull Enable"]
14pub type PullenR = crate::BitReader;
15#[doc = "Field `PULLEN` writer - Pull Enable"]
16pub type PullenW<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `DRVSTR` reader - Output Driver Strength Selection"]
18pub type DrvstrR = crate::BitReader;
19#[doc = "Field `DRVSTR` writer - Output Driver Strength Selection"]
20pub type DrvstrW<'a, REG> = crate::BitWriter<'a, REG>;
21impl R {
22    #[doc = "Bit 0 - Peripheral Multiplexer Enable"]
23    #[inline(always)]
24    pub fn pmuxen(&self) -> PmuxenR {
25        PmuxenR::new((self.bits & 1) != 0)
26    }
27    #[doc = "Bit 1 - Input Enable"]
28    #[inline(always)]
29    pub fn inen(&self) -> InenR {
30        InenR::new(((self.bits >> 1) & 1) != 0)
31    }
32    #[doc = "Bit 2 - Pull Enable"]
33    #[inline(always)]
34    pub fn pullen(&self) -> PullenR {
35        PullenR::new(((self.bits >> 2) & 1) != 0)
36    }
37    #[doc = "Bit 6 - Output Driver Strength Selection"]
38    #[inline(always)]
39    pub fn drvstr(&self) -> DrvstrR {
40        DrvstrR::new(((self.bits >> 6) & 1) != 0)
41    }
42}
43impl W {
44    #[doc = "Bit 0 - Peripheral Multiplexer Enable"]
45    #[inline(always)]
46    #[must_use]
47    pub fn pmuxen(&mut self) -> PmuxenW<Pincfg0_Spec> {
48        PmuxenW::new(self, 0)
49    }
50    #[doc = "Bit 1 - Input Enable"]
51    #[inline(always)]
52    #[must_use]
53    pub fn inen(&mut self) -> InenW<Pincfg0_Spec> {
54        InenW::new(self, 1)
55    }
56    #[doc = "Bit 2 - Pull Enable"]
57    #[inline(always)]
58    #[must_use]
59    pub fn pullen(&mut self) -> PullenW<Pincfg0_Spec> {
60        PullenW::new(self, 2)
61    }
62    #[doc = "Bit 6 - Output Driver Strength Selection"]
63    #[inline(always)]
64    #[must_use]
65    pub fn drvstr(&mut self) -> DrvstrW<Pincfg0_Spec> {
66        DrvstrW::new(self, 6)
67    }
68}
69#[doc = "Pin Configuration n - Group 0\n\nYou can [`read`](crate::Reg::read) this register and get [`pincfg0_::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pincfg0_::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
70pub struct Pincfg0_Spec;
71impl crate::RegisterSpec for Pincfg0_Spec {
72    type Ux = u8;
73}
74#[doc = "`read()` method returns [`pincfg0_::R`](R) reader structure"]
75impl crate::Readable for Pincfg0_Spec {}
76#[doc = "`write(|w| ..)` method takes [`pincfg0_::W`](W) writer structure"]
77impl crate::Writable for Pincfg0_Spec {
78    type Safety = crate::Unsafe;
79    const ZERO_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
80    const ONE_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
81}
82#[doc = "`reset()` method sets PINCFG0_%s to value 0"]
83impl crate::Resettable for Pincfg0_Spec {
84    const RESET_VALUE: u8 = 0;
85}