esp32p4/usb_device/
set_line_code_w1.rs

1#[doc = "Register `SET_LINE_CODE_W1` reader"]
2pub type R = crate::R<SET_LINE_CODE_W1_SPEC>;
3#[doc = "Field `BCHAR_FORMAT` reader - The value of bCharFormat set by host through SET_LINE_CODING command."]
4pub type BCHAR_FORMAT_R = crate::FieldReader;
5#[doc = "Field `BPARITY_TYPE` reader - The value of bParityTpye set by host through SET_LINE_CODING command."]
6pub type BPARITY_TYPE_R = crate::FieldReader;
7#[doc = "Field `BDATA_BITS` reader - The value of bDataBits set by host through SET_LINE_CODING command."]
8pub type BDATA_BITS_R = crate::FieldReader;
9impl R {
10    #[doc = "Bits 0:7 - The value of bCharFormat set by host through SET_LINE_CODING command."]
11    #[inline(always)]
12    pub fn bchar_format(&self) -> BCHAR_FORMAT_R {
13        BCHAR_FORMAT_R::new((self.bits & 0xff) as u8)
14    }
15    #[doc = "Bits 8:15 - The value of bParityTpye set by host through SET_LINE_CODING command."]
16    #[inline(always)]
17    pub fn bparity_type(&self) -> BPARITY_TYPE_R {
18        BPARITY_TYPE_R::new(((self.bits >> 8) & 0xff) as u8)
19    }
20    #[doc = "Bits 16:23 - The value of bDataBits set by host through SET_LINE_CODING command."]
21    #[inline(always)]
22    pub fn bdata_bits(&self) -> BDATA_BITS_R {
23        BDATA_BITS_R::new(((self.bits >> 16) & 0xff) as u8)
24    }
25}
26#[cfg(feature = "impl-register-debug")]
27impl core::fmt::Debug for R {
28    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
29        f.debug_struct("SET_LINE_CODE_W1")
30            .field(
31                "bchar_format",
32                &format_args!("{}", self.bchar_format().bits()),
33            )
34            .field(
35                "bparity_type",
36                &format_args!("{}", self.bparity_type().bits()),
37            )
38            .field("bdata_bits", &format_args!("{}", self.bdata_bits().bits()))
39            .finish()
40    }
41}
42#[cfg(feature = "impl-register-debug")]
43impl core::fmt::Debug for crate::generic::Reg<SET_LINE_CODE_W1_SPEC> {
44    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
45        core::fmt::Debug::fmt(&self.read(), f)
46    }
47}
48#[doc = "W1 of SET_LINE_CODING command.\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`set_line_code_w1::R`](R).  See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
49pub struct SET_LINE_CODE_W1_SPEC;
50impl crate::RegisterSpec for SET_LINE_CODE_W1_SPEC {
51    type Ux = u32;
52}
53#[doc = "`read()` method returns [`set_line_code_w1::R`](R) reader structure"]
54impl crate::Readable for SET_LINE_CODE_W1_SPEC {}
55#[doc = "`reset()` method sets SET_LINE_CODE_W1 to value 0"]
56impl crate::Resettable for SET_LINE_CODE_W1_SPEC {
57    const RESET_VALUE: u32 = 0;
58}