#[doc = "Reader of register POWERCLR"]
pub type R = crate::R<u32, super::POWERCLR>;
#[doc = "Writer for register POWERCLR"]
pub type W = crate::W<u32, super::POWERCLR>;
#[doc = "Register POWERCLR `reset()`'s with value 0xffff"]
impl crate::ResetValue for super::POWERCLR {
type Type = u32;
#[inline(always)]
fn reset_value() -> Self::Type {
0xffff
}
}
#[doc = "Keep RAM section S0 of RAM\\[n\\] on or off in System ON mode\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum S0POWER_A {
#[doc = "1: Off"]
OFF,
}
impl From<S0POWER_A> for bool {
#[inline(always)]
fn from(variant: S0POWER_A) -> Self {
match variant {
S0POWER_A::OFF => true,
}
}
}
#[doc = "Reader of field `S0POWER`"]
pub type S0POWER_R = crate::R<bool, S0POWER_A>;
impl S0POWER_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> crate::Variant<bool, S0POWER_A> {
use crate::Variant::*;
match self.bits {
true => Val(S0POWER_A::OFF),
i => Res(i),
}
}
#[doc = "Checks if the value of the field is `OFF`"]
#[inline(always)]
pub fn is_off(&self) -> bool {
*self == S0POWER_A::OFF
}
}
#[doc = "Write proxy for field `S0POWER`"]
pub struct S0POWER_W<'a> {
w: &'a mut W,
}
impl<'a> S0POWER_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: S0POWER_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "Off"]
#[inline(always)]
pub fn off(self) -> &'a mut W {
self.variant(S0POWER_A::OFF)
}
#[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 = "Keep RAM section S1 of RAM\\[n\\] on or off in System ON mode\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum S1POWER_A {
#[doc = "1: Off"]
OFF,
}
impl From<S1POWER_A> for bool {
#[inline(always)]
fn from(variant: S1POWER_A) -> Self {
match variant {
S1POWER_A::OFF => true,
}
}
}
#[doc = "Reader of field `S1POWER`"]
pub type S1POWER_R = crate::R<bool, S1POWER_A>;
impl S1POWER_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> crate::Variant<bool, S1POWER_A> {
use crate::Variant::*;
match self.bits {
true => Val(S1POWER_A::OFF),
i => Res(i),
}
}
#[doc = "Checks if the value of the field is `OFF`"]
#[inline(always)]
pub fn is_off(&self) -> bool {
*self == S1POWER_A::OFF
}
}
#[doc = "Write proxy for field `S1POWER`"]
pub struct S1POWER_W<'a> {
w: &'a mut W,
}
impl<'a> S1POWER_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: S1POWER_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "Off"]
#[inline(always)]
pub fn off(self) -> &'a mut W {
self.variant(S1POWER_A::OFF)
}
#[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 = "Keep RAM section S2 of RAM\\[n\\] on or off in System ON mode\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum S2POWER_A {
#[doc = "1: Off"]
OFF,
}
impl From<S2POWER_A> for bool {
#[inline(always)]
fn from(variant: S2POWER_A) -> Self {
match variant {
S2POWER_A::OFF => true,
}
}
}
#[doc = "Reader of field `S2POWER`"]
pub type S2POWER_R = crate::R<bool, S2POWER_A>;
impl S2POWER_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> crate::Variant<bool, S2POWER_A> {
use crate::Variant::*;
match self.bits {
true => Val(S2POWER_A::OFF),
i => Res(i),
}
}
#[doc = "Checks if the value of the field is `OFF`"]
#[inline(always)]
pub fn is_off(&self) -> bool {
*self == S2POWER_A::OFF
}
}
#[doc = "Write proxy for field `S2POWER`"]
pub struct S2POWER_W<'a> {
w: &'a mut W,
}
impl<'a> S2POWER_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: S2POWER_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "Off"]
#[inline(always)]
pub fn off(self) -> &'a mut W {
self.variant(S2POWER_A::OFF)
}
#[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 << 2)) | (((value as u32) & 0x01) << 2);
self.w
}
}
#[doc = "Keep RAM section S3 of RAM\\[n\\] on or off in System ON mode\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum S3POWER_A {
#[doc = "1: Off"]
OFF,
}
impl From<S3POWER_A> for bool {
#[inline(always)]
fn from(variant: S3POWER_A) -> Self {
match variant {
S3POWER_A::OFF => true,
}
}
}
#[doc = "Reader of field `S3POWER`"]
pub type S3POWER_R = crate::R<bool, S3POWER_A>;
impl S3POWER_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> crate::Variant<bool, S3POWER_A> {
use crate::Variant::*;
match self.bits {
true => Val(S3POWER_A::OFF),
i => Res(i),
}
}
#[doc = "Checks if the value of the field is `OFF`"]
#[inline(always)]
pub fn is_off(&self) -> bool {
*self == S3POWER_A::OFF
}
}
#[doc = "Write proxy for field `S3POWER`"]
pub struct S3POWER_W<'a> {
w: &'a mut W,
}
impl<'a> S3POWER_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: S3POWER_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "Off"]
#[inline(always)]
pub fn off(self) -> &'a mut W {
self.variant(S3POWER_A::OFF)
}
#[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 = "Keep retention on RAM section S0 of RAM\\[n\\] when RAM section is switched off\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum S0RETENTION_A {
#[doc = "1: Off"]
OFF,
}
impl From<S0RETENTION_A> for bool {
#[inline(always)]
fn from(variant: S0RETENTION_A) -> Self {
match variant {
S0RETENTION_A::OFF => true,
}
}
}
#[doc = "Reader of field `S0RETENTION`"]
pub type S0RETENTION_R = crate::R<bool, S0RETENTION_A>;
impl S0RETENTION_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> crate::Variant<bool, S0RETENTION_A> {
use crate::Variant::*;
match self.bits {
true => Val(S0RETENTION_A::OFF),
i => Res(i),
}
}
#[doc = "Checks if the value of the field is `OFF`"]
#[inline(always)]
pub fn is_off(&self) -> bool {
*self == S0RETENTION_A::OFF
}
}
#[doc = "Write proxy for field `S0RETENTION`"]
pub struct S0RETENTION_W<'a> {
w: &'a mut W,
}
impl<'a> S0RETENTION_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: S0RETENTION_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "Off"]
#[inline(always)]
pub fn off(self) -> &'a mut W {
self.variant(S0RETENTION_A::OFF)
}
#[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 = "Keep retention on RAM section S1 of RAM\\[n\\] when RAM section is switched off\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum S1RETENTION_A {
#[doc = "1: Off"]
OFF,
}
impl From<S1RETENTION_A> for bool {
#[inline(always)]
fn from(variant: S1RETENTION_A) -> Self {
match variant {
S1RETENTION_A::OFF => true,
}
}
}
#[doc = "Reader of field `S1RETENTION`"]
pub type S1RETENTION_R = crate::R<bool, S1RETENTION_A>;
impl S1RETENTION_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> crate::Variant<bool, S1RETENTION_A> {
use crate::Variant::*;
match self.bits {
true => Val(S1RETENTION_A::OFF),
i => Res(i),
}
}
#[doc = "Checks if the value of the field is `OFF`"]
#[inline(always)]
pub fn is_off(&self) -> bool {
*self == S1RETENTION_A::OFF
}
}
#[doc = "Write proxy for field `S1RETENTION`"]
pub struct S1RETENTION_W<'a> {
w: &'a mut W,
}
impl<'a> S1RETENTION_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: S1RETENTION_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "Off"]
#[inline(always)]
pub fn off(self) -> &'a mut W {
self.variant(S1RETENTION_A::OFF)
}
#[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 = "Keep retention on RAM section S2 of RAM\\[n\\] when RAM section is switched off\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum S2RETENTION_A {
#[doc = "1: Off"]
OFF,
}
impl From<S2RETENTION_A> for bool {
#[inline(always)]
fn from(variant: S2RETENTION_A) -> Self {
match variant {
S2RETENTION_A::OFF => true,
}
}
}
#[doc = "Reader of field `S2RETENTION`"]
pub type S2RETENTION_R = crate::R<bool, S2RETENTION_A>;
impl S2RETENTION_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> crate::Variant<bool, S2RETENTION_A> {
use crate::Variant::*;
match self.bits {
true => Val(S2RETENTION_A::OFF),
i => Res(i),
}
}
#[doc = "Checks if the value of the field is `OFF`"]
#[inline(always)]
pub fn is_off(&self) -> bool {
*self == S2RETENTION_A::OFF
}
}
#[doc = "Write proxy for field `S2RETENTION`"]
pub struct S2RETENTION_W<'a> {
w: &'a mut W,
}
impl<'a> S2RETENTION_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: S2RETENTION_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "Off"]
#[inline(always)]
pub fn off(self) -> &'a mut W {
self.variant(S2RETENTION_A::OFF)
}
#[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 = "Keep retention on RAM section S3 of RAM\\[n\\] when RAM section is switched off\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum S3RETENTION_A {
#[doc = "1: Off"]
OFF,
}
impl From<S3RETENTION_A> for bool {
#[inline(always)]
fn from(variant: S3RETENTION_A) -> Self {
match variant {
S3RETENTION_A::OFF => true,
}
}
}
#[doc = "Reader of field `S3RETENTION`"]
pub type S3RETENTION_R = crate::R<bool, S3RETENTION_A>;
impl S3RETENTION_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> crate::Variant<bool, S3RETENTION_A> {
use crate::Variant::*;
match self.bits {
true => Val(S3RETENTION_A::OFF),
i => Res(i),
}
}
#[doc = "Checks if the value of the field is `OFF`"]
#[inline(always)]
pub fn is_off(&self) -> bool {
*self == S3RETENTION_A::OFF
}
}
#[doc = "Write proxy for field `S3RETENTION`"]
pub struct S3RETENTION_W<'a> {
w: &'a mut W,
}
impl<'a> S3RETENTION_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: S3RETENTION_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "Off"]
#[inline(always)]
pub fn off(self) -> &'a mut W {
self.variant(S3RETENTION_A::OFF)
}
#[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 - Keep RAM section S0 of RAM\\[n\\] on or off in System ON mode"]
#[inline(always)]
pub fn s0power(&self) -> S0POWER_R {
S0POWER_R::new((self.bits & 0x01) != 0)
}
#[doc = "Bit 1 - Keep RAM section S1 of RAM\\[n\\] on or off in System ON mode"]
#[inline(always)]
pub fn s1power(&self) -> S1POWER_R {
S1POWER_R::new(((self.bits >> 1) & 0x01) != 0)
}
#[doc = "Bit 2 - Keep RAM section S2 of RAM\\[n\\] on or off in System ON mode"]
#[inline(always)]
pub fn s2power(&self) -> S2POWER_R {
S2POWER_R::new(((self.bits >> 2) & 0x01) != 0)
}
#[doc = "Bit 3 - Keep RAM section S3 of RAM\\[n\\] on or off in System ON mode"]
#[inline(always)]
pub fn s3power(&self) -> S3POWER_R {
S3POWER_R::new(((self.bits >> 3) & 0x01) != 0)
}
#[doc = "Bit 16 - Keep retention on RAM section S0 of RAM\\[n\\] when RAM section is switched off"]
#[inline(always)]
pub fn s0retention(&self) -> S0RETENTION_R {
S0RETENTION_R::new(((self.bits >> 16) & 0x01) != 0)
}
#[doc = "Bit 17 - Keep retention on RAM section S1 of RAM\\[n\\] when RAM section is switched off"]
#[inline(always)]
pub fn s1retention(&self) -> S1RETENTION_R {
S1RETENTION_R::new(((self.bits >> 17) & 0x01) != 0)
}
#[doc = "Bit 18 - Keep retention on RAM section S2 of RAM\\[n\\] when RAM section is switched off"]
#[inline(always)]
pub fn s2retention(&self) -> S2RETENTION_R {
S2RETENTION_R::new(((self.bits >> 18) & 0x01) != 0)
}
#[doc = "Bit 19 - Keep retention on RAM section S3 of RAM\\[n\\] when RAM section is switched off"]
#[inline(always)]
pub fn s3retention(&self) -> S3RETENTION_R {
S3RETENTION_R::new(((self.bits >> 19) & 0x01) != 0)
}
}
impl W {
#[doc = "Bit 0 - Keep RAM section S0 of RAM\\[n\\] on or off in System ON mode"]
#[inline(always)]
pub fn s0power(&mut self) -> S0POWER_W {
S0POWER_W { w: self }
}
#[doc = "Bit 1 - Keep RAM section S1 of RAM\\[n\\] on or off in System ON mode"]
#[inline(always)]
pub fn s1power(&mut self) -> S1POWER_W {
S1POWER_W { w: self }
}
#[doc = "Bit 2 - Keep RAM section S2 of RAM\\[n\\] on or off in System ON mode"]
#[inline(always)]
pub fn s2power(&mut self) -> S2POWER_W {
S2POWER_W { w: self }
}
#[doc = "Bit 3 - Keep RAM section S3 of RAM\\[n\\] on or off in System ON mode"]
#[inline(always)]
pub fn s3power(&mut self) -> S3POWER_W {
S3POWER_W { w: self }
}
#[doc = "Bit 16 - Keep retention on RAM section S0 of RAM\\[n\\] when RAM section is switched off"]
#[inline(always)]
pub fn s0retention(&mut self) -> S0RETENTION_W {
S0RETENTION_W { w: self }
}
#[doc = "Bit 17 - Keep retention on RAM section S1 of RAM\\[n\\] when RAM section is switched off"]
#[inline(always)]
pub fn s1retention(&mut self) -> S1RETENTION_W {
S1RETENTION_W { w: self }
}
#[doc = "Bit 18 - Keep retention on RAM section S2 of RAM\\[n\\] when RAM section is switched off"]
#[inline(always)]
pub fn s2retention(&mut self) -> S2RETENTION_W {
S2RETENTION_W { w: self }
}
#[doc = "Bit 19 - Keep retention on RAM section S3 of RAM\\[n\\] when RAM section is switched off"]
#[inline(always)]
pub fn s3retention(&mut self) -> S3RETENTION_W {
S3RETENTION_W { w: self }
}
}