atsamd51g/qspi/
instrctrl.rs

1#[doc = "Register `INSTRCTRL` reader"]
2pub type R = crate::R<InstrctrlSpec>;
3#[doc = "Register `INSTRCTRL` writer"]
4pub type W = crate::W<InstrctrlSpec>;
5#[doc = "Field `INSTR` reader - Instruction Code"]
6pub type InstrR = crate::FieldReader;
7#[doc = "Field `INSTR` writer - Instruction Code"]
8pub type InstrW<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9#[doc = "Field `OPTCODE` reader - Option Code"]
10pub type OptcodeR = crate::FieldReader;
11#[doc = "Field `OPTCODE` writer - Option Code"]
12pub type OptcodeW<'a, REG> = crate::FieldWriter<'a, REG, 8>;
13impl R {
14    #[doc = "Bits 0:7 - Instruction Code"]
15    #[inline(always)]
16    pub fn instr(&self) -> InstrR {
17        InstrR::new((self.bits & 0xff) as u8)
18    }
19    #[doc = "Bits 16:23 - Option Code"]
20    #[inline(always)]
21    pub fn optcode(&self) -> OptcodeR {
22        OptcodeR::new(((self.bits >> 16) & 0xff) as u8)
23    }
24}
25impl W {
26    #[doc = "Bits 0:7 - Instruction Code"]
27    #[inline(always)]
28    #[must_use]
29    pub fn instr(&mut self) -> InstrW<InstrctrlSpec> {
30        InstrW::new(self, 0)
31    }
32    #[doc = "Bits 16:23 - Option Code"]
33    #[inline(always)]
34    #[must_use]
35    pub fn optcode(&mut self) -> OptcodeW<InstrctrlSpec> {
36        OptcodeW::new(self, 16)
37    }
38}
39#[doc = "Instruction Code\n\nYou can [`read`](crate::Reg::read) this register and get [`instrctrl::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`instrctrl::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
40pub struct InstrctrlSpec;
41impl crate::RegisterSpec for InstrctrlSpec {
42    type Ux = u32;
43}
44#[doc = "`read()` method returns [`instrctrl::R`](R) reader structure"]
45impl crate::Readable for InstrctrlSpec {}
46#[doc = "`write(|w| ..)` method takes [`instrctrl::W`](W) writer structure"]
47impl crate::Writable for InstrctrlSpec {
48    type Safety = crate::Unsafe;
49    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
50    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
51}
52#[doc = "`reset()` method sets INSTRCTRL to value 0"]
53impl crate::Resettable for InstrctrlSpec {
54    const RESET_VALUE: u32 = 0;
55}