pub type R = crate::R<ISTRrs>;
pub type W = crate::W<ISTRrs>;
pub type EP_ID_R = crate::FieldReader;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DIR {
To = 0,
From = 1,
}
impl From<DIR> for bool {
#[inline(always)]
fn from(variant: DIR) -> Self {
variant as u8 != 0
}
}
pub type DIR_R = crate::BitReader<DIR>;
impl DIR_R {
#[inline(always)]
pub const fn variant(&self) -> DIR {
match self.bits {
false => DIR::To,
true => DIR::From,
}
}
#[inline(always)]
pub fn is_to(&self) -> bool {
*self == DIR::To
}
#[inline(always)]
pub fn is_from(&self) -> bool {
*self == DIR::From
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ESOFR {
NotExpectedStartOfFrame = 0,
ExpectedStartOfFrame = 1,
}
impl From<ESOFR> for bool {
#[inline(always)]
fn from(variant: ESOFR) -> Self {
variant as u8 != 0
}
}
pub type ESOF_R = crate::BitReader<ESOFR>;
impl ESOF_R {
#[inline(always)]
pub const fn variant(&self) -> ESOFR {
match self.bits {
false => ESOFR::NotExpectedStartOfFrame,
true => ESOFR::ExpectedStartOfFrame,
}
}
#[inline(always)]
pub fn is_not_expected_start_of_frame(&self) -> bool {
*self == ESOFR::NotExpectedStartOfFrame
}
#[inline(always)]
pub fn is_expected_start_of_frame(&self) -> bool {
*self == ESOFR::ExpectedStartOfFrame
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ESOFW {
Clear = 0,
}
impl From<ESOFW> for bool {
#[inline(always)]
fn from(variant: ESOFW) -> Self {
variant as u8 != 0
}
}
pub type ESOF_W<'a, REG> = crate::BitWriter0C<'a, REG, ESOFW>;
impl<'a, REG> ESOF_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(ESOFW::Clear)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SOFR {
NotStartOfFrame = 0,
StartOfFrame = 1,
}
impl From<SOFR> for bool {
#[inline(always)]
fn from(variant: SOFR) -> Self {
variant as u8 != 0
}
}
pub type SOF_R = crate::BitReader<SOFR>;
impl SOF_R {
#[inline(always)]
pub const fn variant(&self) -> SOFR {
match self.bits {
false => SOFR::NotStartOfFrame,
true => SOFR::StartOfFrame,
}
}
#[inline(always)]
pub fn is_not_start_of_frame(&self) -> bool {
*self == SOFR::NotStartOfFrame
}
#[inline(always)]
pub fn is_start_of_frame(&self) -> bool {
*self == SOFR::StartOfFrame
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SOFW {
Clear = 0,
}
impl From<SOFW> for bool {
#[inline(always)]
fn from(variant: SOFW) -> Self {
variant as u8 != 0
}
}
pub type SOF_W<'a, REG> = crate::BitWriter0C<'a, REG, SOFW>;
impl<'a, REG> SOF_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(SOFW::Clear)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RESETR {
NotReset = 0,
Reset = 1,
}
impl From<RESETR> for bool {
#[inline(always)]
fn from(variant: RESETR) -> Self {
variant as u8 != 0
}
}
pub type RESET_R = crate::BitReader<RESETR>;
impl RESET_R {
#[inline(always)]
pub const fn variant(&self) -> RESETR {
match self.bits {
false => RESETR::NotReset,
true => RESETR::Reset,
}
}
#[inline(always)]
pub fn is_not_reset(&self) -> bool {
*self == RESETR::NotReset
}
#[inline(always)]
pub fn is_reset(&self) -> bool {
*self == RESETR::Reset
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RESETW {
Clear = 0,
}
impl From<RESETW> for bool {
#[inline(always)]
fn from(variant: RESETW) -> Self {
variant as u8 != 0
}
}
pub type RESET_W<'a, REG> = crate::BitWriter0C<'a, REG, RESETW>;
impl<'a, REG> RESET_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(RESETW::Clear)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SUSPR {
NotSuspend = 0,
Suspend = 1,
}
impl From<SUSPR> for bool {
#[inline(always)]
fn from(variant: SUSPR) -> Self {
variant as u8 != 0
}
}
pub type SUSP_R = crate::BitReader<SUSPR>;
impl SUSP_R {
#[inline(always)]
pub const fn variant(&self) -> SUSPR {
match self.bits {
false => SUSPR::NotSuspend,
true => SUSPR::Suspend,
}
}
#[inline(always)]
pub fn is_not_suspend(&self) -> bool {
*self == SUSPR::NotSuspend
}
#[inline(always)]
pub fn is_suspend(&self) -> bool {
*self == SUSPR::Suspend
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SUSPW {
Clear = 0,
}
impl From<SUSPW> for bool {
#[inline(always)]
fn from(variant: SUSPW) -> Self {
variant as u8 != 0
}
}
pub type SUSP_W<'a, REG> = crate::BitWriter0C<'a, REG, SUSPW>;
impl<'a, REG> SUSP_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(SUSPW::Clear)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum WKUPR {
NotWakeup = 0,
Wakeup = 1,
}
impl From<WKUPR> for bool {
#[inline(always)]
fn from(variant: WKUPR) -> Self {
variant as u8 != 0
}
}
pub type WKUP_R = crate::BitReader<WKUPR>;
impl WKUP_R {
#[inline(always)]
pub const fn variant(&self) -> WKUPR {
match self.bits {
false => WKUPR::NotWakeup,
true => WKUPR::Wakeup,
}
}
#[inline(always)]
pub fn is_not_wakeup(&self) -> bool {
*self == WKUPR::NotWakeup
}
#[inline(always)]
pub fn is_wakeup(&self) -> bool {
*self == WKUPR::Wakeup
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum WKUPW {
Clear = 0,
}
impl From<WKUPW> for bool {
#[inline(always)]
fn from(variant: WKUPW) -> Self {
variant as u8 != 0
}
}
pub type WKUP_W<'a, REG> = crate::BitWriter0C<'a, REG, WKUPW>;
impl<'a, REG> WKUP_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(WKUPW::Clear)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ERRR {
NotOverrun = 0,
Error = 1,
}
impl From<ERRR> for bool {
#[inline(always)]
fn from(variant: ERRR) -> Self {
variant as u8 != 0
}
}
pub type ERR_R = crate::BitReader<ERRR>;
impl ERR_R {
#[inline(always)]
pub const fn variant(&self) -> ERRR {
match self.bits {
false => ERRR::NotOverrun,
true => ERRR::Error,
}
}
#[inline(always)]
pub fn is_not_overrun(&self) -> bool {
*self == ERRR::NotOverrun
}
#[inline(always)]
pub fn is_error(&self) -> bool {
*self == ERRR::Error
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ERRW {
Clear = 0,
}
impl From<ERRW> for bool {
#[inline(always)]
fn from(variant: ERRW) -> Self {
variant as u8 != 0
}
}
pub type ERR_W<'a, REG> = crate::BitWriter0C<'a, REG, ERRW>;
impl<'a, REG> ERR_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(ERRW::Clear)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PMAOVRR {
NotOverrun = 0,
Overrun = 1,
}
impl From<PMAOVRR> for bool {
#[inline(always)]
fn from(variant: PMAOVRR) -> Self {
variant as u8 != 0
}
}
pub type PMAOVR_R = crate::BitReader<PMAOVRR>;
impl PMAOVR_R {
#[inline(always)]
pub const fn variant(&self) -> PMAOVRR {
match self.bits {
false => PMAOVRR::NotOverrun,
true => PMAOVRR::Overrun,
}
}
#[inline(always)]
pub fn is_not_overrun(&self) -> bool {
*self == PMAOVRR::NotOverrun
}
#[inline(always)]
pub fn is_overrun(&self) -> bool {
*self == PMAOVRR::Overrun
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PMAOVRW {
Clear = 0,
}
impl From<PMAOVRW> for bool {
#[inline(always)]
fn from(variant: PMAOVRW) -> Self {
variant as u8 != 0
}
}
pub type PMAOVR_W<'a, REG> = crate::BitWriter0C<'a, REG, PMAOVRW>;
impl<'a, REG> PMAOVR_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(PMAOVRW::Clear)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CTR {
Completed = 1,
}
impl From<CTR> for bool {
#[inline(always)]
fn from(variant: CTR) -> Self {
variant as u8 != 0
}
}
pub type CTR_R = crate::BitReader<CTR>;
impl CTR_R {
#[inline(always)]
pub const fn variant(&self) -> Option<CTR> {
match self.bits {
true => Some(CTR::Completed),
_ => None,
}
}
#[inline(always)]
pub fn is_completed(&self) -> bool {
*self == CTR::Completed
}
}
impl R {
#[inline(always)]
pub fn ep_id(&self) -> EP_ID_R {
EP_ID_R::new((self.bits & 0x0f) as u8)
}
#[inline(always)]
pub fn dir(&self) -> DIR_R {
DIR_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn esof(&self) -> ESOF_R {
ESOF_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn sof(&self) -> SOF_R {
SOF_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn reset(&self) -> RESET_R {
RESET_R::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn susp(&self) -> SUSP_R {
SUSP_R::new(((self.bits >> 11) & 1) != 0)
}
#[inline(always)]
pub fn wkup(&self) -> WKUP_R {
WKUP_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn err(&self) -> ERR_R {
ERR_R::new(((self.bits >> 13) & 1) != 0)
}
#[inline(always)]
pub fn pmaovr(&self) -> PMAOVR_R {
PMAOVR_R::new(((self.bits >> 14) & 1) != 0)
}
#[inline(always)]
pub fn ctr(&self) -> CTR_R {
CTR_R::new(((self.bits >> 15) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("ISTR")
.field("ep_id", &self.ep_id())
.field("dir", &self.dir())
.field("esof", &self.esof())
.field("sof", &self.sof())
.field("reset", &self.reset())
.field("susp", &self.susp())
.field("wkup", &self.wkup())
.field("err", &self.err())
.field("pmaovr", &self.pmaovr())
.field("ctr", &self.ctr())
.finish()
}
}
impl W {
#[inline(always)]
pub fn esof(&mut self) -> ESOF_W<ISTRrs> {
ESOF_W::new(self, 8)
}
#[inline(always)]
pub fn sof(&mut self) -> SOF_W<ISTRrs> {
SOF_W::new(self, 9)
}
#[inline(always)]
pub fn reset(&mut self) -> RESET_W<ISTRrs> {
RESET_W::new(self, 10)
}
#[inline(always)]
pub fn susp(&mut self) -> SUSP_W<ISTRrs> {
SUSP_W::new(self, 11)
}
#[inline(always)]
pub fn wkup(&mut self) -> WKUP_W<ISTRrs> {
WKUP_W::new(self, 12)
}
#[inline(always)]
pub fn err(&mut self) -> ERR_W<ISTRrs> {
ERR_W::new(self, 13)
}
#[inline(always)]
pub fn pmaovr(&mut self) -> PMAOVR_W<ISTRrs> {
PMAOVR_W::new(self, 14)
}
}
pub struct ISTRrs;
impl crate::RegisterSpec for ISTRrs {
type Ux = u32;
}
impl crate::Readable for ISTRrs {}
impl crate::Writable for ISTRrs {
type Safety = crate::Unsafe;
const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0x7f00;
}
impl crate::Resettable for ISTRrs {}