Skip to content

Commit

Permalink
Correct bit width and offset for USB0:HCCHAR:EC field
Browse files Browse the repository at this point in the history
  • Loading branch information
jessebraham committed Jan 6, 2025
1 parent ffbee35 commit b7ea98f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
6 changes: 6 additions & 0 deletions common_patches/usb0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -269,3 +269,9 @@ _add:
bitWidth: 32
writeConstraint: [0, 0xffffffff]
access: read-write

"HCCHAR?":
_modify:
EC:
bitOffset: 20
bitWidth: 2
12 changes: 6 additions & 6 deletions esp32s2/src/usb0/hc/char.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ pub type EPTYPE_R = crate::FieldReader;
#[doc = "Field `EPTYPE` writer - "]
pub type EPTYPE_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
#[doc = "Field `EC` reader - "]
pub type EC_R = crate::BitReader;
pub type EC_R = crate::FieldReader;
#[doc = "Field `EC` writer - "]
pub type EC_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type EC_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
#[doc = "Field `DEVADDR` reader - "]
pub type DEVADDR_R = crate::FieldReader;
#[doc = "Field `DEVADDR` writer - "]
Expand Down Expand Up @@ -68,10 +68,10 @@ impl R {
pub fn eptype(&self) -> EPTYPE_R {
EPTYPE_R::new(((self.bits >> 18) & 3) as u8)
}
#[doc = "Bit 21"]
#[doc = "Bits 20:21"]
#[inline(always)]
pub fn ec(&self) -> EC_R {
EC_R::new(((self.bits >> 21) & 1) != 0)
EC_R::new(((self.bits >> 20) & 3) as u8)
}
#[doc = "Bits 22:28"]
#[inline(always)]
Expand Down Expand Up @@ -137,10 +137,10 @@ impl W {
pub fn eptype(&mut self) -> EPTYPE_W<CHAR_SPEC> {
EPTYPE_W::new(self, 18)
}
#[doc = "Bit 21"]
#[doc = "Bits 20:21"]
#[inline(always)]
pub fn ec(&mut self) -> EC_W<CHAR_SPEC> {
EC_W::new(self, 21)
EC_W::new(self, 20)
}
#[doc = "Bits 22:28"]
#[inline(always)]
Expand Down
12 changes: 6 additions & 6 deletions esp32s3/src/usb0/hc/char.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ pub type EPTYPE_R = crate::FieldReader;
#[doc = "Field `EPTYPE` writer - "]
pub type EPTYPE_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
#[doc = "Field `EC` reader - "]
pub type EC_R = crate::BitReader;
pub type EC_R = crate::FieldReader;
#[doc = "Field `EC` writer - "]
pub type EC_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type EC_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
#[doc = "Field `DEVADDR` reader - "]
pub type DEVADDR_R = crate::FieldReader;
#[doc = "Field `DEVADDR` writer - "]
Expand Down Expand Up @@ -68,10 +68,10 @@ impl R {
pub fn eptype(&self) -> EPTYPE_R {
EPTYPE_R::new(((self.bits >> 18) & 3) as u8)
}
#[doc = "Bit 21"]
#[doc = "Bits 20:21"]
#[inline(always)]
pub fn ec(&self) -> EC_R {
EC_R::new(((self.bits >> 21) & 1) != 0)
EC_R::new(((self.bits >> 20) & 3) as u8)
}
#[doc = "Bits 22:28"]
#[inline(always)]
Expand Down Expand Up @@ -137,10 +137,10 @@ impl W {
pub fn eptype(&mut self) -> EPTYPE_W<CHAR_SPEC> {
EPTYPE_W::new(self, 18)
}
#[doc = "Bit 21"]
#[doc = "Bits 20:21"]
#[inline(always)]
pub fn ec(&mut self) -> EC_W<CHAR_SPEC> {
EC_W::new(self, 21)
EC_W::new(self, 20)
}
#[doc = "Bits 22:28"]
#[inline(always)]
Expand Down

0 comments on commit b7ea98f

Please sign in to comment.