moondancer_pac/generated/leds/
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>;
29impl R {
30    #[doc = "Bit 0 - pin_0 field"]
31    #[inline(always)]
32    pub fn pin_0(&self) -> PIN_0_R {
33        PIN_0_R::new((self.bits & 1) != 0)
34    }
35    #[doc = "Bit 1 - pin_1 field"]
36    #[inline(always)]
37    pub fn pin_1(&self) -> PIN_1_R {
38        PIN_1_R::new(((self.bits >> 1) & 1) != 0)
39    }
40    #[doc = "Bit 2 - pin_2 field"]
41    #[inline(always)]
42    pub fn pin_2(&self) -> PIN_2_R {
43        PIN_2_R::new(((self.bits >> 2) & 1) != 0)
44    }
45    #[doc = "Bit 3 - pin_3 field"]
46    #[inline(always)]
47    pub fn pin_3(&self) -> PIN_3_R {
48        PIN_3_R::new(((self.bits >> 3) & 1) != 0)
49    }
50    #[doc = "Bit 4 - pin_4 field"]
51    #[inline(always)]
52    pub fn pin_4(&self) -> PIN_4_R {
53        PIN_4_R::new(((self.bits >> 4) & 1) != 0)
54    }
55    #[doc = "Bit 5 - pin_5 field"]
56    #[inline(always)]
57    pub fn pin_5(&self) -> PIN_5_R {
58        PIN_5_R::new(((self.bits >> 5) & 1) != 0)
59    }
60}
61impl W {
62    #[doc = "Bit 0 - pin_0 field"]
63    #[inline(always)]
64    pub fn pin_0(&mut self) -> PIN_0_W<OUTPUT_SPEC> {
65        PIN_0_W::new(self, 0)
66    }
67    #[doc = "Bit 1 - pin_1 field"]
68    #[inline(always)]
69    pub fn pin_1(&mut self) -> PIN_1_W<OUTPUT_SPEC> {
70        PIN_1_W::new(self, 1)
71    }
72    #[doc = "Bit 2 - pin_2 field"]
73    #[inline(always)]
74    pub fn pin_2(&mut self) -> PIN_2_W<OUTPUT_SPEC> {
75        PIN_2_W::new(self, 2)
76    }
77    #[doc = "Bit 3 - pin_3 field"]
78    #[inline(always)]
79    pub fn pin_3(&mut self) -> PIN_3_W<OUTPUT_SPEC> {
80        PIN_3_W::new(self, 3)
81    }
82    #[doc = "Bit 4 - pin_4 field"]
83    #[inline(always)]
84    pub fn pin_4(&mut self) -> PIN_4_W<OUTPUT_SPEC> {
85        PIN_4_W::new(self, 4)
86    }
87    #[doc = "Bit 5 - pin_5 field"]
88    #[inline(always)]
89    pub fn pin_5(&mut self) -> PIN_5_W<OUTPUT_SPEC> {
90        PIN_5_W::new(self, 5)
91    }
92}
93#[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\" }, \\]
94Parameters ---------- 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)."]
95pub struct OUTPUT_SPEC;
96impl crate::RegisterSpec for OUTPUT_SPEC {
97    type Ux = u8;
98}
99#[doc = "`read()` method returns [`output::R`](R) reader structure"]
100impl crate::Readable for OUTPUT_SPEC {}
101#[doc = "`write(|w| ..)` method takes [`output::W`](W) writer structure"]
102impl crate::Writable for OUTPUT_SPEC {
103    type Safety = crate::Unsafe;
104    const ZERO_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
105    const ONE_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
106}
107#[doc = "`reset()` method sets Output to value 0"]
108impl crate::Resettable for OUTPUT_SPEC {
109    const RESET_VALUE: u8 = 0;
110}