cc2538_pac/gpio_b/
usb_ctrl.rs

1#[doc = "Register `USB_CTRL` reader"]
2pub type R = crate::R<UsbCtrlSpec>;
3#[doc = "Register `USB_CTRL` writer"]
4pub type W = crate::W<UsbCtrlSpec>;
5#[doc = "Field `USB_EDGE_CTL` reader - Used to set the edge which triggers the USB power up interrupt 0: Rising 1: Falling"]
6pub type UsbEdgeCtlR = crate::BitReader;
7#[doc = "Field `USB_EDGE_CTL` writer - Used to set the edge which triggers the USB power up interrupt 0: Rising 1: Falling"]
8pub type UsbEdgeCtlW<'a, REG> = crate::BitWriter<'a, REG>;
9impl R {
10    #[doc = "Bit 0 - Used to set the edge which triggers the USB power up interrupt 0: Rising 1: Falling"]
11    #[inline(always)]
12    pub fn usb_edge_ctl(&self) -> UsbEdgeCtlR {
13        UsbEdgeCtlR::new((self.bits & 1) != 0)
14    }
15}
16impl W {
17    #[doc = "Bit 0 - Used to set the edge which triggers the USB power up interrupt 0: Rising 1: Falling"]
18    #[inline(always)]
19    pub fn usb_edge_ctl(&mut self) -> UsbEdgeCtlW<UsbCtrlSpec> {
20        UsbEdgeCtlW::new(self, 0)
21    }
22}
23#[doc = "This register is used to control which edge of the USB controller input generates a power-up interrupt to the system.\n\nYou can [`read`](crate::Reg::read) this register and get [`usb_ctrl::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`usb_ctrl::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
24pub struct UsbCtrlSpec;
25impl crate::RegisterSpec for UsbCtrlSpec {
26    type Ux = u32;
27}
28#[doc = "`read()` method returns [`usb_ctrl::R`](R) reader structure"]
29impl crate::Readable for UsbCtrlSpec {}
30#[doc = "`write(|w| ..)` method takes [`usb_ctrl::W`](W) writer structure"]
31impl crate::Writable for UsbCtrlSpec {
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 USB_CTRL to value 0"]
37impl crate::Resettable for UsbCtrlSpec {
38    const RESET_VALUE: u32 = 0;
39}