moondancer_pac/generated/user0/
mode.rs1#[doc = "Register `Mode` reader"]
2pub type R = crate::R<MODE_SPEC>;
3#[doc = "Register `Mode` writer"]
4pub type W = crate::W<MODE_SPEC>;
5#[doc = "Field `pin_0` reader - pin_0 field"]
6pub type PIN_0_R = crate::FieldReader;
7#[doc = "Field `pin_0` writer - pin_0 field"]
8pub type PIN_0_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
9impl R {
10 #[doc = "Bits 0:1 - pin_0 field"]
11 #[inline(always)]
12 pub fn pin_0(&self) -> PIN_0_R {
13 PIN_0_R::new(self.bits & 3)
14 }
15}
16impl W {
17 #[doc = "Bits 0:1 - pin_0 field"]
18 #[inline(always)]
19 pub fn pin_0(&mut self) -> PIN_0_W<MODE_SPEC> {
20 PIN_0_W::new(self, 0)
21 }
22}
23#[doc = "Mode register. This :class:`csr.Register` contains an array of ``pin_count`` read/write fields. Each field is 2-bit wide and its possible values are defined by the :class:`PinMode` enumeration. If ``pin_count`` is 8, then the register has the following fields: .. bitfield:: :bits: 16 \\[ { \"name\": \"pin\\[0\\]\", \"bits\": 2, \"attr\": \"RW\" }, { \"name\": \"pin\\[1\\]\", \"bits\": 2, \"attr\": \"RW\" }, { \"name\": \"pin\\[2\\]\", \"bits\": 2, \"attr\": \"RW\" }, { \"name\": \"pin\\[3\\]\", \"bits\": 2, \"attr\": \"RW\" }, { \"name\": \"pin\\[4\\]\", \"bits\": 2, \"attr\": \"RW\" }, { \"name\": \"pin\\[5\\]\", \"bits\": 2, \"attr\": \"RW\" }, { \"name\": \"pin\\[6\\]\", \"bits\": 2, \"attr\": \"RW\" }, { \"name\": \"pin\\[7\\]\", \"bits\": 2, \"attr\": \"RW\" }, \\]
24Parameters ---------- pin_count : :class:`int` Number of GPIO pins.\n\nYou can [`read`](crate::Reg::read) this register and get [`mode::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mode::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
25pub struct MODE_SPEC;
26impl crate::RegisterSpec for MODE_SPEC {
27 type Ux = u8;
28}
29#[doc = "`read()` method returns [`mode::R`](R) reader structure"]
30impl crate::Readable for MODE_SPEC {}
31#[doc = "`write(|w| ..)` method takes [`mode::W`](W) writer structure"]
32impl crate::Writable for MODE_SPEC {
33 type Safety = crate::Unsafe;
34 const ZERO_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
35 const ONE_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
36}
37#[doc = "`reset()` method sets Mode to value 0"]
38impl crate::Resettable for MODE_SPEC {
39 const RESET_VALUE: u8 = 0;
40}