pub type R = crate::R<AHBSMENRrs>;
pub type W = crate::W<AHBSMENRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DMASMEN {
Disabled = 0,
Enabled = 1,
}
impl From<DMASMEN> for bool {
#[inline(always)]
fn from(variant: DMASMEN) -> Self {
variant as u8 != 0
}
}
pub type DMASMEN_R = crate::BitReader<DMASMEN>;
impl DMASMEN_R {
#[inline(always)]
pub const fn variant(&self) -> DMASMEN {
match self.bits {
false => DMASMEN::Disabled,
true => DMASMEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == DMASMEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == DMASMEN::Enabled
}
}
pub type DMASMEN_W<'a, REG> = crate::BitWriter<'a, REG, DMASMEN>;
impl<'a, REG> DMASMEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(DMASMEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(DMASMEN::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum MIFSMEN {
Disabled = 0,
Enabled = 1,
}
impl From<MIFSMEN> for bool {
#[inline(always)]
fn from(variant: MIFSMEN) -> Self {
variant as u8 != 0
}
}
pub type MIFSMEN_R = crate::BitReader<MIFSMEN>;
impl MIFSMEN_R {
#[inline(always)]
pub const fn variant(&self) -> MIFSMEN {
match self.bits {
false => MIFSMEN::Disabled,
true => MIFSMEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == MIFSMEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == MIFSMEN::Enabled
}
}
pub type MIFSMEN_W<'a, REG> = crate::BitWriter<'a, REG, MIFSMEN>;
impl<'a, REG> MIFSMEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(MIFSMEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(MIFSMEN::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SRAMSMEN {
Disabled = 0,
Enabled = 1,
}
impl From<SRAMSMEN> for bool {
#[inline(always)]
fn from(variant: SRAMSMEN) -> Self {
variant as u8 != 0
}
}
pub type SRAMSMEN_R = crate::BitReader<SRAMSMEN>;
impl SRAMSMEN_R {
#[inline(always)]
pub const fn variant(&self) -> SRAMSMEN {
match self.bits {
false => SRAMSMEN::Disabled,
true => SRAMSMEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == SRAMSMEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == SRAMSMEN::Enabled
}
}
pub type SRAMSMEN_W<'a, REG> = crate::BitWriter<'a, REG, SRAMSMEN>;
impl<'a, REG> SRAMSMEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(SRAMSMEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(SRAMSMEN::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CRCSMEN {
Disabled = 0,
Enabled = 1,
}
impl From<CRCSMEN> for bool {
#[inline(always)]
fn from(variant: CRCSMEN) -> Self {
variant as u8 != 0
}
}
pub type CRCSMEN_R = crate::BitReader<CRCSMEN>;
impl CRCSMEN_R {
#[inline(always)]
pub const fn variant(&self) -> CRCSMEN {
match self.bits {
false => CRCSMEN::Disabled,
true => CRCSMEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == CRCSMEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == CRCSMEN::Enabled
}
}
pub type CRCSMEN_W<'a, REG> = crate::BitWriter<'a, REG, CRCSMEN>;
impl<'a, REG> CRCSMEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(CRCSMEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(CRCSMEN::Enabled)
}
}
pub type TOUCHSMEN_R = crate::BitReader;
pub type TOUCHSMEN_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type RNGSMEN_R = crate::BitReader;
pub type RNGSMEN_W<'a, REG> = crate::BitWriter<'a, REG>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CRYPSMEN {
Disabled = 0,
Enabled = 1,
}
impl From<CRYPSMEN> for bool {
#[inline(always)]
fn from(variant: CRYPSMEN) -> Self {
variant as u8 != 0
}
}
pub type CRYPSMEN_R = crate::BitReader<CRYPSMEN>;
impl CRYPSMEN_R {
#[inline(always)]
pub const fn variant(&self) -> CRYPSMEN {
match self.bits {
false => CRYPSMEN::Disabled,
true => CRYPSMEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == CRYPSMEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == CRYPSMEN::Enabled
}
}
pub type CRYPSMEN_W<'a, REG> = crate::BitWriter<'a, REG, CRYPSMEN>;
impl<'a, REG> CRYPSMEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(CRYPSMEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(CRYPSMEN::Enabled)
}
}
impl R {
#[inline(always)]
pub fn dmasmen(&self) -> DMASMEN_R {
DMASMEN_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn mifsmen(&self) -> MIFSMEN_R {
MIFSMEN_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn sramsmen(&self) -> SRAMSMEN_R {
SRAMSMEN_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn crcsmen(&self) -> CRCSMEN_R {
CRCSMEN_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn touchsmen(&self) -> TOUCHSMEN_R {
TOUCHSMEN_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn rngsmen(&self) -> RNGSMEN_R {
RNGSMEN_R::new(((self.bits >> 20) & 1) != 0)
}
#[inline(always)]
pub fn crypsmen(&self) -> CRYPSMEN_R {
CRYPSMEN_R::new(((self.bits >> 24) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("AHBSMENR")
.field("crypsmen", &self.crypsmen())
.field("rngsmen", &self.rngsmen())
.field("touchsmen", &self.touchsmen())
.field("crcsmen", &self.crcsmen())
.field("sramsmen", &self.sramsmen())
.field("mifsmen", &self.mifsmen())
.field("dmasmen", &self.dmasmen())
.finish()
}
}
impl W {
#[inline(always)]
pub fn dmasmen(&mut self) -> DMASMEN_W<AHBSMENRrs> {
DMASMEN_W::new(self, 0)
}
#[inline(always)]
pub fn mifsmen(&mut self) -> MIFSMEN_W<AHBSMENRrs> {
MIFSMEN_W::new(self, 8)
}
#[inline(always)]
pub fn sramsmen(&mut self) -> SRAMSMEN_W<AHBSMENRrs> {
SRAMSMEN_W::new(self, 9)
}
#[inline(always)]
pub fn crcsmen(&mut self) -> CRCSMEN_W<AHBSMENRrs> {
CRCSMEN_W::new(self, 12)
}
#[inline(always)]
pub fn touchsmen(&mut self) -> TOUCHSMEN_W<AHBSMENRrs> {
TOUCHSMEN_W::new(self, 16)
}
#[inline(always)]
pub fn rngsmen(&mut self) -> RNGSMEN_W<AHBSMENRrs> {
RNGSMEN_W::new(self, 20)
}
#[inline(always)]
pub fn crypsmen(&mut self) -> CRYPSMEN_W<AHBSMENRrs> {
CRYPSMEN_W::new(self, 24)
}
}
pub struct AHBSMENRrs;
impl crate::RegisterSpec for AHBSMENRrs {
type Ux = u32;
}
impl crate::Readable for AHBSMENRrs {}
impl crate::Writable for AHBSMENRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for AHBSMENRrs {
const RESET_VALUE: u32 = 0x0111_1301;
}