#[doc = "Register `C2SR` reader"]
pub struct R(crate::R<C2SR_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<C2SR_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<C2SR_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<C2SR_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `C2SR` writer"]
pub struct W(crate::W<C2SR_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<C2SR_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<C2SR_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<C2SR_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `EOP` reader - End of operation"]
pub struct EOP_R(crate::FieldReader<bool, bool>);
impl EOP_R {
pub(crate) fn new(bits: bool) -> Self {
EOP_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for EOP_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `EOP` writer - End of operation"]
pub struct EOP_W<'a> {
w: &'a mut W,
}
impl<'a> EOP_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01);
self.w
}
}
#[doc = "Field `OPERR` reader - Operation error"]
pub struct OPERR_R(crate::FieldReader<bool, bool>);
impl OPERR_R {
pub(crate) fn new(bits: bool) -> Self {
OPERR_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for OPERR_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `OPERR` writer - Operation error"]
pub struct OPERR_W<'a> {
w: &'a mut W,
}
impl<'a> OPERR_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1);
self.w
}
}
#[doc = "Field `PROGERR` reader - Programming error"]
pub struct PROGERR_R(crate::FieldReader<bool, bool>);
impl PROGERR_R {
pub(crate) fn new(bits: bool) -> Self {
PROGERR_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for PROGERR_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `PROGERR` writer - Programming error"]
pub struct PROGERR_W<'a> {
w: &'a mut W,
}
impl<'a> PROGERR_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3);
self.w
}
}
#[doc = "Field `WRPERR` reader - write protection error"]
pub struct WRPERR_R(crate::FieldReader<bool, bool>);
impl WRPERR_R {
pub(crate) fn new(bits: bool) -> Self {
WRPERR_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for WRPERR_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `WRPERR` writer - write protection error"]
pub struct WRPERR_W<'a> {
w: &'a mut W,
}
impl<'a> WRPERR_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4);
self.w
}
}
#[doc = "Field `PGAERR` reader - Programming alignment error"]
pub struct PGAERR_R(crate::FieldReader<bool, bool>);
impl PGAERR_R {
pub(crate) fn new(bits: bool) -> Self {
PGAERR_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for PGAERR_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `PGAERR` writer - Programming alignment error"]
pub struct PGAERR_W<'a> {
w: &'a mut W,
}
impl<'a> PGAERR_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5);
self.w
}
}
#[doc = "Field `SIZERR` reader - Size error"]
pub struct SIZERR_R(crate::FieldReader<bool, bool>);
impl SIZERR_R {
pub(crate) fn new(bits: bool) -> Self {
SIZERR_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for SIZERR_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `SIZERR` writer - Size error"]
pub struct SIZERR_W<'a> {
w: &'a mut W,
}
impl<'a> SIZERR_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6);
self.w
}
}
#[doc = "Field `PGSERR` reader - Programming sequence error"]
pub struct PGSERR_R(crate::FieldReader<bool, bool>);
impl PGSERR_R {
pub(crate) fn new(bits: bool) -> Self {
PGSERR_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for PGSERR_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `PGSERR` writer - Programming sequence error"]
pub struct PGSERR_W<'a> {
w: &'a mut W,
}
impl<'a> PGSERR_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7);
self.w
}
}
#[doc = "Field `MISSERR` reader - Fast programming data miss error"]
pub struct MISSERR_R(crate::FieldReader<bool, bool>);
impl MISSERR_R {
pub(crate) fn new(bits: bool) -> Self {
MISSERR_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for MISSERR_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `MISSERR` writer - Fast programming data miss error"]
pub struct MISSERR_W<'a> {
w: &'a mut W,
}
impl<'a> MISSERR_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8);
self.w
}
}
#[doc = "Field `FASTERR` reader - Fast programming error"]
pub struct FASTERR_R(crate::FieldReader<bool, bool>);
impl FASTERR_R {
pub(crate) fn new(bits: bool) -> Self {
FASTERR_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for FASTERR_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `FASTERR` writer - Fast programming error"]
pub struct FASTERR_W<'a> {
w: &'a mut W,
}
impl<'a> FASTERR_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9);
self.w
}
}
#[doc = "Field `RDERR` reader - PCROP read error"]
pub struct RDERR_R(crate::FieldReader<bool, bool>);
impl RDERR_R {
pub(crate) fn new(bits: bool) -> Self {
RDERR_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for RDERR_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `RDERR` writer - PCROP read error"]
pub struct RDERR_W<'a> {
w: &'a mut W,
}
impl<'a> RDERR_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14);
self.w
}
}
#[doc = "Field `BSY` reader - Busy"]
pub struct BSY_R(crate::FieldReader<bool, bool>);
impl BSY_R {
pub(crate) fn new(bits: bool) -> Self {
BSY_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for BSY_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `BSY` writer - Busy"]
pub struct BSY_W<'a> {
w: &'a mut W,
}
impl<'a> BSY_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16);
self.w
}
}
#[doc = "Field `CFGBSY` reader - Programming or erase configuration busy"]
pub struct CFGBSY_R(crate::FieldReader<bool, bool>);
impl CFGBSY_R {
pub(crate) fn new(bits: bool) -> Self {
CFGBSY_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for CFGBSY_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `CFGBSY` writer - Programming or erase configuration busy"]
pub struct CFGBSY_W<'a> {
w: &'a mut W,
}
impl<'a> CFGBSY_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18);
self.w
}
}
#[doc = "Field `PESD` reader - Programming or erase operation suspended"]
pub struct PESD_R(crate::FieldReader<bool, bool>);
impl PESD_R {
pub(crate) fn new(bits: bool) -> Self {
PESD_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for PESD_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `PESD` writer - Programming or erase operation suspended"]
pub struct PESD_W<'a> {
w: &'a mut W,
}
impl<'a> PESD_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19);
self.w
}
}
impl R {
#[doc = "Bit 0 - End of operation"]
#[inline(always)]
pub fn eop(&self) -> EOP_R {
EOP_R::new((self.bits & 0x01) != 0)
}
#[doc = "Bit 1 - Operation error"]
#[inline(always)]
pub fn operr(&self) -> OPERR_R {
OPERR_R::new(((self.bits >> 1) & 0x01) != 0)
}
#[doc = "Bit 3 - Programming error"]
#[inline(always)]
pub fn progerr(&self) -> PROGERR_R {
PROGERR_R::new(((self.bits >> 3) & 0x01) != 0)
}
#[doc = "Bit 4 - write protection error"]
#[inline(always)]
pub fn wrperr(&self) -> WRPERR_R {
WRPERR_R::new(((self.bits >> 4) & 0x01) != 0)
}
#[doc = "Bit 5 - Programming alignment error"]
#[inline(always)]
pub fn pgaerr(&self) -> PGAERR_R {
PGAERR_R::new(((self.bits >> 5) & 0x01) != 0)
}
#[doc = "Bit 6 - Size error"]
#[inline(always)]
pub fn sizerr(&self) -> SIZERR_R {
SIZERR_R::new(((self.bits >> 6) & 0x01) != 0)
}
#[doc = "Bit 7 - Programming sequence error"]
#[inline(always)]
pub fn pgserr(&self) -> PGSERR_R {
PGSERR_R::new(((self.bits >> 7) & 0x01) != 0)
}
#[doc = "Bit 8 - Fast programming data miss error"]
#[inline(always)]
pub fn misserr(&self) -> MISSERR_R {
MISSERR_R::new(((self.bits >> 8) & 0x01) != 0)
}
#[doc = "Bit 9 - Fast programming error"]
#[inline(always)]
pub fn fasterr(&self) -> FASTERR_R {
FASTERR_R::new(((self.bits >> 9) & 0x01) != 0)
}
#[doc = "Bit 14 - PCROP read error"]
#[inline(always)]
pub fn rderr(&self) -> RDERR_R {
RDERR_R::new(((self.bits >> 14) & 0x01) != 0)
}
#[doc = "Bit 16 - Busy"]
#[inline(always)]
pub fn bsy(&self) -> BSY_R {
BSY_R::new(((self.bits >> 16) & 0x01) != 0)
}
#[doc = "Bit 18 - Programming or erase configuration busy"]
#[inline(always)]
pub fn cfgbsy(&self) -> CFGBSY_R {
CFGBSY_R::new(((self.bits >> 18) & 0x01) != 0)
}
#[doc = "Bit 19 - Programming or erase operation suspended"]
#[inline(always)]
pub fn pesd(&self) -> PESD_R {
PESD_R::new(((self.bits >> 19) & 0x01) != 0)
}
}
impl W {
#[doc = "Bit 0 - End of operation"]
#[inline(always)]
pub fn eop(&mut self) -> EOP_W {
EOP_W { w: self }
}
#[doc = "Bit 1 - Operation error"]
#[inline(always)]
pub fn operr(&mut self) -> OPERR_W {
OPERR_W { w: self }
}
#[doc = "Bit 3 - Programming error"]
#[inline(always)]
pub fn progerr(&mut self) -> PROGERR_W {
PROGERR_W { w: self }
}
#[doc = "Bit 4 - write protection error"]
#[inline(always)]
pub fn wrperr(&mut self) -> WRPERR_W {
WRPERR_W { w: self }
}
#[doc = "Bit 5 - Programming alignment error"]
#[inline(always)]
pub fn pgaerr(&mut self) -> PGAERR_W {
PGAERR_W { w: self }
}
#[doc = "Bit 6 - Size error"]
#[inline(always)]
pub fn sizerr(&mut self) -> SIZERR_W {
SIZERR_W { w: self }
}
#[doc = "Bit 7 - Programming sequence error"]
#[inline(always)]
pub fn pgserr(&mut self) -> PGSERR_W {
PGSERR_W { w: self }
}
#[doc = "Bit 8 - Fast programming data miss error"]
#[inline(always)]
pub fn misserr(&mut self) -> MISSERR_W {
MISSERR_W { w: self }
}
#[doc = "Bit 9 - Fast programming error"]
#[inline(always)]
pub fn fasterr(&mut self) -> FASTERR_W {
FASTERR_W { w: self }
}
#[doc = "Bit 14 - PCROP read error"]
#[inline(always)]
pub fn rderr(&mut self) -> RDERR_W {
RDERR_W { w: self }
}
#[doc = "Bit 16 - Busy"]
#[inline(always)]
pub fn bsy(&mut self) -> BSY_W {
BSY_W { w: self }
}
#[doc = "Bit 18 - Programming or erase configuration busy"]
#[inline(always)]
pub fn cfgbsy(&mut self) -> CFGBSY_W {
CFGBSY_W { w: self }
}
#[doc = "Bit 19 - Programming or erase operation suspended"]
#[inline(always)]
pub fn pesd(&mut self) -> PESD_W {
PESD_W { w: self }
}
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "CPU2 cortex M0 status register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [c2sr](index.html) module"]
pub struct C2SR_SPEC;
impl crate::RegisterSpec for C2SR_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [c2sr::R](R) reader structure"]
impl crate::Readable for C2SR_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [c2sr::W](W) writer structure"]
impl crate::Writable for C2SR_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets C2SR to value 0"]
impl crate::Resettable for C2SR_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}