#[doc = "Reader of register CMD"]
pub type R = crate::R<u32, super::CMD>;
#[doc = "Writer for register CMD"]
pub type W = crate::W<u32, super::CMD>;
#[doc = "Register CMD `reset()`'s with value 0"]
impl crate::ResetValue for super::CMD {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
#[doc = "Reader of field `FLASH_READ`"]
pub type FLASH_READ_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `FLASH_READ`"]
pub struct FLASH_READ_W<'a> {
w: &'a mut W,
}
impl<'a> FLASH_READ_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 << 31)) | (((value as u32) & 0x01) << 31);
self.w
}
}
#[doc = "Reader of field `FLASH_WREN`"]
pub type FLASH_WREN_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `FLASH_WREN`"]
pub struct FLASH_WREN_W<'a> {
w: &'a mut W,
}
impl<'a> FLASH_WREN_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 << 30)) | (((value as u32) & 0x01) << 30);
self.w
}
}
#[doc = "Reader of field `FLASH_WRDI`"]
pub type FLASH_WRDI_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `FLASH_WRDI`"]
pub struct FLASH_WRDI_W<'a> {
w: &'a mut W,
}
impl<'a> FLASH_WRDI_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 << 29)) | (((value as u32) & 0x01) << 29);
self.w
}
}
#[doc = "Reader of field `FLASH_RDID`"]
pub type FLASH_RDID_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `FLASH_RDID`"]
pub struct FLASH_RDID_W<'a> {
w: &'a mut W,
}
impl<'a> FLASH_RDID_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 << 28)) | (((value as u32) & 0x01) << 28);
self.w
}
}
#[doc = "Reader of field `FLASH_RDSR`"]
pub type FLASH_RDSR_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `FLASH_RDSR`"]
pub struct FLASH_RDSR_W<'a> {
w: &'a mut W,
}
impl<'a> FLASH_RDSR_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 << 27)) | (((value as u32) & 0x01) << 27);
self.w
}
}
#[doc = "Reader of field `FLASH_WRSR`"]
pub type FLASH_WRSR_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `FLASH_WRSR`"]
pub struct FLASH_WRSR_W<'a> {
w: &'a mut W,
}
impl<'a> FLASH_WRSR_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 << 26)) | (((value as u32) & 0x01) << 26);
self.w
}
}
#[doc = "Reader of field `FLASH_PP`"]
pub type FLASH_PP_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `FLASH_PP`"]
pub struct FLASH_PP_W<'a> {
w: &'a mut W,
}
impl<'a> FLASH_PP_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 << 25)) | (((value as u32) & 0x01) << 25);
self.w
}
}
#[doc = "Reader of field `FLASH_SE`"]
pub type FLASH_SE_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `FLASH_SE`"]
pub struct FLASH_SE_W<'a> {
w: &'a mut W,
}
impl<'a> FLASH_SE_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 << 24)) | (((value as u32) & 0x01) << 24);
self.w
}
}
#[doc = "Reader of field `FLASH_BE`"]
pub type FLASH_BE_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `FLASH_BE`"]
pub struct FLASH_BE_W<'a> {
w: &'a mut W,
}
impl<'a> FLASH_BE_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 << 23)) | (((value as u32) & 0x01) << 23);
self.w
}
}
#[doc = "Reader of field `FLASH_CE`"]
pub type FLASH_CE_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `FLASH_CE`"]
pub struct FLASH_CE_W<'a> {
w: &'a mut W,
}
impl<'a> FLASH_CE_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 << 22)) | (((value as u32) & 0x01) << 22);
self.w
}
}
#[doc = "Reader of field `FLASH_DP`"]
pub type FLASH_DP_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `FLASH_DP`"]
pub struct FLASH_DP_W<'a> {
w: &'a mut W,
}
impl<'a> FLASH_DP_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 << 21)) | (((value as u32) & 0x01) << 21);
self.w
}
}
#[doc = "Reader of field `FLASH_RES`"]
pub type FLASH_RES_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `FLASH_RES`"]
pub struct FLASH_RES_W<'a> {
w: &'a mut W,
}
impl<'a> FLASH_RES_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 << 20)) | (((value as u32) & 0x01) << 20);
self.w
}
}
#[doc = "Reader of field `FLASH_HPM`"]
pub type FLASH_HPM_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `FLASH_HPM`"]
pub struct FLASH_HPM_W<'a> {
w: &'a mut W,
}
impl<'a> FLASH_HPM_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
}
}
#[doc = "Reader of field `USR`"]
pub type USR_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `USR`"]
pub struct USR_W<'a> {
w: &'a mut W,
}
impl<'a> USR_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 = "Reader of field `FLASH_PES`"]
pub type FLASH_PES_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `FLASH_PES`"]
pub struct FLASH_PES_W<'a> {
w: &'a mut W,
}
impl<'a> FLASH_PES_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 << 17)) | (((value as u32) & 0x01) << 17);
self.w
}
}
#[doc = "Reader of field `FLASH_PER`"]
pub type FLASH_PER_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `FLASH_PER`"]
pub struct FLASH_PER_W<'a> {
w: &'a mut W,
}
impl<'a> FLASH_PER_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
}
}
impl R {
#[doc = "Bit 31"]
#[inline(always)]
pub fn flash_read(&self) -> FLASH_READ_R {
FLASH_READ_R::new(((self.bits >> 31) & 0x01) != 0)
}
#[doc = "Bit 30"]
#[inline(always)]
pub fn flash_wren(&self) -> FLASH_WREN_R {
FLASH_WREN_R::new(((self.bits >> 30) & 0x01) != 0)
}
#[doc = "Bit 29"]
#[inline(always)]
pub fn flash_wrdi(&self) -> FLASH_WRDI_R {
FLASH_WRDI_R::new(((self.bits >> 29) & 0x01) != 0)
}
#[doc = "Bit 28"]
#[inline(always)]
pub fn flash_rdid(&self) -> FLASH_RDID_R {
FLASH_RDID_R::new(((self.bits >> 28) & 0x01) != 0)
}
#[doc = "Bit 27"]
#[inline(always)]
pub fn flash_rdsr(&self) -> FLASH_RDSR_R {
FLASH_RDSR_R::new(((self.bits >> 27) & 0x01) != 0)
}
#[doc = "Bit 26"]
#[inline(always)]
pub fn flash_wrsr(&self) -> FLASH_WRSR_R {
FLASH_WRSR_R::new(((self.bits >> 26) & 0x01) != 0)
}
#[doc = "Bit 25"]
#[inline(always)]
pub fn flash_pp(&self) -> FLASH_PP_R {
FLASH_PP_R::new(((self.bits >> 25) & 0x01) != 0)
}
#[doc = "Bit 24"]
#[inline(always)]
pub fn flash_se(&self) -> FLASH_SE_R {
FLASH_SE_R::new(((self.bits >> 24) & 0x01) != 0)
}
#[doc = "Bit 23"]
#[inline(always)]
pub fn flash_be(&self) -> FLASH_BE_R {
FLASH_BE_R::new(((self.bits >> 23) & 0x01) != 0)
}
#[doc = "Bit 22"]
#[inline(always)]
pub fn flash_ce(&self) -> FLASH_CE_R {
FLASH_CE_R::new(((self.bits >> 22) & 0x01) != 0)
}
#[doc = "Bit 21"]
#[inline(always)]
pub fn flash_dp(&self) -> FLASH_DP_R {
FLASH_DP_R::new(((self.bits >> 21) & 0x01) != 0)
}
#[doc = "Bit 20"]
#[inline(always)]
pub fn flash_res(&self) -> FLASH_RES_R {
FLASH_RES_R::new(((self.bits >> 20) & 0x01) != 0)
}
#[doc = "Bit 19"]
#[inline(always)]
pub fn flash_hpm(&self) -> FLASH_HPM_R {
FLASH_HPM_R::new(((self.bits >> 19) & 0x01) != 0)
}
#[doc = "Bit 18"]
#[inline(always)]
pub fn usr(&self) -> USR_R {
USR_R::new(((self.bits >> 18) & 0x01) != 0)
}
#[doc = "Bit 17"]
#[inline(always)]
pub fn flash_pes(&self) -> FLASH_PES_R {
FLASH_PES_R::new(((self.bits >> 17) & 0x01) != 0)
}
#[doc = "Bit 16"]
#[inline(always)]
pub fn flash_per(&self) -> FLASH_PER_R {
FLASH_PER_R::new(((self.bits >> 16) & 0x01) != 0)
}
}
impl W {
#[doc = "Bit 31"]
#[inline(always)]
pub fn flash_read(&mut self) -> FLASH_READ_W {
FLASH_READ_W { w: self }
}
#[doc = "Bit 30"]
#[inline(always)]
pub fn flash_wren(&mut self) -> FLASH_WREN_W {
FLASH_WREN_W { w: self }
}
#[doc = "Bit 29"]
#[inline(always)]
pub fn flash_wrdi(&mut self) -> FLASH_WRDI_W {
FLASH_WRDI_W { w: self }
}
#[doc = "Bit 28"]
#[inline(always)]
pub fn flash_rdid(&mut self) -> FLASH_RDID_W {
FLASH_RDID_W { w: self }
}
#[doc = "Bit 27"]
#[inline(always)]
pub fn flash_rdsr(&mut self) -> FLASH_RDSR_W {
FLASH_RDSR_W { w: self }
}
#[doc = "Bit 26"]
#[inline(always)]
pub fn flash_wrsr(&mut self) -> FLASH_WRSR_W {
FLASH_WRSR_W { w: self }
}
#[doc = "Bit 25"]
#[inline(always)]
pub fn flash_pp(&mut self) -> FLASH_PP_W {
FLASH_PP_W { w: self }
}
#[doc = "Bit 24"]
#[inline(always)]
pub fn flash_se(&mut self) -> FLASH_SE_W {
FLASH_SE_W { w: self }
}
#[doc = "Bit 23"]
#[inline(always)]
pub fn flash_be(&mut self) -> FLASH_BE_W {
FLASH_BE_W { w: self }
}
#[doc = "Bit 22"]
#[inline(always)]
pub fn flash_ce(&mut self) -> FLASH_CE_W {
FLASH_CE_W { w: self }
}
#[doc = "Bit 21"]
#[inline(always)]
pub fn flash_dp(&mut self) -> FLASH_DP_W {
FLASH_DP_W { w: self }
}
#[doc = "Bit 20"]
#[inline(always)]
pub fn flash_res(&mut self) -> FLASH_RES_W {
FLASH_RES_W { w: self }
}
#[doc = "Bit 19"]
#[inline(always)]
pub fn flash_hpm(&mut self) -> FLASH_HPM_W {
FLASH_HPM_W { w: self }
}
#[doc = "Bit 18"]
#[inline(always)]
pub fn usr(&mut self) -> USR_W {
USR_W { w: self }
}
#[doc = "Bit 17"]
#[inline(always)]
pub fn flash_pes(&mut self) -> FLASH_PES_W {
FLASH_PES_W { w: self }
}
#[doc = "Bit 16"]
#[inline(always)]
pub fn flash_per(&mut self) -> FLASH_PER_W {
FLASH_PER_W { w: self }
}
}