moondancer_pac/generated/user0/
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;
7impl R {
8 #[doc = "Bit 0 - pin_0 field"]
9 #[inline(always)]
10 pub fn pin_0(&self) -> PIN_0_R {
11 PIN_0_R::new((self.bits & 1) != 0)
12 }
13}
14impl W {}
15#[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\" }, \\]
16Parameters ---------- 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)."]
17pub struct INPUT_SPEC;
18impl crate::RegisterSpec for INPUT_SPEC {
19 type Ux = u8;
20}
21#[doc = "`read()` method returns [`input::R`](R) reader structure"]
22impl crate::Readable for INPUT_SPEC {}
23#[doc = "`write(|w| ..)` method takes [`input::W`](W) writer structure"]
24impl crate::Writable for INPUT_SPEC {
25 type Safety = crate::Unsafe;
26 const ZERO_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
27 const ONE_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
28}
29#[doc = "`reset()` method sets Input to value 0"]
30impl crate::Resettable for INPUT_SPEC {
31 const RESET_VALUE: u8 = 0;
32}