moondancer_pac/generated/gpio0/
input.rs

1#[doc = "Register `Input` reader"]
2pub type R = crate::R<INPUT_SPEC>;
3#[doc = "Register `Input` writer"]
4pub type W = crate::W<INPUT_SPEC>;
5#[doc = "Field `pin_0` reader - pin_0 field"]
6pub type PIN_0_R = crate::BitReader;
7#[doc = "Field `pin_1` reader - pin_1 field"]
8pub type PIN_1_R = crate::BitReader;
9#[doc = "Field `pin_2` reader - pin_2 field"]
10pub type PIN_2_R = crate::BitReader;
11#[doc = "Field `pin_3` reader - pin_3 field"]
12pub type PIN_3_R = crate::BitReader;
13#[doc = "Field `pin_4` reader - pin_4 field"]
14pub type PIN_4_R = crate::BitReader;
15#[doc = "Field `pin_5` reader - pin_5 field"]
16pub type PIN_5_R = crate::BitReader;
17#[doc = "Field `pin_6` reader - pin_6 field"]
18pub type PIN_6_R = crate::BitReader;
19#[doc = "Field `pin_7` reader - pin_7 field"]
20pub type PIN_7_R = crate::BitReader;
21impl R {
22    #[doc = "Bit 0 - pin_0 field"]
23    #[inline(always)]
24    pub fn pin_0(&self) -> PIN_0_R {
25        PIN_0_R::new((self.bits & 1) != 0)
26    }
27    #[doc = "Bit 1 - pin_1 field"]
28    #[inline(always)]
29    pub fn pin_1(&self) -> PIN_1_R {
30        PIN_1_R::new(((self.bits >> 1) & 1) != 0)
31    }
32    #[doc = "Bit 2 - pin_2 field"]
33    #[inline(always)]
34    pub fn pin_2(&self) -> PIN_2_R {
35        PIN_2_R::new(((self.bits >> 2) & 1) != 0)
36    }
37    #[doc = "Bit 3 - pin_3 field"]
38    #[inline(always)]
39    pub fn pin_3(&self) -> PIN_3_R {
40        PIN_3_R::new(((self.bits >> 3) & 1) != 0)
41    }
42    #[doc = "Bit 4 - pin_4 field"]
43    #[inline(always)]
44    pub fn pin_4(&self) -> PIN_4_R {
45        PIN_4_R::new(((self.bits >> 4) & 1) != 0)
46    }
47    #[doc = "Bit 5 - pin_5 field"]
48    #[inline(always)]
49    pub fn pin_5(&self) -> PIN_5_R {
50        PIN_5_R::new(((self.bits >> 5) & 1) != 0)
51    }
52    #[doc = "Bit 6 - pin_6 field"]
53    #[inline(always)]
54    pub fn pin_6(&self) -> PIN_6_R {
55        PIN_6_R::new(((self.bits >> 6) & 1) != 0)
56    }
57    #[doc = "Bit 7 - pin_7 field"]
58    #[inline(always)]
59    pub fn pin_7(&self) -> PIN_7_R {
60        PIN_7_R::new(((self.bits >> 7) & 1) != 0)
61    }
62}
63impl W {}
64#[doc = "Input register. This :class:`csr.Register` contains an array of ``pin_count`` read-only fields. Each field is 1-bit wide and driven by the input of its associated pin in the :attr:`Peripheral.pins` array. Values sampled from pin inputs go through :attr:`Peripheral.input_stages` synchronization stages (on a rising edge of ``ClockSignal(\"sync\")``) before reaching the register. If ``pin_count`` is 8, then the register has the following fields: .. bitfield:: :bits: 8 \\[ { \"name\": \"pin\\[0\\]\", \"bits\": 1, \"attr\": \"R\" }, { \"name\": \"pin\\[1\\]\", \"bits\": 1, \"attr\": \"R\" }, { \"name\": \"pin\\[2\\]\", \"bits\": 1, \"attr\": \"R\" }, { \"name\": \"pin\\[3\\]\", \"bits\": 1, \"attr\": \"R\" }, { \"name\": \"pin\\[4\\]\", \"bits\": 1, \"attr\": \"R\" }, { \"name\": \"pin\\[5\\]\", \"bits\": 1, \"attr\": \"R\" }, { \"name\": \"pin\\[6\\]\", \"bits\": 1, \"attr\": \"R\" }, { \"name\": \"pin\\[7\\]\", \"bits\": 1, \"attr\": \"R\" }, \\]
65Parameters ---------- pin_count : :class:`int` Number of GPIO pins.\n\nYou can [`read`](crate::Reg::read) this register and get [`input::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`input::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
66pub struct INPUT_SPEC;
67impl crate::RegisterSpec for INPUT_SPEC {
68    type Ux = u8;
69}
70#[doc = "`read()` method returns [`input::R`](R) reader structure"]
71impl crate::Readable for INPUT_SPEC {}
72#[doc = "`write(|w| ..)` method takes [`input::W`](W) writer structure"]
73impl crate::Writable for INPUT_SPEC {
74    type Safety = crate::Unsafe;
75    const ZERO_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
76    const ONE_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
77}
78#[doc = "`reset()` method sets Input to value 0"]
79impl crate::Resettable for INPUT_SPEC {
80    const RESET_VALUE: u8 = 0;
81}