#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum DevctrlSpdconf {
#[doc = "The peripheral starts in full-speed mode and performs a high-speed reset to switch to the high-speed mode if the host is high-speed capable."]
NORMAL = 0x0,
#[doc = "For a better consumption, if high-speed is not needed."]
LOW_POWER = 0x01,
#[doc = "Forced high speed."]
HIGH_SPEED = 0x02,
#[doc = "The peripheral remains in full-speed mode whatever the host speed capability."]
FORCED_FS = 0x03,
}
impl DevctrlSpdconf {
#[inline(always)]
pub const fn from_bits(val: u8) -> DevctrlSpdconf {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for DevctrlSpdconf {
#[inline(always)]
fn from(val: u8) -> DevctrlSpdconf {
DevctrlSpdconf::from_bits(val)
}
}
impl From<DevctrlSpdconf> for u8 {
#[inline(always)]
fn from(val: DevctrlSpdconf) -> u8 {
DevctrlSpdconf::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Deveptisr0IsoenptCurrbk {
#[doc = "Current bank is bank0"]
BANK0 = 0x0,
#[doc = "Current bank is bank1"]
BANK1 = 0x01,
#[doc = "Current bank is bank2"]
BANK2 = 0x02,
_RESERVED_3 = 0x03,
}
impl Deveptisr0IsoenptCurrbk {
#[inline(always)]
pub const fn from_bits(val: u8) -> Deveptisr0IsoenptCurrbk {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Deveptisr0IsoenptCurrbk {
#[inline(always)]
fn from(val: u8) -> Deveptisr0IsoenptCurrbk {
Deveptisr0IsoenptCurrbk::from_bits(val)
}
}
impl From<Deveptisr0IsoenptCurrbk> for u8 {
#[inline(always)]
fn from(val: Deveptisr0IsoenptCurrbk) -> u8 {
Deveptisr0IsoenptCurrbk::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Deveptisr0IsoenptDtseq {
#[doc = "Data0 toggle sequence"]
DATA0 = 0x0,
#[doc = "Data1 toggle sequence"]
DATA1 = 0x01,
#[doc = "Data2 toggle sequence (for high-bandwidth isochronous endpoint)"]
DATA2 = 0x02,
#[doc = "MData toggle sequence (for high-bandwidth isochronous endpoint)"]
MDATA = 0x03,
}
impl Deveptisr0IsoenptDtseq {
#[inline(always)]
pub const fn from_bits(val: u8) -> Deveptisr0IsoenptDtseq {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Deveptisr0IsoenptDtseq {
#[inline(always)]
fn from(val: u8) -> Deveptisr0IsoenptDtseq {
Deveptisr0IsoenptDtseq::from_bits(val)
}
}
impl From<Deveptisr0IsoenptDtseq> for u8 {
#[inline(always)]
fn from(val: Deveptisr0IsoenptDtseq) -> u8 {
Deveptisr0IsoenptDtseq::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Deveptisr0IsoenptNbusybk {
#[doc = "0 busy bank (all banks free)"]
_0_BUSY = 0x0,
#[doc = "1 busy bank"]
_1_BUSY = 0x01,
#[doc = "2 busy banks"]
_2_BUSY = 0x02,
#[doc = "3 busy banks"]
_3_BUSY = 0x03,
}
impl Deveptisr0IsoenptNbusybk {
#[inline(always)]
pub const fn from_bits(val: u8) -> Deveptisr0IsoenptNbusybk {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Deveptisr0IsoenptNbusybk {
#[inline(always)]
fn from(val: u8) -> Deveptisr0IsoenptNbusybk {
Deveptisr0IsoenptNbusybk::from_bits(val)
}
}
impl From<Deveptisr0IsoenptNbusybk> for u8 {
#[inline(always)]
fn from(val: Deveptisr0IsoenptNbusybk) -> u8 {
Deveptisr0IsoenptNbusybk::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum DeveptisrCurrbk {
#[doc = "Current bank is bank0"]
BANK0 = 0x0,
#[doc = "Current bank is bank1"]
BANK1 = 0x01,
#[doc = "Current bank is bank2"]
BANK2 = 0x02,
_RESERVED_3 = 0x03,
}
impl DeveptisrCurrbk {
#[inline(always)]
pub const fn from_bits(val: u8) -> DeveptisrCurrbk {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for DeveptisrCurrbk {
#[inline(always)]
fn from(val: u8) -> DeveptisrCurrbk {
DeveptisrCurrbk::from_bits(val)
}
}
impl From<DeveptisrCurrbk> for u8 {
#[inline(always)]
fn from(val: DeveptisrCurrbk) -> u8 {
DeveptisrCurrbk::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum DeveptisrDtseq {
#[doc = "Data0 toggle sequence"]
DATA0 = 0x0,
#[doc = "Data1 toggle sequence"]
DATA1 = 0x01,
#[doc = "Reserved for high-bandwidth isochronous endpoint"]
DATA2 = 0x02,
#[doc = "Reserved for high-bandwidth isochronous endpoint"]
MDATA = 0x03,
}
impl DeveptisrDtseq {
#[inline(always)]
pub const fn from_bits(val: u8) -> DeveptisrDtseq {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for DeveptisrDtseq {
#[inline(always)]
fn from(val: u8) -> DeveptisrDtseq {
DeveptisrDtseq::from_bits(val)
}
}
impl From<DeveptisrDtseq> for u8 {
#[inline(always)]
fn from(val: DeveptisrDtseq) -> u8 {
DeveptisrDtseq::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum DeveptisrNbusybk {
#[doc = "0 busy bank (all banks free)"]
_0_BUSY = 0x0,
#[doc = "1 busy bank"]
_1_BUSY = 0x01,
#[doc = "2 busy banks"]
_2_BUSY = 0x02,
#[doc = "3 busy banks"]
_3_BUSY = 0x03,
}
impl DeveptisrNbusybk {
#[inline(always)]
pub const fn from_bits(val: u8) -> DeveptisrNbusybk {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for DeveptisrNbusybk {
#[inline(always)]
fn from(val: u8) -> DeveptisrNbusybk {
DeveptisrNbusybk::from_bits(val)
}
}
impl From<DeveptisrNbusybk> for u8 {
#[inline(always)]
fn from(val: DeveptisrNbusybk) -> u8 {
DeveptisrNbusybk::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Drdstate {
#[doc = "This is the start state for A-devices (when the ID pin is 0)"]
A_IDLESTATE = 0x0,
#[doc = "In this state, the A-device waits for the voltage on VBus to rise above the A-device VBus Valid threshold (4.4 V)."]
A_WAIT_VRISE = 0x01,
#[doc = "In this state, the A-device waits for the B-device to signal a connection."]
A_WAIT_BCON = 0x02,
#[doc = "In this state, the A-device that operates in Host mode is operational."]
A_HOST = 0x03,
#[doc = "The A-device operating as a host is in the suspend mode."]
A_SUSPEND = 0x04,
#[doc = "The A-device operates as a peripheral."]
A_PERIPHERAL = 0x05,
#[doc = "In this state, the A-device waits for the voltage on VBus to drop below the A-device Session Valid threshold (1.4 V)."]
A_WAIT_VFALL = 0x06,
#[doc = "In this state, the A-device waits for recovery of the over-current condition that caused it to enter this state."]
A_VBUS_ERR = 0x07,
#[doc = "In this state, the A-device waits for the data USB line to discharge (100 us)."]
A_WAIT_DISCHARGE = 0x08,
#[doc = "This is the start state for B-device (when the ID pin is 1)."]
B_IDLE = 0x09,
#[doc = "In this state, the B-device acts as the peripheral."]
B_PERIPHERAL = 0x0a,
#[doc = "In this state, the B-device is in suspend mode and waits until 3 ms before initiating the HNP protocol if requested."]
B_WAIT_BEGIN_HNP = 0x0b,
#[doc = "In this state, the B-device waits for the data USB line to discharge (100 us) before becoming Host."]
B_WAIT_DISCHARGE = 0x0c,
#[doc = "In this state, the B-device waits for the A-device to signal a connect before becoming B-Host."]
B_WAIT_ACON = 0x0d,
#[doc = "In this state, the B-device acts as the Host."]
B_HOST = 0x0e,
#[doc = "In this state, the B-device attempts to start a session using the SRP protocol."]
B_SRP_INIT = 0x0f,
}
impl Drdstate {
#[inline(always)]
pub const fn from_bits(val: u8) -> Drdstate {
unsafe { core::mem::transmute(val & 0x0f) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Drdstate {
#[inline(always)]
fn from(val: u8) -> Drdstate {
Drdstate::from_bits(val)
}
}
impl From<Drdstate> for u8 {
#[inline(always)]
fn from(val: Drdstate) -> u8 {
Drdstate::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Epbk {
#[doc = "Single-bank endpoint"]
_1_BANK = 0x0,
#[doc = "Double-bank endpoint"]
_2_BANK = 0x01,
#[doc = "Triple-bank endpoint"]
_3_BANK = 0x02,
_RESERVED_3 = 0x03,
}
impl Epbk {
#[inline(always)]
pub const fn from_bits(val: u8) -> Epbk {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Epbk {
#[inline(always)]
fn from(val: u8) -> Epbk {
Epbk::from_bits(val)
}
}
impl From<Epbk> for u8 {
#[inline(always)]
fn from(val: Epbk) -> u8 {
Epbk::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Epdir {
#[doc = "The endpoint direction is OUT."]
OUT = 0x0,
#[doc = "The endpoint direction is IN (nor for control endpoints)."]
IN = 0x01,
}
impl Epdir {
#[inline(always)]
pub const fn from_bits(val: u8) -> Epdir {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Epdir {
#[inline(always)]
fn from(val: u8) -> Epdir {
Epdir::from_bits(val)
}
}
impl From<Epdir> for u8 {
#[inline(always)]
fn from(val: Epdir) -> u8 {
Epdir::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Epsize {
#[doc = "8 bytes"]
_8_BYTE = 0x0,
#[doc = "16 bytes"]
_16_BYTE = 0x01,
#[doc = "32 bytes"]
_32_BYTE = 0x02,
#[doc = "64 bytes"]
_64_BYTE = 0x03,
#[doc = "128 bytes"]
_128_BYTE = 0x04,
#[doc = "256 bytes"]
_256_BYTE = 0x05,
#[doc = "512 bytes"]
_512_BYTE = 0x06,
#[doc = "1024 bytes"]
_1024_BYTE = 0x07,
}
impl Epsize {
#[inline(always)]
pub const fn from_bits(val: u8) -> Epsize {
unsafe { core::mem::transmute(val & 0x07) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Epsize {
#[inline(always)]
fn from(val: u8) -> Epsize {
Epsize::from_bits(val)
}
}
impl From<Epsize> for u8 {
#[inline(always)]
fn from(val: Epsize) -> u8 {
Epsize::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Eptype {
#[doc = "Control"]
CTRL = 0x0,
#[doc = "Isochronous"]
ISO = 0x01,
#[doc = "Bulk"]
BLK = 0x02,
#[doc = "Interrupt"]
INTRPT = 0x03,
}
impl Eptype {
#[inline(always)]
pub const fn from_bits(val: u8) -> Eptype {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Eptype {
#[inline(always)]
fn from(val: u8) -> Eptype {
Eptype::from_bits(val)
}
}
impl From<Eptype> for u8 {
#[inline(always)]
fn from(val: Eptype) -> u8 {
Eptype::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum HstctrlSpdconf {
#[doc = "The host starts in full-speed mode and performs a high-speed reset to switch to the high-speed mode if the downstream peripheral is high-speed capable."]
NORMAL = 0x0,
#[doc = "For a better consumption, if high-speed is not needed."]
LOW_POWER = 0x01,
#[doc = "Forced high speed."]
HIGH_SPEED = 0x02,
#[doc = "The host remains to full-speed mode whatever the peripheral speed capability."]
FORCED_FS = 0x03,
}
impl HstctrlSpdconf {
#[inline(always)]
pub const fn from_bits(val: u8) -> HstctrlSpdconf {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for HstctrlSpdconf {
#[inline(always)]
fn from(val: u8) -> HstctrlSpdconf {
HstctrlSpdconf::from_bits(val)
}
}
impl From<HstctrlSpdconf> for u8 {
#[inline(always)]
fn from(val: HstctrlSpdconf) -> u8 {
HstctrlSpdconf::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Hstpipcfg0HsbohscpPbk {
#[doc = "Single-bank pipe"]
_1_BANK = 0x0,
#[doc = "Double-bank pipe"]
_2_BANK = 0x01,
#[doc = "Triple-bank pipe"]
_3_BANK = 0x02,
_RESERVED_3 = 0x03,
}
impl Hstpipcfg0HsbohscpPbk {
#[inline(always)]
pub const fn from_bits(val: u8) -> Hstpipcfg0HsbohscpPbk {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Hstpipcfg0HsbohscpPbk {
#[inline(always)]
fn from(val: u8) -> Hstpipcfg0HsbohscpPbk {
Hstpipcfg0HsbohscpPbk::from_bits(val)
}
}
impl From<Hstpipcfg0HsbohscpPbk> for u8 {
#[inline(always)]
fn from(val: Hstpipcfg0HsbohscpPbk) -> u8 {
Hstpipcfg0HsbohscpPbk::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Hstpipcfg0HsbohscpPsize {
#[doc = "8 bytes"]
_8_BYTE = 0x0,
#[doc = "16 bytes"]
_16_BYTE = 0x01,
#[doc = "32 bytes"]
_32_BYTE = 0x02,
#[doc = "64 bytes"]
_64_BYTE = 0x03,
#[doc = "128 bytes"]
_128_BYTE = 0x04,
#[doc = "256 bytes"]
_256_BYTE = 0x05,
#[doc = "512 bytes"]
_512_BYTE = 0x06,
#[doc = "1024 bytes"]
_1024_BYTE = 0x07,
}
impl Hstpipcfg0HsbohscpPsize {
#[inline(always)]
pub const fn from_bits(val: u8) -> Hstpipcfg0HsbohscpPsize {
unsafe { core::mem::transmute(val & 0x07) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Hstpipcfg0HsbohscpPsize {
#[inline(always)]
fn from(val: u8) -> Hstpipcfg0HsbohscpPsize {
Hstpipcfg0HsbohscpPsize::from_bits(val)
}
}
impl From<Hstpipcfg0HsbohscpPsize> for u8 {
#[inline(always)]
fn from(val: Hstpipcfg0HsbohscpPsize) -> u8 {
Hstpipcfg0HsbohscpPsize::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Hstpipcfg0HsbohscpPtoken {
#[doc = "SETUP"]
SETUP = 0x0,
#[doc = "IN"]
IN = 0x01,
#[doc = "OUT"]
OUT = 0x02,
_RESERVED_3 = 0x03,
}
impl Hstpipcfg0HsbohscpPtoken {
#[inline(always)]
pub const fn from_bits(val: u8) -> Hstpipcfg0HsbohscpPtoken {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Hstpipcfg0HsbohscpPtoken {
#[inline(always)]
fn from(val: u8) -> Hstpipcfg0HsbohscpPtoken {
Hstpipcfg0HsbohscpPtoken::from_bits(val)
}
}
impl From<Hstpipcfg0HsbohscpPtoken> for u8 {
#[inline(always)]
fn from(val: Hstpipcfg0HsbohscpPtoken) -> u8 {
Hstpipcfg0HsbohscpPtoken::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Hstpipcfg0HsbohscpPtype {
#[doc = "Control"]
CTRL = 0x0,
_RESERVED_1 = 0x01,
#[doc = "Bulk"]
BLK = 0x02,
_RESERVED_3 = 0x03,
}
impl Hstpipcfg0HsbohscpPtype {
#[inline(always)]
pub const fn from_bits(val: u8) -> Hstpipcfg0HsbohscpPtype {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Hstpipcfg0HsbohscpPtype {
#[inline(always)]
fn from(val: u8) -> Hstpipcfg0HsbohscpPtype {
Hstpipcfg0HsbohscpPtype::from_bits(val)
}
}
impl From<Hstpipcfg0HsbohscpPtype> for u8 {
#[inline(always)]
fn from(val: Hstpipcfg0HsbohscpPtype) -> u8 {
Hstpipcfg0HsbohscpPtype::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum HstpipcfgPbk {
#[doc = "Single-bank pipe"]
_1_BANK = 0x0,
#[doc = "Double-bank pipe"]
_2_BANK = 0x01,
#[doc = "Triple-bank pipe"]
_3_BANK = 0x02,
_RESERVED_3 = 0x03,
}
impl HstpipcfgPbk {
#[inline(always)]
pub const fn from_bits(val: u8) -> HstpipcfgPbk {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for HstpipcfgPbk {
#[inline(always)]
fn from(val: u8) -> HstpipcfgPbk {
HstpipcfgPbk::from_bits(val)
}
}
impl From<HstpipcfgPbk> for u8 {
#[inline(always)]
fn from(val: HstpipcfgPbk) -> u8 {
HstpipcfgPbk::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum HstpipcfgPsize {
#[doc = "8 bytes"]
_8_BYTE = 0x0,
#[doc = "16 bytes"]
_16_BYTE = 0x01,
#[doc = "32 bytes"]
_32_BYTE = 0x02,
#[doc = "64 bytes"]
_64_BYTE = 0x03,
#[doc = "128 bytes"]
_128_BYTE = 0x04,
#[doc = "256 bytes"]
_256_BYTE = 0x05,
#[doc = "512 bytes"]
_512_BYTE = 0x06,
#[doc = "1024 bytes"]
_1024_BYTE = 0x07,
}
impl HstpipcfgPsize {
#[inline(always)]
pub const fn from_bits(val: u8) -> HstpipcfgPsize {
unsafe { core::mem::transmute(val & 0x07) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for HstpipcfgPsize {
#[inline(always)]
fn from(val: u8) -> HstpipcfgPsize {
HstpipcfgPsize::from_bits(val)
}
}
impl From<HstpipcfgPsize> for u8 {
#[inline(always)]
fn from(val: HstpipcfgPsize) -> u8 {
HstpipcfgPsize::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum HstpipcfgPtoken {
#[doc = "SETUP"]
SETUP = 0x0,
#[doc = "IN"]
IN = 0x01,
#[doc = "OUT"]
OUT = 0x02,
_RESERVED_3 = 0x03,
}
impl HstpipcfgPtoken {
#[inline(always)]
pub const fn from_bits(val: u8) -> HstpipcfgPtoken {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for HstpipcfgPtoken {
#[inline(always)]
fn from(val: u8) -> HstpipcfgPtoken {
HstpipcfgPtoken::from_bits(val)
}
}
impl From<HstpipcfgPtoken> for u8 {
#[inline(always)]
fn from(val: HstpipcfgPtoken) -> u8 {
HstpipcfgPtoken::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum HstpipcfgPtype {
#[doc = "Control"]
CTRL = 0x0,
#[doc = "Isochronous"]
ISO = 0x01,
#[doc = "Bulk"]
BLK = 0x02,
#[doc = "Interrupt"]
INTRPT = 0x03,
}
impl HstpipcfgPtype {
#[inline(always)]
pub const fn from_bits(val: u8) -> HstpipcfgPtype {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for HstpipcfgPtype {
#[inline(always)]
fn from(val: u8) -> HstpipcfgPtype {
HstpipcfgPtype::from_bits(val)
}
}
impl From<HstpipcfgPtype> for u8 {
#[inline(always)]
fn from(val: HstpipcfgPtype) -> u8 {
HstpipcfgPtype::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Hstpipisr0IntpipesCurrbk {
#[doc = "Current bank is bank0"]
BANK0 = 0x0,
#[doc = "Current bank is bank1"]
BANK1 = 0x01,
#[doc = "Current bank is bank2"]
BANK2 = 0x02,
_RESERVED_3 = 0x03,
}
impl Hstpipisr0IntpipesCurrbk {
#[inline(always)]
pub const fn from_bits(val: u8) -> Hstpipisr0IntpipesCurrbk {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Hstpipisr0IntpipesCurrbk {
#[inline(always)]
fn from(val: u8) -> Hstpipisr0IntpipesCurrbk {
Hstpipisr0IntpipesCurrbk::from_bits(val)
}
}
impl From<Hstpipisr0IntpipesCurrbk> for u8 {
#[inline(always)]
fn from(val: Hstpipisr0IntpipesCurrbk) -> u8 {
Hstpipisr0IntpipesCurrbk::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Hstpipisr0IntpipesDtseq {
#[doc = "Data0 toggle sequence"]
DATA0 = 0x0,
#[doc = "Data1 toggle sequence"]
DATA1 = 0x01,
_RESERVED_2 = 0x02,
_RESERVED_3 = 0x03,
}
impl Hstpipisr0IntpipesDtseq {
#[inline(always)]
pub const fn from_bits(val: u8) -> Hstpipisr0IntpipesDtseq {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Hstpipisr0IntpipesDtseq {
#[inline(always)]
fn from(val: u8) -> Hstpipisr0IntpipesDtseq {
Hstpipisr0IntpipesDtseq::from_bits(val)
}
}
impl From<Hstpipisr0IntpipesDtseq> for u8 {
#[inline(always)]
fn from(val: Hstpipisr0IntpipesDtseq) -> u8 {
Hstpipisr0IntpipesDtseq::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Hstpipisr0IntpipesNbusybk {
#[doc = "0 busy bank (all banks free)"]
_0_BUSY = 0x0,
#[doc = "1 busy bank"]
_1_BUSY = 0x01,
#[doc = "2 busy banks"]
_2_BUSY = 0x02,
#[doc = "3 busy banks"]
_3_BUSY = 0x03,
}
impl Hstpipisr0IntpipesNbusybk {
#[inline(always)]
pub const fn from_bits(val: u8) -> Hstpipisr0IntpipesNbusybk {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Hstpipisr0IntpipesNbusybk {
#[inline(always)]
fn from(val: u8) -> Hstpipisr0IntpipesNbusybk {
Hstpipisr0IntpipesNbusybk::from_bits(val)
}
}
impl From<Hstpipisr0IntpipesNbusybk> for u8 {
#[inline(always)]
fn from(val: Hstpipisr0IntpipesNbusybk) -> u8 {
Hstpipisr0IntpipesNbusybk::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Hstpipisr0IsopipesCurrbk {
#[doc = "Current bank is bank0"]
BANK0 = 0x0,
#[doc = "Current bank is bank1"]
BANK1 = 0x01,
#[doc = "Current bank is bank2"]
BANK2 = 0x02,
_RESERVED_3 = 0x03,
}
impl Hstpipisr0IsopipesCurrbk {
#[inline(always)]
pub const fn from_bits(val: u8) -> Hstpipisr0IsopipesCurrbk {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Hstpipisr0IsopipesCurrbk {
#[inline(always)]
fn from(val: u8) -> Hstpipisr0IsopipesCurrbk {
Hstpipisr0IsopipesCurrbk::from_bits(val)
}
}
impl From<Hstpipisr0IsopipesCurrbk> for u8 {
#[inline(always)]
fn from(val: Hstpipisr0IsopipesCurrbk) -> u8 {
Hstpipisr0IsopipesCurrbk::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Hstpipisr0IsopipesDtseq {
#[doc = "Data0 toggle sequence"]
DATA0 = 0x0,
#[doc = "Data1 toggle sequence"]
DATA1 = 0x01,
_RESERVED_2 = 0x02,
_RESERVED_3 = 0x03,
}
impl Hstpipisr0IsopipesDtseq {
#[inline(always)]
pub const fn from_bits(val: u8) -> Hstpipisr0IsopipesDtseq {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Hstpipisr0IsopipesDtseq {
#[inline(always)]
fn from(val: u8) -> Hstpipisr0IsopipesDtseq {
Hstpipisr0IsopipesDtseq::from_bits(val)
}
}
impl From<Hstpipisr0IsopipesDtseq> for u8 {
#[inline(always)]
fn from(val: Hstpipisr0IsopipesDtseq) -> u8 {
Hstpipisr0IsopipesDtseq::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Hstpipisr0IsopipesNbusybk {
#[doc = "0 busy bank (all banks free)"]
_0_BUSY = 0x0,
#[doc = "1 busy bank"]
_1_BUSY = 0x01,
#[doc = "2 busy banks"]
_2_BUSY = 0x02,
#[doc = "3 busy banks"]
_3_BUSY = 0x03,
}
impl Hstpipisr0IsopipesNbusybk {
#[inline(always)]
pub const fn from_bits(val: u8) -> Hstpipisr0IsopipesNbusybk {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Hstpipisr0IsopipesNbusybk {
#[inline(always)]
fn from(val: u8) -> Hstpipisr0IsopipesNbusybk {
Hstpipisr0IsopipesNbusybk::from_bits(val)
}
}
impl From<Hstpipisr0IsopipesNbusybk> for u8 {
#[inline(always)]
fn from(val: Hstpipisr0IsopipesNbusybk) -> u8 {
Hstpipisr0IsopipesNbusybk::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum HstpipisrCurrbk {
#[doc = "Current bank is bank0"]
BANK0 = 0x0,
#[doc = "Current bank is bank1"]
BANK1 = 0x01,
#[doc = "Current bank is bank2"]
BANK2 = 0x02,
_RESERVED_3 = 0x03,
}
impl HstpipisrCurrbk {
#[inline(always)]
pub const fn from_bits(val: u8) -> HstpipisrCurrbk {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for HstpipisrCurrbk {
#[inline(always)]
fn from(val: u8) -> HstpipisrCurrbk {
HstpipisrCurrbk::from_bits(val)
}
}
impl From<HstpipisrCurrbk> for u8 {
#[inline(always)]
fn from(val: HstpipisrCurrbk) -> u8 {
HstpipisrCurrbk::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum HstpipisrDtseq {
#[doc = "Data0 toggle sequence"]
DATA0 = 0x0,
#[doc = "Data1 toggle sequence"]
DATA1 = 0x01,
_RESERVED_2 = 0x02,
_RESERVED_3 = 0x03,
}
impl HstpipisrDtseq {
#[inline(always)]
pub const fn from_bits(val: u8) -> HstpipisrDtseq {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for HstpipisrDtseq {
#[inline(always)]
fn from(val: u8) -> HstpipisrDtseq {
HstpipisrDtseq::from_bits(val)
}
}
impl From<HstpipisrDtseq> for u8 {
#[inline(always)]
fn from(val: HstpipisrDtseq) -> u8 {
HstpipisrDtseq::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum HstpipisrNbusybk {
#[doc = "0 busy bank (all banks free)"]
_0_BUSY = 0x0,
#[doc = "1 busy bank"]
_1_BUSY = 0x01,
#[doc = "2 busy banks"]
_2_BUSY = 0x02,
#[doc = "3 busy banks"]
_3_BUSY = 0x03,
}
impl HstpipisrNbusybk {
#[inline(always)]
pub const fn from_bits(val: u8) -> HstpipisrNbusybk {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for HstpipisrNbusybk {
#[inline(always)]
fn from(val: u8) -> HstpipisrNbusybk {
HstpipisrNbusybk::from_bits(val)
}
}
impl From<HstpipisrNbusybk> for u8 {
#[inline(always)]
fn from(val: HstpipisrNbusybk) -> u8 {
HstpipisrNbusybk::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Nbtrans {
#[doc = "reserved to endpoint that does not have the high-bandwidth isochronous capability."]
_0_TRANS = 0x0,
#[doc = "default value: one transaction per micro-frame."]
_1_TRANS = 0x01,
#[doc = "2 transactions per micro-frame. This endpoint should be configured as double-bank."]
_2_TRANS = 0x02,
#[doc = "3 transactions per micro-frame. This endpoint should be configured as triple-bank."]
_3_TRANS = 0x03,
}
impl Nbtrans {
#[inline(always)]
pub const fn from_bits(val: u8) -> Nbtrans {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Nbtrans {
#[inline(always)]
fn from(val: u8) -> Nbtrans {
Nbtrans::from_bits(val)
}
}
impl From<Nbtrans> for u8 {
#[inline(always)]
fn from(val: Nbtrans) -> u8 {
Nbtrans::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Speed {
#[doc = "Full-Speed mode"]
FULL_SPEED = 0x0,
#[doc = "High-Speed mode"]
HIGH_SPEED = 0x01,
#[doc = "Low-Speed mode"]
LOW_SPEED = 0x02,
_RESERVED_3 = 0x03,
}
impl Speed {
#[inline(always)]
pub const fn from_bits(val: u8) -> Speed {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Speed {
#[inline(always)]
fn from(val: u8) -> Speed {
Speed::from_bits(val)
}
}
impl From<Speed> for u8 {
#[inline(always)]
fn from(val: Speed) -> u8 {
Speed::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Uide {
#[doc = "The USB mode (device/host) is selected from the UIMOD bit."]
UIMOD = 0x0,
#[doc = "The USB mode (device/host) is selected from the UOTGID input pin."]
UOTGID = 0x01,
}
impl Uide {
#[inline(always)]
pub const fn from_bits(val: u8) -> Uide {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Uide {
#[inline(always)]
fn from(val: u8) -> Uide {
Uide::from_bits(val)
}
}
impl From<Uide> for u8 {
#[inline(always)]
fn from(val: Uide) -> u8 {
Uide::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Uimod {
#[doc = "The module is in USB host mode."]
HOST = 0x0,
#[doc = "The module is in USB device mode."]
DEVICE = 0x01,
}
impl Uimod {
#[inline(always)]
pub const fn from_bits(val: u8) -> Uimod {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for Uimod {
#[inline(always)]
fn from(val: u8) -> Uimod {
Uimod::from_bits(val)
}
}
impl From<Uimod> for u8 {
#[inline(always)]
fn from(val: Uimod) -> u8 {
Uimod::to_bits(val)
}
}