pub type R = crate::R<POWERrs>;
pub type W = crate::W<POWERrs>;
pub type PWRCTRL_R = crate::FieldReader;
pub type PWRCTRL_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
pub type VSWITCH_R = crate::BitReader;
pub type VSWITCH_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type VSWITCHEN_R = crate::BitReader;
pub type VSWITCHEN_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type DIRPOL_R = crate::BitReader;
pub type DIRPOL_W<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[inline(always)]
pub fn pwrctrl(&self) -> PWRCTRL_R {
PWRCTRL_R::new((self.bits & 3) as u8)
}
#[inline(always)]
pub fn vswitch(&self) -> VSWITCH_R {
VSWITCH_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn vswitchen(&self) -> VSWITCHEN_R {
VSWITCHEN_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn dirpol(&self) -> DIRPOL_R {
DIRPOL_R::new(((self.bits >> 4) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("POWER")
.field("pwrctrl", &self.pwrctrl())
.field("vswitch", &self.vswitch())
.field("vswitchen", &self.vswitchen())
.field("dirpol", &self.dirpol())
.finish()
}
}
impl W {
#[inline(always)]
pub fn pwrctrl(&mut self) -> PWRCTRL_W<POWERrs> {
PWRCTRL_W::new(self, 0)
}
#[inline(always)]
pub fn vswitch(&mut self) -> VSWITCH_W<POWERrs> {
VSWITCH_W::new(self, 2)
}
#[inline(always)]
pub fn vswitchen(&mut self) -> VSWITCHEN_W<POWERrs> {
VSWITCHEN_W::new(self, 3)
}
#[inline(always)]
pub fn dirpol(&mut self) -> DIRPOL_W<POWERrs> {
DIRPOL_W::new(self, 4)
}
}
pub struct POWERrs;
impl crate::RegisterSpec for POWERrs {
type Ux = u32;
}
impl crate::Readable for POWERrs {}
impl crate::Writable for POWERrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for POWERrs {}