nrf52820_pac/usbd/
tasks_startepin.rs1#[doc = "Register `TASKS_STARTEPIN[%s]` writer"]
2pub struct W(crate::W<TASKS_STARTEPIN_SPEC>);
3impl core::ops::Deref for W {
4 type Target = crate::W<TASKS_STARTEPIN_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl core::ops::DerefMut for W {
11 #[inline(always)]
12 fn deref_mut(&mut self) -> &mut Self::Target {
13 &mut self.0
14 }
15}
16impl From<crate::W<TASKS_STARTEPIN_SPEC>> for W {
17 #[inline(always)]
18 fn from(writer: crate::W<TASKS_STARTEPIN_SPEC>) -> Self {
19 W(writer)
20 }
21}
22#[doc = "Captures the EPIN\\[n\\].PTR and EPIN\\[n\\].MAXCNT registers values, and enables endpoint IN n to respond to traffic from host\n\nValue on reset: 0"]
23#[derive(Clone, Copy, Debug, PartialEq)]
24pub enum TASKS_STARTEPIN_AW {
25 #[doc = "1: Trigger task"]
26 TRIGGER = 1,
27}
28impl From<TASKS_STARTEPIN_AW> for bool {
29 #[inline(always)]
30 fn from(variant: TASKS_STARTEPIN_AW) -> Self {
31 variant as u8 != 0
32 }
33}
34#[doc = "Field `TASKS_STARTEPIN` writer - Captures the EPIN\\[n\\].PTR and EPIN\\[n\\].MAXCNT registers values, and enables endpoint IN n to respond to traffic from host"]
35pub type TASKS_STARTEPIN_W<'a, const O: u8> =
36 crate::BitWriter<'a, u32, TASKS_STARTEPIN_SPEC, TASKS_STARTEPIN_AW, O>;
37impl<'a, const O: u8> TASKS_STARTEPIN_W<'a, O> {
38 #[doc = "Trigger task"]
39 #[inline(always)]
40 pub fn trigger(self) -> &'a mut W {
41 self.variant(TASKS_STARTEPIN_AW::TRIGGER)
42 }
43}
44impl W {
45 #[doc = "Bit 0 - Captures the EPIN\\[n\\].PTR and EPIN\\[n\\].MAXCNT registers values, and enables endpoint IN n to respond to traffic from host"]
46 #[inline(always)]
47 pub fn tasks_startepin(&mut self) -> TASKS_STARTEPIN_W<0> {
48 TASKS_STARTEPIN_W::new(self)
49 }
50 #[doc = "Writes raw bits to the register."]
51 #[inline(always)]
52 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
53 self.0.bits(bits);
54 self
55 }
56}
57#[doc = "Description collection: Captures the EPIN\\[n\\].PTR and EPIN\\[n\\].MAXCNT registers values, and enables endpoint IN n to respond to traffic from host\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_startepin](index.html) module"]
58pub struct TASKS_STARTEPIN_SPEC;
59impl crate::RegisterSpec for TASKS_STARTEPIN_SPEC {
60 type Ux = u32;
61}
62#[doc = "`write(|w| ..)` method takes [tasks_startepin::W](W) writer structure"]
63impl crate::Writable for TASKS_STARTEPIN_SPEC {
64 type Writer = W;
65}
66#[doc = "`reset()` method sets TASKS_STARTEPIN[%s]
67to value 0"]
68impl crate::Resettable for TASKS_STARTEPIN_SPEC {
69 #[inline(always)]
70 fn reset_value() -> Self::Ux {
71 0
72 }
73}