esp8266 0.6.0

Peripheral access crate for the ESP8266
Documentation
#[doc = "Register `SPI_CACHE_TARGET` reader"]
pub struct R(crate::R<SPI_CACHE_TARGET_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<SPI_CACHE_TARGET_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<SPI_CACHE_TARGET_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<SPI_CACHE_TARGET_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `SPI_CACHE_TARGET` writer"]
pub struct W(crate::W<SPI_CACHE_TARGET_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<SPI_CACHE_TARGET_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 From<crate::W<SPI_CACHE_TARGET_SPEC>> for W {
    #[inline(always)]
    fn from(writer: crate::W<SPI_CACHE_TARGET_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `target1` reader - "]
pub struct TARGET1_R(crate::FieldReader<bool, bool>);
impl TARGET1_R {
    #[inline(always)]
    pub(crate) fn new(bits: bool) -> Self {
        TARGET1_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for TARGET1_R {
    type Target = crate::FieldReader<bool, bool>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `target1` writer - "]
pub struct TARGET1_W<'a> {
    w: &'a mut W,
}
impl<'a> TARGET1_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 & !(1 << 3)) | ((value as u32 & 1) << 3);
        self.w
    }
}
#[doc = "Field `target2` reader - "]
pub struct TARGET2_R(crate::FieldReader<bool, bool>);
impl TARGET2_R {
    #[inline(always)]
    pub(crate) fn new(bits: bool) -> Self {
        TARGET2_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for TARGET2_R {
    type Target = crate::FieldReader<bool, bool>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `target2` writer - "]
pub struct TARGET2_W<'a> {
    w: &'a mut W,
}
impl<'a> TARGET2_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 & !(1 << 4)) | ((value as u32 & 1) << 4);
        self.w
    }
}
impl R {
    #[doc = "Bit 3"]
    #[inline(always)]
    pub fn target1(&self) -> TARGET1_R {
        TARGET1_R::new(((self.bits >> 3) & 1) != 0)
    }
    #[doc = "Bit 4"]
    #[inline(always)]
    pub fn target2(&self) -> TARGET2_R {
        TARGET2_R::new(((self.bits >> 4) & 1) != 0)
    }
}
impl W {
    #[doc = "Bit 3"]
    #[inline(always)]
    pub fn target1(&mut self) -> TARGET1_W {
        TARGET1_W { w: self }
    }
    #[doc = "Bit 4"]
    #[inline(always)]
    pub fn target2(&mut self) -> TARGET2_W {
        TARGET2_W { w: self }
    }
    #[doc = "Writes raw bits to the register."]
    #[inline(always)]
    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
        self.0.bits(bits);
        self
    }
}
#[doc = "Control where the cache is mapped (unconfirmed)\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 [spi_cache_target]
(index.html) module"]
pub struct SPI_CACHE_TARGET_SPEC;
impl crate::RegisterSpec for SPI_CACHE_TARGET_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [spi_cache_target::R]
(R) reader structure"]
impl crate::Readable for SPI_CACHE_TARGET_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [spi_cache_target::W]
(W) writer structure"]
impl crate::Writable for SPI_CACHE_TARGET_SPEC {
    type Writer = W;
}
#[doc = "`reset()` method sets SPI_CACHE_TARGET to value 0"]
impl crate::Resettable for SPI_CACHE_TARGET_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}