Struct s2pac_ch32v103::USBHD

source ·
pub struct USBHD { /* private fields */ }
Expand description

USB register

Implementations§

source§

impl USBHD

source

pub const PTR: *const RegisterBlock = {0x40023400 as *const usbhd::RegisterBlock}

Pointer to the register block

source

pub const fn ptr() -> *const RegisterBlock

Return the pointer to the register block

source

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>§

source

pub fn r8_usb_ctrl(&self) -> &R8_USB_CTRL

0x00 - USB base control

source

pub fn r8_udev_ctrl__r8_uhost_ctrl(&self) -> &R8_UDEV_CTRL__R8_UHOST_CTRL

0x01 - USB device physical prot control

source

pub fn r8_usb_int_en(&self) -> &R8_USB_INT_EN

0x02 - USB interrupt enable

source

pub fn r8_usb_dev_ad(&self) -> &R8_USB_DEV_AD

0x03 - USB device address

source

pub fn r8_usb_mis_st(&self) -> &R8_USB_MIS_ST

0x05 - USB miscellaneous status

source

pub fn r8_usb_int_fg(&self) -> &R8_USB_INT_FG

0x06 - USB interrupt flag

source

pub fn r8_usb_int_st(&self) -> &R8_USB_INT_ST

0x07 - USB interrupt status

source

pub fn r8_usb_rx_len(&self) -> &R8_USB_RX_LEN

0x08 - USB receiving length

source

pub fn r8_uep4_1_mod(&self) -> &R8_UEP4_1_MOD

0x0c - endpoint 4/1 mode

source

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

source

pub fn r16_uep0_dma(&self) -> &R16_UEP0_DMA

0x10 - endpoint 0 DMA buffer address

source

pub fn r16_uep1_dma(&self) -> &R16_UEP1_DMA

0x14 - endpoint 1 DMA buffer address

source

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

source

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

source

pub fn r8_uep0_t_len(&self) -> &R8_UEP0_T_LEN

0x20 - endpoint 0 transmittal length

source

pub fn r8_uep0_ctrl(&self) -> &R8_UEP0_CTRL

0x22 - endpoint 0 control

source

pub fn r8_uep1_t_len(&self) -> &R8_UEP1_T_LEN

0x24 - endpoint 1 transmittal length

source

pub fn r8_uep1_ctrl__r8_uh_setup(&self) -> &R8_UEP1_CTRL__R8_UH_SETUP

0x26 - endpoint 1 control;host aux setup

source

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

source

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

source

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

source

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

source

pub fn r8_uep4_t_len(&self) -> &R8_UEP4_T_LEN

0x30 - endpoint 4 transmittal length

source

pub fn r8_uep4_ctrl(&self) -> &R8_UEP4_CTRL

0x32 - endpoint 4 control

source

pub fn r8_usb_type_c_ctrl(&self) -> &R8_USB_TYPE_C_CTRL

0x38 - USB type-C control

Trait Implementations§

source§

impl Debug for USBHD

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Deref for USBHD

§

type Target = RegisterBlock

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl Send for USBHD

Auto Trait Implementations§

§

impl RefUnwindSafe for USBHD

§

impl !Sync for USBHD

§

impl Unpin for USBHD

§

impl UnwindSafe for USBHD

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.