Struct s2pac_ch32v103::USBHD
source · pub struct USBHD { /* private fields */ }
Expand description
USB register
Implementations§
source§impl USBHD
impl USBHD
sourcepub const PTR: *const RegisterBlock = {0x40023400 as *const usbhd::RegisterBlock}
pub const PTR: *const RegisterBlock = {0x40023400 as *const usbhd::RegisterBlock}
Pointer to the register block
sourcepub const fn ptr() -> *const RegisterBlock
pub const fn ptr() -> *const RegisterBlock
Return the pointer to the register block
sourcepub unsafe fn steal() -> Self
pub unsafe fn steal() -> Self
Steal an instance of this peripheral
§Safety
Ensure that the new instance of the peripheral cannot be used in a way that may race with any existing instances, for example by only accessing read-only or write-only registers, or by consuming the original peripheral and using critical sections to coordinate access between multiple new instances.
Additionally, other software such as HALs may rely on only one peripheral instance existing to ensure memory safety; ensure no stolen instances are passed to such software.
Methods from Deref<Target = RegisterBlock>§
sourcepub fn r8_usb_ctrl(&self) -> &R8_USB_CTRL
pub fn r8_usb_ctrl(&self) -> &R8_USB_CTRL
0x00 - USB base control
sourcepub fn r8_udev_ctrl__r8_uhost_ctrl(&self) -> &R8_UDEV_CTRL__R8_UHOST_CTRL
pub fn r8_udev_ctrl__r8_uhost_ctrl(&self) -> &R8_UDEV_CTRL__R8_UHOST_CTRL
0x01 - USB device physical prot control
sourcepub fn r8_usb_int_en(&self) -> &R8_USB_INT_EN
pub fn r8_usb_int_en(&self) -> &R8_USB_INT_EN
0x02 - USB interrupt enable
sourcepub fn r8_usb_dev_ad(&self) -> &R8_USB_DEV_AD
pub fn r8_usb_dev_ad(&self) -> &R8_USB_DEV_AD
0x03 - USB device address
sourcepub fn r8_usb_mis_st(&self) -> &R8_USB_MIS_ST
pub fn r8_usb_mis_st(&self) -> &R8_USB_MIS_ST
0x05 - USB miscellaneous status
sourcepub fn r8_usb_int_fg(&self) -> &R8_USB_INT_FG
pub fn r8_usb_int_fg(&self) -> &R8_USB_INT_FG
0x06 - USB interrupt flag
sourcepub fn r8_usb_int_st(&self) -> &R8_USB_INT_ST
pub fn r8_usb_int_st(&self) -> &R8_USB_INT_ST
0x07 - USB interrupt status
sourcepub fn r8_usb_rx_len(&self) -> &R8_USB_RX_LEN
pub fn r8_usb_rx_len(&self) -> &R8_USB_RX_LEN
0x08 - USB receiving length
sourcepub fn r8_uep4_1_mod(&self) -> &R8_UEP4_1_MOD
pub fn r8_uep4_1_mod(&self) -> &R8_UEP4_1_MOD
0x0c - endpoint 4/1 mode
sourcepub fn r8_uep2_3_mod__r8_uh_ep_mod(&self) -> &R8_UEP2_3_MOD__R8_UH_EP_MOD
pub fn r8_uep2_3_mod__r8_uh_ep_mod(&self) -> &R8_UEP2_3_MOD__R8_UH_EP_MOD
0x0d - endpoint 2/3 mode;host endpoint mode
sourcepub fn r16_uep0_dma(&self) -> &R16_UEP0_DMA
pub fn r16_uep0_dma(&self) -> &R16_UEP0_DMA
0x10 - endpoint 0 DMA buffer address
sourcepub fn r16_uep1_dma(&self) -> &R16_UEP1_DMA
pub fn r16_uep1_dma(&self) -> &R16_UEP1_DMA
0x14 - endpoint 1 DMA buffer address
sourcepub fn r16_uep2_dma__r16_uh_rx_dma(&self) -> &R16_UEP2_DMA__R16_UH_RX_DMA
pub fn r16_uep2_dma__r16_uh_rx_dma(&self) -> &R16_UEP2_DMA__R16_UH_RX_DMA
0x18 - endpoint 2 DMA buffer address;host rx endpoint buffer high address
sourcepub fn r16_uep3_dma__r16_uh_tx_dma(&self) -> &R16_UEP3_DMA__R16_UH_TX_DMA
pub fn r16_uep3_dma__r16_uh_tx_dma(&self) -> &R16_UEP3_DMA__R16_UH_TX_DMA
0x1c - endpoint 3 DMA buffer address;host tx endpoint buffer high address
sourcepub fn r8_uep0_t_len(&self) -> &R8_UEP0_T_LEN
pub fn r8_uep0_t_len(&self) -> &R8_UEP0_T_LEN
0x20 - endpoint 0 transmittal length
sourcepub fn r8_uep0_ctrl(&self) -> &R8_UEP0_CTRL
pub fn r8_uep0_ctrl(&self) -> &R8_UEP0_CTRL
0x22 - endpoint 0 control
sourcepub fn r8_uep1_t_len(&self) -> &R8_UEP1_T_LEN
pub fn r8_uep1_t_len(&self) -> &R8_UEP1_T_LEN
0x24 - endpoint 1 transmittal length
sourcepub fn r8_uep1_ctrl__r8_uh_setup(&self) -> &R8_UEP1_CTRL__R8_UH_SETUP
pub fn r8_uep1_ctrl__r8_uh_setup(&self) -> &R8_UEP1_CTRL__R8_UH_SETUP
0x26 - endpoint 1 control;host aux setup
sourcepub fn r8_uep2_t_len__r8_uh_ep_pid(&self) -> &R8_UEP2_T_LEN__R8_UH_EP_PID
pub fn r8_uep2_t_len__r8_uh_ep_pid(&self) -> &R8_UEP2_T_LEN__R8_UH_EP_PID
0x28 - endpoint 2 transmittal length;host endpoint and PID
sourcepub fn r8_uep2_ctrl__r8_uh_rx_ctrl(&self) -> &R8_UEP2_CTRL__R8_UH_RX_CTRL
pub fn r8_uep2_ctrl__r8_uh_rx_ctrl(&self) -> &R8_UEP2_CTRL__R8_UH_RX_CTRL
0x2a - endpoint 2 control;host receiver endpoint control
sourcepub fn r8_uep3_t_len__r8_uh_tx_len(&self) -> &R8_UEP3_T_LEN__R8_UH_TX_LEN
pub fn r8_uep3_t_len__r8_uh_tx_len(&self) -> &R8_UEP3_T_LEN__R8_UH_TX_LEN
0x2c - endpoint 3 transmittal length;host transmittal endpoint transmittal length
sourcepub fn r8_uep3_ctrl__r8_uh_tx_ctrl(&self) -> &R8_UEP3_CTRL__R8_UH_TX_CTRL
pub fn r8_uep3_ctrl__r8_uh_tx_ctrl(&self) -> &R8_UEP3_CTRL__R8_UH_TX_CTRL
0x2e - endpoint 3 control;host transmittal endpoint control
sourcepub fn r8_uep4_t_len(&self) -> &R8_UEP4_T_LEN
pub fn r8_uep4_t_len(&self) -> &R8_UEP4_T_LEN
0x30 - endpoint 4 transmittal length
sourcepub fn r8_uep4_ctrl(&self) -> &R8_UEP4_CTRL
pub fn r8_uep4_ctrl(&self) -> &R8_UEP4_CTRL
0x32 - endpoint 4 control
sourcepub fn r8_usb_type_c_ctrl(&self) -> &R8_USB_TYPE_C_CTRL
pub fn r8_usb_type_c_ctrl(&self) -> &R8_USB_TYPE_C_CTRL
0x38 - USB type-C control