pub type R = crate::R<CSR2rs>;
pub type W = crate::W<CSR2rs>;
pub type BYPASS_R = crate::BitReader;
pub type BYPASS_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type LDOEN_R = crate::BitReader;
pub type LDOEN_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type SDEN_R = crate::BitReader;
pub type SDEN_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type SMPSEXTHP_R = crate::BitReader;
pub type SMPSEXTHP_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type SDHILEVEL_R = crate::BitReader;
pub type SDHILEVEL_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type VBE_R = crate::BitReader;
pub type VBE_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type VBRS_R = crate::BitReader;
pub type VBRS_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type XSPICAP1_R = crate::FieldReader;
pub type XSPICAP1_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
pub type XSPICAP2_R = crate::FieldReader;
pub type XSPICAP2_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
pub type EN_XSPIM1_R = crate::BitReader;
pub type EN_XSPIM1_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type EN_XSPIM2_R = crate::BitReader;
pub type EN_XSPIM2_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type SDEXTRDY_R = crate::BitReader;
pub type USB33DEN_R = crate::BitReader;
pub type USB33DEN_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type USBREGEN_R = crate::BitReader;
pub type USBREGEN_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type USB33RDY_R = crate::BitReader;
pub type USBHSREGEN_R = crate::BitReader;
pub type USBHSREGEN_W<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[inline(always)]
pub fn bypass(&self) -> BYPASS_R {
BYPASS_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn ldoen(&self) -> LDOEN_R {
LDOEN_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn sden(&self) -> SDEN_R {
SDEN_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn smpsexthp(&self) -> SMPSEXTHP_R {
SMPSEXTHP_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn sdhilevel(&self) -> SDHILEVEL_R {
SDHILEVEL_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn vbe(&self) -> VBE_R {
VBE_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn vbrs(&self) -> VBRS_R {
VBRS_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn xspicap1(&self) -> XSPICAP1_R {
XSPICAP1_R::new(((self.bits >> 10) & 3) as u8)
}
#[inline(always)]
pub fn xspicap2(&self) -> XSPICAP2_R {
XSPICAP2_R::new(((self.bits >> 12) & 3) as u8)
}
#[inline(always)]
pub fn en_xspim1(&self) -> EN_XSPIM1_R {
EN_XSPIM1_R::new(((self.bits >> 14) & 1) != 0)
}
#[inline(always)]
pub fn en_xspim2(&self) -> EN_XSPIM2_R {
EN_XSPIM2_R::new(((self.bits >> 15) & 1) != 0)
}
#[inline(always)]
pub fn sdextrdy(&self) -> SDEXTRDY_R {
SDEXTRDY_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn usb33den(&self) -> USB33DEN_R {
USB33DEN_R::new(((self.bits >> 24) & 1) != 0)
}
#[inline(always)]
pub fn usbregen(&self) -> USBREGEN_R {
USBREGEN_R::new(((self.bits >> 25) & 1) != 0)
}
#[inline(always)]
pub fn usb33rdy(&self) -> USB33RDY_R {
USB33RDY_R::new(((self.bits >> 26) & 1) != 0)
}
#[inline(always)]
pub fn usbhsregen(&self) -> USBHSREGEN_R {
USBHSREGEN_R::new(((self.bits >> 27) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CSR2")
.field("bypass", &self.bypass())
.field("ldoen", &self.ldoen())
.field("sden", &self.sden())
.field("smpsexthp", &self.smpsexthp())
.field("sdhilevel", &self.sdhilevel())
.field("vbe", &self.vbe())
.field("vbrs", &self.vbrs())
.field("xspicap1", &self.xspicap1())
.field("xspicap2", &self.xspicap2())
.field("en_xspim1", &self.en_xspim1())
.field("en_xspim2", &self.en_xspim2())
.field("sdextrdy", &self.sdextrdy())
.field("usb33den", &self.usb33den())
.field("usbregen", &self.usbregen())
.field("usb33rdy", &self.usb33rdy())
.field("usbhsregen", &self.usbhsregen())
.finish()
}
}
impl W {
#[inline(always)]
pub fn bypass(&mut self) -> BYPASS_W<CSR2rs> {
BYPASS_W::new(self, 0)
}
#[inline(always)]
pub fn ldoen(&mut self) -> LDOEN_W<CSR2rs> {
LDOEN_W::new(self, 1)
}
#[inline(always)]
pub fn sden(&mut self) -> SDEN_W<CSR2rs> {
SDEN_W::new(self, 2)
}
#[inline(always)]
pub fn smpsexthp(&mut self) -> SMPSEXTHP_W<CSR2rs> {
SMPSEXTHP_W::new(self, 3)
}
#[inline(always)]
pub fn sdhilevel(&mut self) -> SDHILEVEL_W<CSR2rs> {
SDHILEVEL_W::new(self, 4)
}
#[inline(always)]
pub fn vbe(&mut self) -> VBE_W<CSR2rs> {
VBE_W::new(self, 8)
}
#[inline(always)]
pub fn vbrs(&mut self) -> VBRS_W<CSR2rs> {
VBRS_W::new(self, 9)
}
#[inline(always)]
pub fn xspicap1(&mut self) -> XSPICAP1_W<CSR2rs> {
XSPICAP1_W::new(self, 10)
}
#[inline(always)]
pub fn xspicap2(&mut self) -> XSPICAP2_W<CSR2rs> {
XSPICAP2_W::new(self, 12)
}
#[inline(always)]
pub fn en_xspim1(&mut self) -> EN_XSPIM1_W<CSR2rs> {
EN_XSPIM1_W::new(self, 14)
}
#[inline(always)]
pub fn en_xspim2(&mut self) -> EN_XSPIM2_W<CSR2rs> {
EN_XSPIM2_W::new(self, 15)
}
#[inline(always)]
pub fn usb33den(&mut self) -> USB33DEN_W<CSR2rs> {
USB33DEN_W::new(self, 24)
}
#[inline(always)]
pub fn usbregen(&mut self) -> USBREGEN_W<CSR2rs> {
USBREGEN_W::new(self, 25)
}
#[inline(always)]
pub fn usbhsregen(&mut self) -> USBHSREGEN_W<CSR2rs> {
USBHSREGEN_W::new(self, 27)
}
}
pub struct CSR2rs;
impl crate::RegisterSpec for CSR2rs {
type Ux = u32;
}
impl crate::Readable for CSR2rs {}
impl crate::Writable for CSR2rs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CSR2rs {
const RESET_VALUE: u32 = 0x06;
}