pub type R = crate::R<AWHTRrs>;
pub type W = crate::W<AWHTRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum BKAWH0 {
NotAssigned = 0,
Assigned = 1,
}
impl From<BKAWH0> for bool {
#[inline(always)]
fn from(variant: BKAWH0) -> Self {
variant as u8 != 0
}
}
pub type BKAWH_R = crate::BitReader<BKAWH0>;
impl BKAWH_R {
#[inline(always)]
pub const fn variant(&self) -> BKAWH0 {
match self.bits {
false => BKAWH0::NotAssigned,
true => BKAWH0::Assigned,
}
}
#[inline(always)]
pub fn is_not_assigned(&self) -> bool {
*self == BKAWH0::NotAssigned
}
#[inline(always)]
pub fn is_assigned(&self) -> bool {
*self == BKAWH0::Assigned
}
}
pub type BKAWH_W<'a, REG> = crate::BitWriter<'a, REG, BKAWH0>;
impl<'a, REG> BKAWH_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn not_assigned(self) -> &'a mut crate::W<REG> {
self.variant(BKAWH0::NotAssigned)
}
#[inline(always)]
pub fn assigned(self) -> &'a mut crate::W<REG> {
self.variant(BKAWH0::Assigned)
}
}
pub type AWHT_R = crate::FieldReader<u32>;
pub type AWHT_W<'a, REG> = crate::FieldWriter<'a, REG, 24, u32, crate::Safe>;
impl R {
#[inline(always)]
pub fn bkawh(&self, n: u8) -> BKAWH_R {
#[allow(clippy::no_effect)]
[(); 4][n as usize];
BKAWH_R::new(((self.bits >> n) & 1) != 0)
}
#[inline(always)]
pub fn bkawh_iter(&self) -> impl Iterator<Item = BKAWH_R> + '_ {
(0..4).map(move |n| BKAWH_R::new(((self.bits >> n) & 1) != 0))
}
#[inline(always)]
pub fn bkawh0(&self) -> BKAWH_R {
BKAWH_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn bkawh1(&self) -> BKAWH_R {
BKAWH_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn bkawh2(&self) -> BKAWH_R {
BKAWH_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn bkawh3(&self) -> BKAWH_R {
BKAWH_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn awht(&self) -> AWHT_R {
AWHT_R::new((self.bits >> 8) & 0x00ff_ffff)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("AWHTR")
.field("awht", &self.awht())
.field("bkawh0", &self.bkawh0())
.field("bkawh1", &self.bkawh1())
.field("bkawh2", &self.bkawh2())
.field("bkawh3", &self.bkawh3())
.finish()
}
}
impl W {
#[inline(always)]
pub fn bkawh(&mut self, n: u8) -> BKAWH_W<AWHTRrs> {
#[allow(clippy::no_effect)]
[(); 4][n as usize];
BKAWH_W::new(self, n)
}
#[inline(always)]
pub fn bkawh0(&mut self) -> BKAWH_W<AWHTRrs> {
BKAWH_W::new(self, 0)
}
#[inline(always)]
pub fn bkawh1(&mut self) -> BKAWH_W<AWHTRrs> {
BKAWH_W::new(self, 1)
}
#[inline(always)]
pub fn bkawh2(&mut self) -> BKAWH_W<AWHTRrs> {
BKAWH_W::new(self, 2)
}
#[inline(always)]
pub fn bkawh3(&mut self) -> BKAWH_W<AWHTRrs> {
BKAWH_W::new(self, 3)
}
#[inline(always)]
pub fn awht(&mut self) -> AWHT_W<AWHTRrs> {
AWHT_W::new(self, 8)
}
}
pub struct AWHTRrs;
impl crate::RegisterSpec for AWHTRrs {
type Ux = u32;
}
impl crate::Readable for AWHTRrs {}
impl crate::Writable for AWHTRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for AWHTRrs {}