msp432e4/usb0/
txfuncaddr1.rs1#[doc = r"Value read from the register"]
2pub struct R {
3 bits: u8,
4}
5#[doc = r"Value to write to the register"]
6pub struct W {
7 bits: u8,
8}
9impl super::TXFUNCADDR1 {
10 #[doc = r"Modifies the contents of the register"]
11 #[inline(always)]
12 pub fn modify<F>(&self, f: F)
13 where
14 for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W,
15 {
16 let bits = self.register.get();
17 self.register.set(f(&R { bits }, &mut W { bits }).bits);
18 }
19 #[doc = r"Reads the contents of the register"]
20 #[inline(always)]
21 pub fn read(&self) -> R {
22 R {
23 bits: self.register.get(),
24 }
25 }
26 #[doc = r"Writes to the register"]
27 #[inline(always)]
28 pub fn write<F>(&self, f: F)
29 where
30 F: FnOnce(&mut W) -> &mut W,
31 {
32 self.register.set(
33 f(&mut W {
34 bits: Self::reset_value(),
35 })
36 .bits,
37 );
38 }
39 #[doc = r"Reset value of the register"]
40 #[inline(always)]
41 pub const fn reset_value() -> u8 {
42 0
43 }
44 #[doc = r"Writes the reset value to the register"]
45 #[inline(always)]
46 pub fn reset(&self) {
47 self.register.set(Self::reset_value())
48 }
49}
50#[doc = r"Value of the field"]
51pub struct USB_TXFUNCADDR1_ADDRR {
52 bits: u8,
53}
54impl USB_TXFUNCADDR1_ADDRR {
55 #[doc = r"Value of the field as raw bits"]
56 #[inline(always)]
57 pub fn bits(&self) -> u8 {
58 self.bits
59 }
60}
61#[doc = r"Proxy"]
62pub struct _USB_TXFUNCADDR1_ADDRW<'a> {
63 w: &'a mut W,
64}
65impl<'a> _USB_TXFUNCADDR1_ADDRW<'a> {
66 #[doc = r"Writes raw bits to the field"]
67 #[inline(always)]
68 pub unsafe fn bits(self, value: u8) -> &'a mut W {
69 self.w.bits &= !(127 << 0);
70 self.w.bits |= ((value as u8) & 127) << 0;
71 self.w
72 }
73}
74impl R {
75 #[doc = r"Value of the register as raw bits"]
76 #[inline(always)]
77 pub fn bits(&self) -> u8 {
78 self.bits
79 }
80 #[doc = "Bits 0:6 - Device Address"]
81 #[inline(always)]
82 pub fn usb_txfuncaddr1_addr(&self) -> USB_TXFUNCADDR1_ADDRR {
83 let bits = ((self.bits >> 0) & 127) as u8;
84 USB_TXFUNCADDR1_ADDRR { bits }
85 }
86}
87impl W {
88 #[doc = r"Writes raw bits to the register"]
89 #[inline(always)]
90 pub unsafe fn bits(&mut self, bits: u8) -> &mut Self {
91 self.bits = bits;
92 self
93 }
94 #[doc = "Bits 0:6 - Device Address"]
95 #[inline(always)]
96 pub fn usb_txfuncaddr1_addr(&mut self) -> _USB_TXFUNCADDR1_ADDRW {
97 _USB_TXFUNCADDR1_ADDRW { w: self }
98 }
99}