cc430f5137 0.1.0

Peripheral access API for CC430F5137 microcontroller
#[doc = "Register `PJDIR` reader"]
pub type R = crate::R<PjdirSpec>;
#[doc = "Register `PJDIR` writer"]
pub type W = crate::W<PjdirSpec>;
#[doc = "Field `PJDIR0` reader - PJDIR0"]
pub type Pjdir0R = crate::BitReader;
#[doc = "Field `PJDIR0` writer - PJDIR0"]
pub type Pjdir0W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `PJDIR1` reader - PJDIR1"]
pub type Pjdir1R = crate::BitReader;
#[doc = "Field `PJDIR1` writer - PJDIR1"]
pub type Pjdir1W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `PJDIR2` reader - PJDIR2"]
pub type Pjdir2R = crate::BitReader;
#[doc = "Field `PJDIR2` writer - PJDIR2"]
pub type Pjdir2W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `PJDIR3` reader - PJDIR3"]
pub type Pjdir3R = crate::BitReader;
#[doc = "Field `PJDIR3` writer - PJDIR3"]
pub type Pjdir3W<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
    #[doc = "Bit 0 - PJDIR0"]
    #[inline(always)]
    pub fn pjdir0(&self) -> Pjdir0R {
        Pjdir0R::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - PJDIR1"]
    #[inline(always)]
    pub fn pjdir1(&self) -> Pjdir1R {
        Pjdir1R::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bit 2 - PJDIR2"]
    #[inline(always)]
    pub fn pjdir2(&self) -> Pjdir2R {
        Pjdir2R::new(((self.bits >> 2) & 1) != 0)
    }
    #[doc = "Bit 3 - PJDIR3"]
    #[inline(always)]
    pub fn pjdir3(&self) -> Pjdir3R {
        Pjdir3R::new(((self.bits >> 3) & 1) != 0)
    }
}
impl W {
    #[doc = "Bit 0 - PJDIR0"]
    #[inline(always)]
    pub fn pjdir0(&mut self) -> Pjdir0W<'_, PjdirSpec> {
        Pjdir0W::new(self, 0)
    }
    #[doc = "Bit 1 - PJDIR1"]
    #[inline(always)]
    pub fn pjdir1(&mut self) -> Pjdir1W<'_, PjdirSpec> {
        Pjdir1W::new(self, 1)
    }
    #[doc = "Bit 2 - PJDIR2"]
    #[inline(always)]
    pub fn pjdir2(&mut self) -> Pjdir2W<'_, PjdirSpec> {
        Pjdir2W::new(self, 2)
    }
    #[doc = "Bit 3 - PJDIR3"]
    #[inline(always)]
    pub fn pjdir3(&mut self) -> Pjdir3W<'_, PjdirSpec> {
        Pjdir3W::new(self, 3)
    }
}
#[doc = "Port J Direction\n\nYou can [`read`](crate::Reg::read) this register and get [`pjdir::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pjdir::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct PjdirSpec;
impl crate::RegisterSpec for PjdirSpec {
    type Ux = u16;
}
#[doc = "`read()` method returns [`pjdir::R`](R) reader structure"]
impl crate::Readable for PjdirSpec {}
#[doc = "`write(|w| ..)` method takes [`pjdir::W`](W) writer structure"]
impl crate::Writable for PjdirSpec {
    type Safety = crate::Unsafe;
}
#[doc = "`reset()` method sets PJDIR to value 0"]
impl crate::Resettable for PjdirSpec {}