cc2538_pac/gpio_c/
gpiocr.rs1#[doc = "Register `GPIOCR` reader"]
2pub type R = crate::R<GpiocrSpec>;
3#[doc = "Register `GPIOCR` writer"]
4pub type W = crate::W<GpiocrSpec>;
5#[doc = "Field `CR` reader - On a bit-wise basis, any bit set allows the corresponding GPIOAFSEL bit to be set to its alternate function."]
6pub type CrR = crate::FieldReader;
7#[doc = "Field `CR` writer - On a bit-wise basis, any bit set allows the corresponding GPIOAFSEL bit to be set to its alternate function."]
8pub type CrW<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9impl R {
10 #[doc = "Bits 0:7 - On a bit-wise basis, any bit set allows the corresponding GPIOAFSEL bit to be set to its alternate function."]
11 #[inline(always)]
12 pub fn cr(&self) -> CrR {
13 CrR::new((self.bits & 0xff) as u8)
14 }
15}
16impl W {
17 #[doc = "Bits 0:7 - On a bit-wise basis, any bit set allows the corresponding GPIOAFSEL bit to be set to its alternate function."]
18 #[inline(always)]
19 pub fn cr(&mut self) -> CrW<GpiocrSpec> {
20 CrW::new(self, 0)
21 }
22}
23#[doc = "The GPIOCR register is the commit register. The value of the GPIOCR register determines which bits of the AFSEL register is committed when a write to the AFSEL register is performed. If a bit in the GPIOCR register is 0, the data being written to the corresponding bit in the AFSEL register is not committed and retains its previous value. If a bit in the GPIOCR register is set to 1, the data being written to the corresponding bit of the AFSEL register is committed to the register and will reflect the new value. The contents of the GPIOCR register can only be modified if the GPIOLOCK register is unlocked. Writes to the GPIOCR register will be ignored if the GPIOLOCK register is locked. Any write to the commit register causes the lock register to be locked.\n\nYou can [`read`](crate::Reg::read) this register and get [`gpiocr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`gpiocr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
24pub struct GpiocrSpec;
25impl crate::RegisterSpec for GpiocrSpec {
26 type Ux = u32;
27}
28#[doc = "`read()` method returns [`gpiocr::R`](R) reader structure"]
29impl crate::Readable for GpiocrSpec {}
30#[doc = "`write(|w| ..)` method takes [`gpiocr::W`](W) writer structure"]
31impl crate::Writable for GpiocrSpec {
32 type Safety = crate::Unsafe;
33 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
34 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
35}
36#[doc = "`reset()` method sets GPIOCR to value 0"]
37impl crate::Resettable for GpiocrSpec {
38 const RESET_VALUE: u32 = 0;
39}