d1-pac 0.0.32

Peripheral access API for Allwinner D1 SoC generated from unofficial SVD file
Documentation
#[doc = "Register `ths_shut_ints` reader"]
pub type R = crate::R<THS_SHUT_INTS_SPEC>;
#[doc = "Register `ths_shut_ints` writer"]
pub type W = crate::W<THS_SHUT_INTS_SPEC>;
#[doc = "Field `shut_int_sts` reader - Indicates the pending status of the sensor's shutdown interrupt.\n\nWrite 1 to clear the pending status."]
pub type SHUT_INT_STS_R = crate::BitReader<SHUT_INT_STS_A>;
#[doc = "Indicates the pending status of the sensor's shutdown interrupt.\n\nWrite 1 to clear the pending status.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SHUT_INT_STS_A {
    #[doc = "0: No effect"]
    NO_EFFECT = 0,
    #[doc = "1: Pending"]
    PENDING = 1,
}
impl From<SHUT_INT_STS_A> for bool {
    #[inline(always)]
    fn from(variant: SHUT_INT_STS_A) -> Self {
        variant as u8 != 0
    }
}
impl SHUT_INT_STS_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> SHUT_INT_STS_A {
        match self.bits {
            false => SHUT_INT_STS_A::NO_EFFECT,
            true => SHUT_INT_STS_A::PENDING,
        }
    }
    #[doc = "No effect"]
    #[inline(always)]
    pub fn is_no_effect(&self) -> bool {
        *self == SHUT_INT_STS_A::NO_EFFECT
    }
    #[doc = "Pending"]
    #[inline(always)]
    pub fn is_pending(&self) -> bool {
        *self == SHUT_INT_STS_A::PENDING
    }
}
#[doc = "Field `shut_int_sts` writer - Indicates the pending status of the sensor's shutdown interrupt.\n\nWrite 1 to clear the pending status."]
pub type SHUT_INT_STS_W<'a, REG> = crate::BitWriter1C<'a, REG, SHUT_INT_STS_A>;
impl<'a, REG> SHUT_INT_STS_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "No effect"]
    #[inline(always)]
    pub fn no_effect(self) -> &'a mut crate::W<REG> {
        self.variant(SHUT_INT_STS_A::NO_EFFECT)
    }
    #[doc = "Pending"]
    #[inline(always)]
    pub fn pending(self) -> &'a mut crate::W<REG> {
        self.variant(SHUT_INT_STS_A::PENDING)
    }
}
impl R {
    #[doc = "Bit 0 - Indicates the pending status of the sensor's shutdown interrupt.\n\nWrite 1 to clear the pending status."]
    #[inline(always)]
    pub fn shut_int_sts(&self) -> SHUT_INT_STS_R {
        SHUT_INT_STS_R::new((self.bits & 1) != 0)
    }
}
impl W {
    #[doc = "Bit 0 - Indicates the pending status of the sensor's shutdown interrupt.\n\nWrite 1 to clear the pending status."]
    #[inline(always)]
    #[must_use]
    pub fn shut_int_sts(&mut self) -> SHUT_INT_STS_W<THS_SHUT_INTS_SPEC> {
        SHUT_INT_STS_W::new(self, 0)
    }
    #[doc = r" Writes raw bits to the register."]
    #[doc = r""]
    #[doc = r" # Safety"]
    #[doc = r""]
    #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
    #[inline(always)]
    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
        self.bits = bits;
        self
    }
}
#[doc = "THS Shut Interrupt Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ths_shut_ints::R`](R).  You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ths_shut_ints::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct THS_SHUT_INTS_SPEC;
impl crate::RegisterSpec for THS_SHUT_INTS_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [`ths_shut_ints::R`](R) reader structure"]
impl crate::Readable for THS_SHUT_INTS_SPEC {}
#[doc = "`write(|w| ..)` method takes [`ths_shut_ints::W`](W) writer structure"]
impl crate::Writable for THS_SHUT_INTS_SPEC {
    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0x01;
}
#[doc = "`reset()` method sets ths_shut_ints to value 0"]
impl crate::Resettable for THS_SHUT_INTS_SPEC {
    const RESET_VALUE: Self::Ux = 0;
}