pub type R = crate::R<SRrs>;
pub type W = crate::W<SRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum BSY {
Inactive = 0,
Active = 1,
}
impl From<BSY> for bool {
#[inline(always)]
fn from(variant: BSY) -> Self {
variant as u8 != 0
}
}
pub type BSY_R = crate::BitReader<BSY>;
impl BSY_R {
#[inline(always)]
pub const fn variant(&self) -> BSY {
match self.bits {
false => BSY::Inactive,
true => BSY::Active,
}
}
#[inline(always)]
pub fn is_inactive(&self) -> bool {
*self == BSY::Inactive
}
#[inline(always)]
pub fn is_active(&self) -> bool {
*self == BSY::Active
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum EOP {
NoEvent = 0,
Event = 1,
}
impl From<EOP> for bool {
#[inline(always)]
fn from(variant: EOP) -> Self {
variant as u8 != 0
}
}
pub type EOP_R = crate::BitReader<EOP>;
impl EOP_R {
#[inline(always)]
pub const fn variant(&self) -> EOP {
match self.bits {
false => EOP::NoEvent,
true => EOP::Event,
}
}
#[inline(always)]
pub fn is_no_event(&self) -> bool {
*self == EOP::NoEvent
}
#[inline(always)]
pub fn is_event(&self) -> bool {
*self == EOP::Event
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ENDHV {
Active = 0,
Inactive = 1,
}
impl From<ENDHV> for bool {
#[inline(always)]
fn from(variant: ENDHV) -> Self {
variant as u8 != 0
}
}
pub type ENDHV_R = crate::BitReader<ENDHV>;
impl ENDHV_R {
#[inline(always)]
pub const fn variant(&self) -> ENDHV {
match self.bits {
false => ENDHV::Active,
true => ENDHV::Inactive,
}
}
#[inline(always)]
pub fn is_active(&self) -> bool {
*self == ENDHV::Active
}
#[inline(always)]
pub fn is_inactive(&self) -> bool {
*self == ENDHV::Inactive
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum READY {
NotReady = 0,
Ready = 1,
}
impl From<READY> for bool {
#[inline(always)]
fn from(variant: READY) -> Self {
variant as u8 != 0
}
}
pub type READY_R = crate::BitReader<READY>;
impl READY_R {
#[inline(always)]
pub const fn variant(&self) -> READY {
match self.bits {
false => READY::NotReady,
true => READY::Ready,
}
}
#[inline(always)]
pub fn is_not_ready(&self) -> bool {
*self == READY::NotReady
}
#[inline(always)]
pub fn is_ready(&self) -> bool {
*self == READY::Ready
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum WRPERRR {
NoError = 0,
Error = 1,
}
impl From<WRPERRR> for bool {
#[inline(always)]
fn from(variant: WRPERRR) -> Self {
variant as u8 != 0
}
}
pub type WRPERR_R = crate::BitReader<WRPERRR>;
impl WRPERR_R {
#[inline(always)]
pub const fn variant(&self) -> WRPERRR {
match self.bits {
false => WRPERRR::NoError,
true => WRPERRR::Error,
}
}
#[inline(always)]
pub fn is_no_error(&self) -> bool {
*self == WRPERRR::NoError
}
#[inline(always)]
pub fn is_error(&self) -> bool {
*self == WRPERRR::Error
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum WRPERRW {
Clear = 1,
}
impl From<WRPERRW> for bool {
#[inline(always)]
fn from(variant: WRPERRW) -> Self {
variant as u8 != 0
}
}
pub type WRPERR_W<'a, REG> = crate::BitWriter<'a, REG, WRPERRW>;
impl<'a, REG> WRPERR_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(WRPERRW::Clear)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PGAERRR {
NoError = 0,
Error = 1,
}
impl From<PGAERRR> for bool {
#[inline(always)]
fn from(variant: PGAERRR) -> Self {
variant as u8 != 0
}
}
pub type PGAERR_R = crate::BitReader<PGAERRR>;
impl PGAERR_R {
#[inline(always)]
pub const fn variant(&self) -> PGAERRR {
match self.bits {
false => PGAERRR::NoError,
true => PGAERRR::Error,
}
}
#[inline(always)]
pub fn is_no_error(&self) -> bool {
*self == PGAERRR::NoError
}
#[inline(always)]
pub fn is_error(&self) -> bool {
*self == PGAERRR::Error
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PGAERRW {
Clear = 1,
}
impl From<PGAERRW> for bool {
#[inline(always)]
fn from(variant: PGAERRW) -> Self {
variant as u8 != 0
}
}
pub type PGAERR_W<'a, REG> = crate::BitWriter<'a, REG, PGAERRW>;
impl<'a, REG> PGAERR_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(PGAERRW::Clear)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SIZERRR {
NoError = 0,
Error = 1,
}
impl From<SIZERRR> for bool {
#[inline(always)]
fn from(variant: SIZERRR) -> Self {
variant as u8 != 0
}
}
pub type SIZERR_R = crate::BitReader<SIZERRR>;
impl SIZERR_R {
#[inline(always)]
pub const fn variant(&self) -> SIZERRR {
match self.bits {
false => SIZERRR::NoError,
true => SIZERRR::Error,
}
}
#[inline(always)]
pub fn is_no_error(&self) -> bool {
*self == SIZERRR::NoError
}
#[inline(always)]
pub fn is_error(&self) -> bool {
*self == SIZERRR::Error
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SIZERRW {
Clear = 1,
}
impl From<SIZERRW> for bool {
#[inline(always)]
fn from(variant: SIZERRW) -> Self {
variant as u8 != 0
}
}
pub type SIZERR_W<'a, REG> = crate::BitWriter<'a, REG, SIZERRW>;
impl<'a, REG> SIZERR_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(SIZERRW::Clear)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum OPTVERRR {
NoError = 0,
Error = 1,
}
impl From<OPTVERRR> for bool {
#[inline(always)]
fn from(variant: OPTVERRR) -> Self {
variant as u8 != 0
}
}
pub type OPTVERR_R = crate::BitReader<OPTVERRR>;
impl OPTVERR_R {
#[inline(always)]
pub const fn variant(&self) -> OPTVERRR {
match self.bits {
false => OPTVERRR::NoError,
true => OPTVERRR::Error,
}
}
#[inline(always)]
pub fn is_no_error(&self) -> bool {
*self == OPTVERRR::NoError
}
#[inline(always)]
pub fn is_error(&self) -> bool {
*self == OPTVERRR::Error
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum OPTVERRW {
Clear = 1,
}
impl From<OPTVERRW> for bool {
#[inline(always)]
fn from(variant: OPTVERRW) -> Self {
variant as u8 != 0
}
}
pub type OPTVERR_W<'a, REG> = crate::BitWriter<'a, REG, OPTVERRW>;
impl<'a, REG> OPTVERR_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(OPTVERRW::Clear)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RDERRR {
NoError = 0,
Error = 1,
}
impl From<RDERRR> for bool {
#[inline(always)]
fn from(variant: RDERRR) -> Self {
variant as u8 != 0
}
}
pub type RDERR_R = crate::BitReader<RDERRR>;
impl RDERR_R {
#[inline(always)]
pub const fn variant(&self) -> RDERRR {
match self.bits {
false => RDERRR::NoError,
true => RDERRR::Error,
}
}
#[inline(always)]
pub fn is_no_error(&self) -> bool {
*self == RDERRR::NoError
}
#[inline(always)]
pub fn is_error(&self) -> bool {
*self == RDERRR::Error
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RDERRW {
Clear = 1,
}
impl From<RDERRW> for bool {
#[inline(always)]
fn from(variant: RDERRW) -> Self {
variant as u8 != 0
}
}
pub type RDERR_W<'a, REG> = crate::BitWriter<'a, REG, RDERRW>;
impl<'a, REG> RDERR_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(RDERRW::Clear)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum NOTZEROERRR {
NoEvent = 0,
Event = 1,
}
impl From<NOTZEROERRR> for bool {
#[inline(always)]
fn from(variant: NOTZEROERRR) -> Self {
variant as u8 != 0
}
}
pub type NOTZEROERR_R = crate::BitReader<NOTZEROERRR>;
impl NOTZEROERR_R {
#[inline(always)]
pub const fn variant(&self) -> NOTZEROERRR {
match self.bits {
false => NOTZEROERRR::NoEvent,
true => NOTZEROERRR::Event,
}
}
#[inline(always)]
pub fn is_no_event(&self) -> bool {
*self == NOTZEROERRR::NoEvent
}
#[inline(always)]
pub fn is_event(&self) -> bool {
*self == NOTZEROERRR::Event
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum NOTZEROERRW {
Clear = 1,
}
impl From<NOTZEROERRW> for bool {
#[inline(always)]
fn from(variant: NOTZEROERRW) -> Self {
variant as u8 != 0
}
}
pub type NOTZEROERR_W<'a, REG> = crate::BitWriter<'a, REG, NOTZEROERRW>;
impl<'a, REG> NOTZEROERR_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(NOTZEROERRW::Clear)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FWWERRR {
NoError = 0,
Error = 1,
}
impl From<FWWERRR> for bool {
#[inline(always)]
fn from(variant: FWWERRR) -> Self {
variant as u8 != 0
}
}
pub type FWWERR_R = crate::BitReader<FWWERRR>;
impl FWWERR_R {
#[inline(always)]
pub const fn variant(&self) -> FWWERRR {
match self.bits {
false => FWWERRR::NoError,
true => FWWERRR::Error,
}
}
#[inline(always)]
pub fn is_no_error(&self) -> bool {
*self == FWWERRR::NoError
}
#[inline(always)]
pub fn is_error(&self) -> bool {
*self == FWWERRR::Error
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FWWERRW {
Clear = 1,
}
impl From<FWWERRW> for bool {
#[inline(always)]
fn from(variant: FWWERRW) -> Self {
variant as u8 != 0
}
}
pub type FWWERR_W<'a, REG> = crate::BitWriter<'a, REG, FWWERRW>;
impl<'a, REG> FWWERR_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(FWWERRW::Clear)
}
}
impl R {
#[inline(always)]
pub fn bsy(&self) -> BSY_R {
BSY_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn eop(&self) -> EOP_R {
EOP_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn endhv(&self) -> ENDHV_R {
ENDHV_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn ready(&self) -> READY_R {
READY_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn wrperr(&self) -> WRPERR_R {
WRPERR_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn pgaerr(&self) -> PGAERR_R {
PGAERR_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn sizerr(&self) -> SIZERR_R {
SIZERR_R::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn optverr(&self) -> OPTVERR_R {
OPTVERR_R::new(((self.bits >> 11) & 1) != 0)
}
#[inline(always)]
pub fn rderr(&self) -> RDERR_R {
RDERR_R::new(((self.bits >> 13) & 1) != 0)
}
#[inline(always)]
pub fn notzeroerr(&self) -> NOTZEROERR_R {
NOTZEROERR_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn fwwerr(&self) -> FWWERR_R {
FWWERR_R::new(((self.bits >> 17) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("SR")
.field("bsy", &self.bsy())
.field("eop", &self.eop())
.field("endhv", &self.endhv())
.field("ready", &self.ready())
.field("wrperr", &self.wrperr())
.field("pgaerr", &self.pgaerr())
.field("sizerr", &self.sizerr())
.field("optverr", &self.optverr())
.field("rderr", &self.rderr())
.field("notzeroerr", &self.notzeroerr())
.field("fwwerr", &self.fwwerr())
.finish()
}
}
impl W {
#[inline(always)]
pub fn wrperr(&mut self) -> WRPERR_W<SRrs> {
WRPERR_W::new(self, 8)
}
#[inline(always)]
pub fn pgaerr(&mut self) -> PGAERR_W<SRrs> {
PGAERR_W::new(self, 9)
}
#[inline(always)]
pub fn sizerr(&mut self) -> SIZERR_W<SRrs> {
SIZERR_W::new(self, 10)
}
#[inline(always)]
pub fn optverr(&mut self) -> OPTVERR_W<SRrs> {
OPTVERR_W::new(self, 11)
}
#[inline(always)]
pub fn rderr(&mut self) -> RDERR_W<SRrs> {
RDERR_W::new(self, 13)
}
#[inline(always)]
pub fn notzeroerr(&mut self) -> NOTZEROERR_W<SRrs> {
NOTZEROERR_W::new(self, 16)
}
#[inline(always)]
pub fn fwwerr(&mut self) -> FWWERR_W<SRrs> {
FWWERR_W::new(self, 17)
}
}
pub struct SRrs;
impl crate::RegisterSpec for SRrs {
type Ux = u32;
}
impl crate::Readable for SRrs {}
impl crate::Writable for SRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for SRrs {
const RESET_VALUE: u32 = 0x04;
}