pub type R = crate::R<GI2CCTLrs>;
pub type W = crate::W<GI2CCTLrs>;
pub type RWDATA_R = crate::FieldReader;
pub type RWDATA_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
pub type REGADDR_R = crate::FieldReader;
pub type REGADDR_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
pub type ADDR_R = crate::FieldReader;
pub type ADDR_W<'a, REG> = crate::FieldWriter<'a, REG, 7>;
pub type I2CEN_R = crate::BitReader;
pub type I2CEN_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type ACK_R = crate::BitReader;
pub type ACK_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type I2CDEVADR_R = crate::FieldReader;
pub type I2CDEVADR_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
pub type I2CDATSE0_R = crate::BitReader;
pub type I2CDATSE0_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type RW_R = crate::BitReader;
pub type RW_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type BSYDNE_R = crate::BitReader;
pub type BSYDNE_W<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[inline(always)]
pub fn rwdata(&self) -> RWDATA_R {
RWDATA_R::new((self.bits & 0xff) as u8)
}
#[inline(always)]
pub fn regaddr(&self) -> REGADDR_R {
REGADDR_R::new(((self.bits >> 8) & 0xff) as u8)
}
#[inline(always)]
pub fn addr(&self) -> ADDR_R {
ADDR_R::new(((self.bits >> 16) & 0x7f) as u8)
}
#[inline(always)]
pub fn i2cen(&self) -> I2CEN_R {
I2CEN_R::new(((self.bits >> 23) & 1) != 0)
}
#[inline(always)]
pub fn ack(&self) -> ACK_R {
ACK_R::new(((self.bits >> 24) & 1) != 0)
}
#[inline(always)]
pub fn i2cdevadr(&self) -> I2CDEVADR_R {
I2CDEVADR_R::new(((self.bits >> 26) & 3) as u8)
}
#[inline(always)]
pub fn i2cdatse0(&self) -> I2CDATSE0_R {
I2CDATSE0_R::new(((self.bits >> 28) & 1) != 0)
}
#[inline(always)]
pub fn rw(&self) -> RW_R {
RW_R::new(((self.bits >> 30) & 1) != 0)
}
#[inline(always)]
pub fn bsydne(&self) -> BSYDNE_R {
BSYDNE_R::new(((self.bits >> 31) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("GI2CCTL")
.field("rwdata", &self.rwdata())
.field("regaddr", &self.regaddr())
.field("addr", &self.addr())
.field("i2cen", &self.i2cen())
.field("ack", &self.ack())
.field("i2cdevadr", &self.i2cdevadr())
.field("i2cdatse0", &self.i2cdatse0())
.field("rw", &self.rw())
.field("bsydne", &self.bsydne())
.finish()
}
}
impl W {
#[inline(always)]
pub fn rwdata(&mut self) -> RWDATA_W<GI2CCTLrs> {
RWDATA_W::new(self, 0)
}
#[inline(always)]
pub fn regaddr(&mut self) -> REGADDR_W<GI2CCTLrs> {
REGADDR_W::new(self, 8)
}
#[inline(always)]
pub fn addr(&mut self) -> ADDR_W<GI2CCTLrs> {
ADDR_W::new(self, 16)
}
#[inline(always)]
pub fn i2cen(&mut self) -> I2CEN_W<GI2CCTLrs> {
I2CEN_W::new(self, 23)
}
#[inline(always)]
pub fn ack(&mut self) -> ACK_W<GI2CCTLrs> {
ACK_W::new(self, 24)
}
#[inline(always)]
pub fn i2cdevadr(&mut self) -> I2CDEVADR_W<GI2CCTLrs> {
I2CDEVADR_W::new(self, 26)
}
#[inline(always)]
pub fn i2cdatse0(&mut self) -> I2CDATSE0_W<GI2CCTLrs> {
I2CDATSE0_W::new(self, 28)
}
#[inline(always)]
pub fn rw(&mut self) -> RW_W<GI2CCTLrs> {
RW_W::new(self, 30)
}
#[inline(always)]
pub fn bsydne(&mut self) -> BSYDNE_W<GI2CCTLrs> {
BSYDNE_W::new(self, 31)
}
}
pub struct GI2CCTLrs;
impl crate::RegisterSpec for GI2CCTLrs {
type Ux = u32;
}
impl crate::Readable for GI2CCTLrs {}
impl crate::Writable for GI2CCTLrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for GI2CCTLrs {
const RESET_VALUE: u32 = 0x0200_0400;
}