moondancer_pac/generated/gpio0/
output.rs

1#[doc = "Register `Output` reader"]
2pub type R = crate::R<OUTPUT_SPEC>;
3#[doc = "Register `Output` writer"]
4pub type W = crate::W<OUTPUT_SPEC>;
5#[doc = "Field `pin_0` reader - pin_0 field"]
6pub type PIN_0_R = crate::BitReader;
7#[doc = "Field `pin_0` writer - pin_0 field"]
8pub type PIN_0_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `pin_1` reader - pin_1 field"]
10pub type PIN_1_R = crate::BitReader;
11#[doc = "Field `pin_1` writer - pin_1 field"]
12pub type PIN_1_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `pin_2` reader - pin_2 field"]
14pub type PIN_2_R = crate::BitReader;
15#[doc = "Field `pin_2` writer - pin_2 field"]
16pub type PIN_2_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `pin_3` reader - pin_3 field"]
18pub type PIN_3_R = crate::BitReader;
19#[doc = "Field `pin_3` writer - pin_3 field"]
20pub type PIN_3_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `pin_4` reader - pin_4 field"]
22pub type PIN_4_R = crate::BitReader;
23#[doc = "Field `pin_4` writer - pin_4 field"]
24pub type PIN_4_W<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `pin_5` reader - pin_5 field"]
26pub type PIN_5_R = crate::BitReader;
27#[doc = "Field `pin_5` writer - pin_5 field"]
28pub type PIN_5_W<'a, REG> = crate::BitWriter<'a, REG>;
29#[doc = "Field `pin_6` reader - pin_6 field"]
30pub type PIN_6_R = crate::BitReader;
31#[doc = "Field `pin_6` writer - pin_6 field"]
32pub type PIN_6_W<'a, REG> = crate::BitWriter<'a, REG>;
33#[doc = "Field `pin_7` reader - pin_7 field"]
34pub type PIN_7_R = crate::BitReader;
35#[doc = "Field `pin_7` writer - pin_7 field"]
36pub type PIN_7_W<'a, REG> = crate::BitWriter<'a, REG>;
37impl R {
38    #[doc = "Bit 0 - pin_0 field"]
39    #[inline(always)]
40    pub fn pin_0(&self) -> PIN_0_R {
41        PIN_0_R::new((self.bits & 1) != 0)
42    }
43    #[doc = "Bit 1 - pin_1 field"]
44    #[inline(always)]
45    pub fn pin_1(&self) -> PIN_1_R {
46        PIN_1_R::new(((self.bits >> 1) & 1) != 0)
47    }
48    #[doc = "Bit 2 - pin_2 field"]
49    #[inline(always)]
50    pub fn pin_2(&self) -> PIN_2_R {
51        PIN_2_R::new(((self.bits >> 2) & 1) != 0)
52    }
53    #[doc = "Bit 3 - pin_3 field"]
54    #[inline(always)]
55    pub fn pin_3(&self) -> PIN_3_R {
56        PIN_3_R::new(((self.bits >> 3) & 1) != 0)
57    }
58    #[doc = "Bit 4 - pin_4 field"]
59    #[inline(always)]
60    pub fn pin_4(&self) -> PIN_4_R {
61        PIN_4_R::new(((self.bits >> 4) & 1) != 0)
62    }
63    #[doc = "Bit 5 - pin_5 field"]
64    #[inline(always)]
65    pub fn pin_5(&self) -> PIN_5_R {
66        PIN_5_R::new(((self.bits >> 5) & 1) != 0)
67    }
68    #[doc = "Bit 6 - pin_6 field"]
69    #[inline(always)]
70    pub fn pin_6(&self) -> PIN_6_R {
71        PIN_6_R::new(((self.bits >> 6) & 1) != 0)
72    }
73    #[doc = "Bit 7 - pin_7 field"]
74    #[inline(always)]
75    pub fn pin_7(&self) -> PIN_7_R {
76        PIN_7_R::new(((self.bits >> 7) & 1) != 0)
77    }
78}
79impl W {
80    #[doc = "Bit 0 - pin_0 field"]
81    #[inline(always)]
82    pub fn pin_0(&mut self) -> PIN_0_W<OUTPUT_SPEC> {
83        PIN_0_W::new(self, 0)
84    }
85    #[doc = "Bit 1 - pin_1 field"]
86    #[inline(always)]
87    pub fn pin_1(&mut self) -> PIN_1_W<OUTPUT_SPEC> {
88        PIN_1_W::new(self, 1)
89    }
90    #[doc = "Bit 2 - pin_2 field"]
91    #[inline(always)]
92    pub fn pin_2(&mut self) -> PIN_2_W<OUTPUT_SPEC> {
93        PIN_2_W::new(self, 2)
94    }
95    #[doc = "Bit 3 - pin_3 field"]
96    #[inline(always)]
97    pub fn pin_3(&mut self) -> PIN_3_W<OUTPUT_SPEC> {
98        PIN_3_W::new(self, 3)
99    }
100    #[doc = "Bit 4 - pin_4 field"]
101    #[inline(always)]
102    pub fn pin_4(&mut self) -> PIN_4_W<OUTPUT_SPEC> {
103        PIN_4_W::new(self, 4)
104    }
105    #[doc = "Bit 5 - pin_5 field"]
106    #[inline(always)]
107    pub fn pin_5(&mut self) -> PIN_5_W<OUTPUT_SPEC> {
108        PIN_5_W::new(self, 5)
109    }
110    #[doc = "Bit 6 - pin_6 field"]
111    #[inline(always)]
112    pub fn pin_6(&mut self) -> PIN_6_W<OUTPUT_SPEC> {
113        PIN_6_W::new(self, 6)
114    }
115    #[doc = "Bit 7 - pin_7 field"]
116    #[inline(always)]
117    pub fn pin_7(&mut self) -> PIN_7_W<OUTPUT_SPEC> {
118        PIN_7_W::new(self, 7)
119    }
120}
121#[doc = "Output register. This :class:`csr.Register` contains an array of ``pin_count`` read/write fields. Each field is 1-bit wide and drives the output of its associated pin in the :attr:`Peripheral.pins` array, depending on its associated :class:`~Peripheral.Mode` field. If ``pin_count`` is 8, then the register has the following fields: .. bitfield:: :bits: 8 \\[ { \"name\": \"pin\\[0\\]\", \"bits\": 1, \"attr\": \"RW\" }, { \"name\": \"pin\\[1\\]\", \"bits\": 1, \"attr\": \"RW\" }, { \"name\": \"pin\\[2\\]\", \"bits\": 1, \"attr\": \"RW\" }, { \"name\": \"pin\\[3\\]\", \"bits\": 1, \"attr\": \"RW\" }, { \"name\": \"pin\\[4\\]\", \"bits\": 1, \"attr\": \"RW\" }, { \"name\": \"pin\\[5\\]\", \"bits\": 1, \"attr\": \"RW\" }, { \"name\": \"pin\\[6\\]\", \"bits\": 1, \"attr\": \"RW\" }, { \"name\": \"pin\\[7\\]\", \"bits\": 1, \"attr\": \"RW\" }, \\]
122Parameters ---------- pin_count : :class:`int` Number of GPIO pins.\n\nYou can [`read`](crate::Reg::read) this register and get [`output::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`output::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
123pub struct OUTPUT_SPEC;
124impl crate::RegisterSpec for OUTPUT_SPEC {
125    type Ux = u8;
126}
127#[doc = "`read()` method returns [`output::R`](R) reader structure"]
128impl crate::Readable for OUTPUT_SPEC {}
129#[doc = "`write(|w| ..)` method takes [`output::W`](W) writer structure"]
130impl crate::Writable for OUTPUT_SPEC {
131    type Safety = crate::Unsafe;
132    const ZERO_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
133    const ONE_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
134}
135#[doc = "`reset()` method sets Output to value 0"]
136impl crate::Resettable for OUTPUT_SPEC {
137    const RESET_VALUE: u8 = 0;
138}