moondancer_pac/generated/leds/
input.rs1#[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;
17impl R {
18 #[doc = "Bit 0 - pin_0 field"]
19 #[inline(always)]
20 pub fn pin_0(&self) -> PIN_0_R {
21 PIN_0_R::new((self.bits & 1) != 0)
22 }
23 #[doc = "Bit 1 - pin_1 field"]
24 #[inline(always)]
25 pub fn pin_1(&self) -> PIN_1_R {
26 PIN_1_R::new(((self.bits >> 1) & 1) != 0)
27 }
28 #[doc = "Bit 2 - pin_2 field"]
29 #[inline(always)]
30 pub fn pin_2(&self) -> PIN_2_R {
31 PIN_2_R::new(((self.bits >> 2) & 1) != 0)
32 }
33 #[doc = "Bit 3 - pin_3 field"]
34 #[inline(always)]
35 pub fn pin_3(&self) -> PIN_3_R {
36 PIN_3_R::new(((self.bits >> 3) & 1) != 0)
37 }
38 #[doc = "Bit 4 - pin_4 field"]
39 #[inline(always)]
40 pub fn pin_4(&self) -> PIN_4_R {
41 PIN_4_R::new(((self.bits >> 4) & 1) != 0)
42 }
43 #[doc = "Bit 5 - pin_5 field"]
44 #[inline(always)]
45 pub fn pin_5(&self) -> PIN_5_R {
46 PIN_5_R::new(((self.bits >> 5) & 1) != 0)
47 }
48}
49impl W {}
50#[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\" }, \\]
51Parameters ---------- 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)."]
52pub struct INPUT_SPEC;
53impl crate::RegisterSpec for INPUT_SPEC {
54 type Ux = u8;
55}
56#[doc = "`read()` method returns [`input::R`](R) reader structure"]
57impl crate::Readable for INPUT_SPEC {}
58#[doc = "`write(|w| ..)` method takes [`input::W`](W) writer structure"]
59impl crate::Writable for INPUT_SPEC {
60 type Safety = crate::Unsafe;
61 const ZERO_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
62 const ONE_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
63}
64#[doc = "`reset()` method sets Input to value 0"]
65impl crate::Resettable for INPUT_SPEC {
66 const RESET_VALUE: u8 = 0;
67}