Skip to content

Commit

Permalink
ESP32-P4: Patch the USB_DEVICE peripheral (#188)
Browse files Browse the repository at this point in the history
* Patch the `USB_DEVICE` peripheral for ESP32-P4

* Regenerate package
  • Loading branch information
jessebraham authored Feb 1, 2024
1 parent 7607181 commit 9caffaa
Show file tree
Hide file tree
Showing 37 changed files with 1,179 additions and 1,434 deletions.
2 changes: 1 addition & 1 deletion esp32p4/src/usb_device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ impl RegisterBlock {
&self.date
}
}
#[doc = "EP1 (r) register accessor: FIFO access for the CDC-ACM data IN and OUT endpoints.\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ep1::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ep1`] module"]
#[doc = "EP1 (rw) register accessor: FIFO access for the CDC-ACM data IN and OUT endpoints.\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ep1::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ep1::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ep1`] module"]
pub type EP1 = crate::Reg<ep1::EP1_SPEC>;
#[doc = "FIFO access for the CDC-ACM data IN and OUT endpoints."]
pub mod ep1;
Expand Down
12 changes: 6 additions & 6 deletions esp32p4/src/usb_device/bus_reset_st.rs
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
#[doc = "Register `BUS_RESET_ST` reader"]
pub type R = crate::R<BUS_RESET_ST_SPEC>;
#[doc = "Field `USB_SERIAL_JTAG_USB_BUS_RESET_ST` reader - USB bus reset status. 0: USB-Serial-JTAG is in usb bus reset status. 1: USB bus reset is released."]
pub type USB_SERIAL_JTAG_USB_BUS_RESET_ST_R = crate::BitReader;
#[doc = "Field `USB_BUS_RESET_ST` reader - USB bus reset status. 0: USB-Serial-JTAG is in usb bus reset status. 1: USB bus reset is released."]
pub type USB_BUS_RESET_ST_R = crate::BitReader;
impl R {
#[doc = "Bit 0 - USB bus reset status. 0: USB-Serial-JTAG is in usb bus reset status. 1: USB bus reset is released."]
#[inline(always)]
pub fn usb_serial_jtag_usb_bus_reset_st(&self) -> USB_SERIAL_JTAG_USB_BUS_RESET_ST_R {
USB_SERIAL_JTAG_USB_BUS_RESET_ST_R::new((self.bits & 1) != 0)
pub fn usb_bus_reset_st(&self) -> USB_BUS_RESET_ST_R {
USB_BUS_RESET_ST_R::new((self.bits & 1) != 0)
}
}
#[cfg(feature = "impl-register-debug")]
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("BUS_RESET_ST")
.field(
"usb_serial_jtag_usb_bus_reset_st",
&format_args!("{}", self.usb_serial_jtag_usb_bus_reset_st().bit()),
"usb_bus_reset_st",
&format_args!("{}", self.usb_bus_reset_st().bit()),
)
.finish()
}
Expand Down
48 changes: 20 additions & 28 deletions esp32p4/src/usb_device/chip_rst.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,40 @@
pub type R = crate::R<CHIP_RST_SPEC>;
#[doc = "Register `CHIP_RST` writer"]
pub type W = crate::W<CHIP_RST_SPEC>;
#[doc = "Field `USB_SERIAL_JTAG_RTS` reader - 1: Chip reset is detected from usb serial channel. Software write 1 to clear it."]
pub type USB_SERIAL_JTAG_RTS_R = crate::BitReader;
#[doc = "Field `USB_SERIAL_JTAG_DTR` reader - 1: Chip reset is detected from usb jtag channel. Software write 1 to clear it."]
pub type USB_SERIAL_JTAG_DTR_R = crate::BitReader;
#[doc = "Field `USB_SERIAL_JTAG_USB_UART_CHIP_RST_DIS` reader - Set this bit to disable chip reset from usb serial channel to reset chip."]
pub type USB_SERIAL_JTAG_USB_UART_CHIP_RST_DIS_R = crate::BitReader;
#[doc = "Field `USB_SERIAL_JTAG_USB_UART_CHIP_RST_DIS` writer - Set this bit to disable chip reset from usb serial channel to reset chip."]
pub type USB_SERIAL_JTAG_USB_UART_CHIP_RST_DIS_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `RTS` reader - 1: Chip reset is detected from usb serial channel. Software write 1 to clear it."]
pub type RTS_R = crate::BitReader;
#[doc = "Field `DTR` reader - 1: Chip reset is detected from usb jtag channel. Software write 1 to clear it."]
pub type DTR_R = crate::BitReader;
#[doc = "Field `USB_UART_CHIP_RST_DIS` reader - Set this bit to disable chip reset from usb serial channel to reset chip."]
pub type USB_UART_CHIP_RST_DIS_R = crate::BitReader;
#[doc = "Field `USB_UART_CHIP_RST_DIS` writer - Set this bit to disable chip reset from usb serial channel to reset chip."]
pub type USB_UART_CHIP_RST_DIS_W<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[doc = "Bit 0 - 1: Chip reset is detected from usb serial channel. Software write 1 to clear it."]
#[inline(always)]
pub fn usb_serial_jtag_rts(&self) -> USB_SERIAL_JTAG_RTS_R {
USB_SERIAL_JTAG_RTS_R::new((self.bits & 1) != 0)
pub fn rts(&self) -> RTS_R {
RTS_R::new((self.bits & 1) != 0)
}
#[doc = "Bit 1 - 1: Chip reset is detected from usb jtag channel. Software write 1 to clear it."]
#[inline(always)]
pub fn usb_serial_jtag_dtr(&self) -> USB_SERIAL_JTAG_DTR_R {
USB_SERIAL_JTAG_DTR_R::new(((self.bits >> 1) & 1) != 0)
pub fn dtr(&self) -> DTR_R {
DTR_R::new(((self.bits >> 1) & 1) != 0)
}
#[doc = "Bit 2 - Set this bit to disable chip reset from usb serial channel to reset chip."]
#[inline(always)]
pub fn usb_serial_jtag_usb_uart_chip_rst_dis(&self) -> USB_SERIAL_JTAG_USB_UART_CHIP_RST_DIS_R {
USB_SERIAL_JTAG_USB_UART_CHIP_RST_DIS_R::new(((self.bits >> 2) & 1) != 0)
pub fn usb_uart_chip_rst_dis(&self) -> USB_UART_CHIP_RST_DIS_R {
USB_UART_CHIP_RST_DIS_R::new(((self.bits >> 2) & 1) != 0)
}
}
#[cfg(feature = "impl-register-debug")]
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CHIP_RST")
.field("rts", &format_args!("{}", self.rts().bit()))
.field("dtr", &format_args!("{}", self.dtr().bit()))
.field(
"usb_serial_jtag_rts",
&format_args!("{}", self.usb_serial_jtag_rts().bit()),
)
.field(
"usb_serial_jtag_dtr",
&format_args!("{}", self.usb_serial_jtag_dtr().bit()),
)
.field(
"usb_serial_jtag_usb_uart_chip_rst_dis",
&format_args!("{}", self.usb_serial_jtag_usb_uart_chip_rst_dis().bit()),
"usb_uart_chip_rst_dis",
&format_args!("{}", self.usb_uart_chip_rst_dis().bit()),
)
.finish()
}
Expand All @@ -56,10 +50,8 @@ impl W {
#[doc = "Bit 2 - Set this bit to disable chip reset from usb serial channel to reset chip."]
#[inline(always)]
#[must_use]
pub fn usb_serial_jtag_usb_uart_chip_rst_dis(
&mut self,
) -> USB_SERIAL_JTAG_USB_UART_CHIP_RST_DIS_W<CHIP_RST_SPEC> {
USB_SERIAL_JTAG_USB_UART_CHIP_RST_DIS_W::new(self, 2)
pub fn usb_uart_chip_rst_dis(&mut self) -> USB_UART_CHIP_RST_DIS_W<CHIP_RST_SPEC> {
USB_UART_CHIP_RST_DIS_W::new(self, 2)
}
#[doc = r" Writes raw bits to the register."]
#[doc = r""]
Expand Down
Loading

0 comments on commit 9caffaa

Please sign in to comment.