#[doc = "Register `PORTJ` reader"]
pub struct R(crate::R<PORTJ_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<PORTJ_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::convert::From<crate::R<PORTJ_SPEC>> for R {
fn from(reader: crate::R<PORTJ_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `PORTJ` writer"]
pub struct W(crate::W<PORTJ_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<PORTJ_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<PORTJ_SPEC>> for W {
fn from(writer: crate::W<PORTJ_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `PJ0` reader - Pin J0"]
pub struct PJ0_R(crate::FieldReader<bool, bool>);
impl PJ0_R {
pub(crate) fn new(bits: bool) -> Self {
PJ0_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for PJ0_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `PJ0` writer - Pin J0"]
pub struct PJ0_W<'a> {
w: &'a mut W,
}
impl<'a> PJ0_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) | ((value as u8) & 0x01);
self.w
}
}
#[doc = "Field `PJ1` reader - Pin J1"]
pub struct PJ1_R(crate::FieldReader<bool, bool>);
impl PJ1_R {
pub(crate) fn new(bits: bool) -> Self {
PJ1_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for PJ1_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `PJ1` writer - Pin J1"]
pub struct PJ1_W<'a> {
w: &'a mut W,
}
impl<'a> PJ1_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 << 1)) | (((value as u8) & 0x01) << 1);
self.w
}
}
#[doc = "Field `PJ2` reader - Pin J2"]
pub struct PJ2_R(crate::FieldReader<bool, bool>);
impl PJ2_R {
pub(crate) fn new(bits: bool) -> Self {
PJ2_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for PJ2_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `PJ2` writer - Pin J2"]
pub struct PJ2_W<'a> {
w: &'a mut W,
}
impl<'a> PJ2_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 << 2)) | (((value as u8) & 0x01) << 2);
self.w
}
}
#[doc = "Field `PJ3` reader - Pin J3"]
pub struct PJ3_R(crate::FieldReader<bool, bool>);
impl PJ3_R {
pub(crate) fn new(bits: bool) -> Self {
PJ3_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for PJ3_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `PJ3` writer - Pin J3"]
pub struct PJ3_W<'a> {
w: &'a mut W,
}
impl<'a> PJ3_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 << 3)) | (((value as u8) & 0x01) << 3);
self.w
}
}
#[doc = "Field `PJ4` reader - Pin J4"]
pub struct PJ4_R(crate::FieldReader<bool, bool>);
impl PJ4_R {
pub(crate) fn new(bits: bool) -> Self {
PJ4_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for PJ4_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `PJ4` writer - Pin J4"]
pub struct PJ4_W<'a> {
w: &'a mut W,
}
impl<'a> PJ4_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 << 4)) | (((value as u8) & 0x01) << 4);
self.w
}
}
#[doc = "Field `PJ5` reader - Pin J5"]
pub struct PJ5_R(crate::FieldReader<bool, bool>);
impl PJ5_R {
pub(crate) fn new(bits: bool) -> Self {
PJ5_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for PJ5_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `PJ5` writer - Pin J5"]
pub struct PJ5_W<'a> {
w: &'a mut W,
}
impl<'a> PJ5_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 << 5)) | (((value as u8) & 0x01) << 5);
self.w
}
}
#[doc = "Field `PJ6` reader - Pin J6"]
pub struct PJ6_R(crate::FieldReader<bool, bool>);
impl PJ6_R {
pub(crate) fn new(bits: bool) -> Self {
PJ6_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for PJ6_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `PJ6` writer - Pin J6"]
pub struct PJ6_W<'a> {
w: &'a mut W,
}
impl<'a> PJ6_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 << 6)) | (((value as u8) & 0x01) << 6);
self.w
}
}
#[doc = "Field `PJ7` reader - Pin J7"]
pub struct PJ7_R(crate::FieldReader<bool, bool>);
impl PJ7_R {
pub(crate) fn new(bits: bool) -> Self {
PJ7_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for PJ7_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `PJ7` writer - Pin J7"]
pub struct PJ7_W<'a> {
w: &'a mut W,
}
impl<'a> PJ7_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 << 7)) | (((value as u8) & 0x01) << 7);
self.w
}
}
impl R {
#[doc = "Bit 0 - Pin J0"]
#[inline(always)]
pub fn pj0(&self) -> PJ0_R {
PJ0_R::new((self.bits & 0x01) != 0)
}
#[doc = "Bit 1 - Pin J1"]
#[inline(always)]
pub fn pj1(&self) -> PJ1_R {
PJ1_R::new(((self.bits >> 1) & 0x01) != 0)
}
#[doc = "Bit 2 - Pin J2"]
#[inline(always)]
pub fn pj2(&self) -> PJ2_R {
PJ2_R::new(((self.bits >> 2) & 0x01) != 0)
}
#[doc = "Bit 3 - Pin J3"]
#[inline(always)]
pub fn pj3(&self) -> PJ3_R {
PJ3_R::new(((self.bits >> 3) & 0x01) != 0)
}
#[doc = "Bit 4 - Pin J4"]
#[inline(always)]
pub fn pj4(&self) -> PJ4_R {
PJ4_R::new(((self.bits >> 4) & 0x01) != 0)
}
#[doc = "Bit 5 - Pin J5"]
#[inline(always)]
pub fn pj5(&self) -> PJ5_R {
PJ5_R::new(((self.bits >> 5) & 0x01) != 0)
}
#[doc = "Bit 6 - Pin J6"]
#[inline(always)]
pub fn pj6(&self) -> PJ6_R {
PJ6_R::new(((self.bits >> 6) & 0x01) != 0)
}
#[doc = "Bit 7 - Pin J7"]
#[inline(always)]
pub fn pj7(&self) -> PJ7_R {
PJ7_R::new(((self.bits >> 7) & 0x01) != 0)
}
}
impl W {
#[doc = "Bit 0 - Pin J0"]
#[inline(always)]
pub fn pj0(&mut self) -> PJ0_W {
PJ0_W { w: self }
}
#[doc = "Bit 1 - Pin J1"]
#[inline(always)]
pub fn pj1(&mut self) -> PJ1_W {
PJ1_W { w: self }
}
#[doc = "Bit 2 - Pin J2"]
#[inline(always)]
pub fn pj2(&mut self) -> PJ2_W {
PJ2_W { w: self }
}
#[doc = "Bit 3 - Pin J3"]
#[inline(always)]
pub fn pj3(&mut self) -> PJ3_W {
PJ3_W { w: self }
}
#[doc = "Bit 4 - Pin J4"]
#[inline(always)]
pub fn pj4(&mut self) -> PJ4_W {
PJ4_W { w: self }
}
#[doc = "Bit 5 - Pin J5"]
#[inline(always)]
pub fn pj5(&mut self) -> PJ5_W {
PJ5_W { w: self }
}
#[doc = "Bit 6 - Pin J6"]
#[inline(always)]
pub fn pj6(&mut self) -> PJ6_W {
PJ6_W { w: self }
}
#[doc = "Bit 7 - Pin J7"]
#[inline(always)]
pub fn pj7(&mut self) -> PJ7_W {
PJ7_W { w: self }
}
#[doc = "Writes raw bits to the register."]
pub unsafe fn bits(&mut self, bits: u8) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "PORT J Data Register\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 [portj](index.html) module"]
pub struct PORTJ_SPEC;
impl crate::RegisterSpec for PORTJ_SPEC {
type Ux = u8;
}
#[doc = "`read()` method returns [portj::R](R) reader structure"]
impl crate::Readable for PORTJ_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [portj::W](W) writer structure"]
impl crate::Writable for PORTJ_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets PORTJ to value 0"]
impl crate::Resettable for PORTJ_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}