esp8266 0.0.2

A minimal peripheral access crate the ESP8266
Documentation
#[doc = "Reader of register GPIO_SIGMA_DELTA"]
pub type R = crate::R<u32, super::GPIO_SIGMA_DELTA>;
#[doc = "Writer for register GPIO_SIGMA_DELTA"]
pub type W = crate::W<u32, super::GPIO_SIGMA_DELTA>;
#[doc = "Register GPIO_SIGMA_DELTA `reset()`'s with value 0"]
impl crate::ResetValue for super::GPIO_SIGMA_DELTA {
    type Type = u32;
    #[inline(always)]
    fn reset_value() -> Self::Type {
        0
    }
}
#[doc = "Reader of field `SIGMA_DELTA_ENABLE`"]
pub type SIGMA_DELTA_ENABLE_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `SIGMA_DELTA_ENABLE`"]
pub struct SIGMA_DELTA_ENABLE_W<'a> {
    w: &'a mut W,
}
impl<'a> SIGMA_DELTA_ENABLE_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 << 16)) | (((value as u32) & 0x01) << 16);
        self.w
    }
}
#[doc = "Reader of field `SIGMA_DELTA_PRESCALAR`"]
pub type SIGMA_DELTA_PRESCALAR_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `SIGMA_DELTA_PRESCALAR`"]
pub struct SIGMA_DELTA_PRESCALAR_W<'a> {
    w: &'a mut W,
}
impl<'a> SIGMA_DELTA_PRESCALAR_W<'a> {
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8);
        self.w
    }
}
#[doc = "Reader of field `SIGMA_DELTA_TARGET`"]
pub type SIGMA_DELTA_TARGET_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `SIGMA_DELTA_TARGET`"]
pub struct SIGMA_DELTA_TARGET_W<'a> {
    w: &'a mut W,
}
impl<'a> SIGMA_DELTA_TARGET_W<'a> {
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff);
        self.w
    }
}
impl R {
    #[doc = "Bit 16"]
    #[inline(always)]
    pub fn sigma_delta_enable(&self) -> SIGMA_DELTA_ENABLE_R {
        SIGMA_DELTA_ENABLE_R::new(((self.bits >> 16) & 0x01) != 0)
    }
    #[doc = "Bits 8:15"]
    #[inline(always)]
    pub fn sigma_delta_prescalar(&self) -> SIGMA_DELTA_PRESCALAR_R {
        SIGMA_DELTA_PRESCALAR_R::new(((self.bits >> 8) & 0xff) as u8)
    }
    #[doc = "Bits 0:7"]
    #[inline(always)]
    pub fn sigma_delta_target(&self) -> SIGMA_DELTA_TARGET_R {
        SIGMA_DELTA_TARGET_R::new((self.bits & 0xff) as u8)
    }
}
impl W {
    #[doc = "Bit 16"]
    #[inline(always)]
    pub fn sigma_delta_enable(&mut self) -> SIGMA_DELTA_ENABLE_W {
        SIGMA_DELTA_ENABLE_W { w: self }
    }
    #[doc = "Bits 8:15"]
    #[inline(always)]
    pub fn sigma_delta_prescalar(&mut self) -> SIGMA_DELTA_PRESCALAR_W {
        SIGMA_DELTA_PRESCALAR_W { w: self }
    }
    #[doc = "Bits 0:7"]
    #[inline(always)]
    pub fn sigma_delta_target(&mut self) -> SIGMA_DELTA_TARGET_W {
        SIGMA_DELTA_TARGET_W { w: self }
    }
}