#[doc = "Register `PWR_PWRSYS_CONFIG` reader"]
pub struct R(crate::R<PWR_PWRSYS_CONFIG_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<PWR_PWRSYS_CONFIG_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::convert::From<crate::R<PWR_PWRSYS_CONFIG_SPEC>> for R {
    fn from(reader: crate::R<PWR_PWRSYS_CONFIG_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `PWR_PWRSYS_CONFIG` writer"]
pub struct W(crate::W<PWR_PWRSYS_CONFIG_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<PWR_PWRSYS_CONFIG_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::ops::DerefMut for W {
    #[inline(always)]
    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.0
    }
}
impl core::convert::From<crate::W<PWR_PWRSYS_CONFIG_SPEC>> for W {
    fn from(writer: crate::W<PWR_PWRSYS_CONFIG_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `HIB_TEST_EN` reader - Bias control for the DSBOD/HBOD. (engineering only)?0: low power biasing?1: turbo biasing"]
pub struct HIB_TEST_EN_R(crate::FieldReader<bool, bool>);
impl HIB_TEST_EN_R {
    pub(crate) fn new(bits: bool) -> Self {
        HIB_TEST_EN_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for HIB_TEST_EN_R {
    type Target = crate::FieldReader<bool, bool>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `HIB_TEST_EN` writer - Bias control for the DSBOD/HBOD. (engineering only)?0: low power biasing?1: turbo biasing"]
pub struct HIB_TEST_EN_W<'a> {
    w: &'a mut W,
}
impl<'a> HIB_TEST_EN_W<'a> {
    #[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 << 8)) | ((value as u32 & 0x01) << 8);
        self.w
    }
}
#[doc = "Field `HIB_TEST_REP` reader - When set the enhanced replica load regulation circuit is enabled. When clear, the enhancments are disabled at the cost of higher current. (engineering only)"]
pub struct HIB_TEST_REP_R(crate::FieldReader<bool, bool>);
impl HIB_TEST_REP_R {
    pub(crate) fn new(bits: bool) -> Self {
        HIB_TEST_REP_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for HIB_TEST_REP_R {
    type Target = crate::FieldReader<bool, bool>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `HIB_TEST_REP` writer - When set the enhanced replica load regulation circuit is enabled. When clear, the enhancments are disabled at the cost of higher current. (engineering only)"]
pub struct HIB_TEST_REP_W<'a> {
    w: &'a mut W,
}
impl<'a> HIB_TEST_REP_W<'a> {
    #[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 << 9)) | ((value as u32 & 0x01) << 9);
        self.w
    }
}
impl R {
    #[doc = "Bit 8 - Bias control for the DSBOD/HBOD. (engineering only)?0: low power biasing?1: turbo biasing"]
    #[inline(always)]
    pub fn hib_test_en(&self) -> HIB_TEST_EN_R {
        HIB_TEST_EN_R::new(((self.bits >> 8) & 0x01) != 0)
    }
    #[doc = "Bit 9 - When set the enhanced replica load regulation circuit is enabled. When clear, the enhancments are disabled at the cost of higher current. (engineering only)"]
    #[inline(always)]
    pub fn hib_test_rep(&self) -> HIB_TEST_REP_R {
        HIB_TEST_REP_R::new(((self.bits >> 9) & 0x01) != 0)
    }
}
impl W {
    #[doc = "Bit 8 - Bias control for the DSBOD/HBOD. (engineering only)?0: low power biasing?1: turbo biasing"]
    #[inline(always)]
    pub fn hib_test_en(&mut self) -> HIB_TEST_EN_W {
        HIB_TEST_EN_W { w: self }
    }
    #[doc = "Bit 9 - When set the enhanced replica load regulation circuit is enabled. When clear, the enhancments are disabled at the cost of higher current. (engineering only)"]
    #[inline(always)]
    pub fn hib_test_rep(&mut self) -> HIB_TEST_REP_W {
        HIB_TEST_REP_W { w: self }
    }
    #[doc = "Writes raw bits to the register."]
    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
        self.0.bits(bits);
        self
    }
}
#[doc = "Power System Trim and Configuration\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pwr_pwrsys_config](index.html) module"]
pub struct PWR_PWRSYS_CONFIG_SPEC;
impl crate::RegisterSpec for PWR_PWRSYS_CONFIG_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [pwr_pwrsys_config::R](R) reader structure"]
impl crate::Readable for PWR_PWRSYS_CONFIG_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [pwr_pwrsys_config::W](W) writer structure"]
impl crate::Writable for PWR_PWRSYS_CONFIG_SPEC {
    type Writer = W;
}
#[doc = "`reset()` method sets PWR_PWRSYS_CONFIG to value 0"]
impl crate::Resettable for PWR_PWRSYS_CONFIG_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}
