esp32h2/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("bchar_format", &self.bchar_format())
31            .field("bparity_type", &self.bparity_type())
32            .field("bdata_bits", &self.bdata_bits())
33            .finish()
34    }
35}
36#[doc = "W1 of SET_LINE_CODING command.\n\nYou can [`read`](crate::Reg::read) this register and get [`set_line_code_w1::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
37pub struct SET_LINE_CODE_W1_SPEC;
38impl crate::RegisterSpec for SET_LINE_CODE_W1_SPEC {
39    type Ux = u32;
40}
41#[doc = "`read()` method returns [`set_line_code_w1::R`](R) reader structure"]
42impl crate::Readable for SET_LINE_CODE_W1_SPEC {}
43#[doc = "`reset()` method sets SET_LINE_CODE_W1 to value 0"]
44impl crate::Resettable for SET_LINE_CODE_W1_SPEC {
45    const RESET_VALUE: u32 = 0;
46}