pub type R = crate::R<GRSTCTLrs>;
pub type W = crate::W<GRSTCTLrs>;
pub type CSRST_R = crate::BitReader;
pub type CSRST_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type PSRST_R = crate::BitReader;
pub type PSRST_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type RXFFLSH_R = crate::BitReader;
pub type RXFFLSH_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type TXFFLSH_R = crate::BitReader;
pub type TXFFLSH_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type TXFNUM_R = crate::FieldReader;
pub type TXFNUM_W<'a, REG> = crate::FieldWriter<'a, REG, 5>;
pub type DMAREQ_R = crate::BitReader;
pub type AHBIDL_R = crate::BitReader;
impl R {
#[inline(always)]
pub fn csrst(&self) -> CSRST_R {
CSRST_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn psrst(&self) -> PSRST_R {
PSRST_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn rxfflsh(&self) -> RXFFLSH_R {
RXFFLSH_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn txfflsh(&self) -> TXFFLSH_R {
TXFFLSH_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn txfnum(&self) -> TXFNUM_R {
TXFNUM_R::new(((self.bits >> 6) & 0x1f) as u8)
}
#[inline(always)]
pub fn dmareq(&self) -> DMAREQ_R {
DMAREQ_R::new(((self.bits >> 30) & 1) != 0)
}
#[inline(always)]
pub fn ahbidl(&self) -> AHBIDL_R {
AHBIDL_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("GRSTCTL")
.field("csrst", &self.csrst())
.field("psrst", &self.psrst())
.field("rxfflsh", &self.rxfflsh())
.field("txfflsh", &self.txfflsh())
.field("txfnum", &self.txfnum())
.field("dmareq", &self.dmareq())
.field("ahbidl", &self.ahbidl())
.finish()
}
}
impl W {
#[inline(always)]
pub fn csrst(&mut self) -> CSRST_W<GRSTCTLrs> {
CSRST_W::new(self, 0)
}
#[inline(always)]
pub fn psrst(&mut self) -> PSRST_W<GRSTCTLrs> {
PSRST_W::new(self, 1)
}
#[inline(always)]
pub fn rxfflsh(&mut self) -> RXFFLSH_W<GRSTCTLrs> {
RXFFLSH_W::new(self, 4)
}
#[inline(always)]
pub fn txfflsh(&mut self) -> TXFFLSH_W<GRSTCTLrs> {
TXFFLSH_W::new(self, 5)
}
#[inline(always)]
pub fn txfnum(&mut self) -> TXFNUM_W<GRSTCTLrs> {
TXFNUM_W::new(self, 6)
}
}
pub struct GRSTCTLrs;
impl crate::RegisterSpec for GRSTCTLrs {
type Ux = u32;
}
impl crate::Readable for GRSTCTLrs {}
impl crate::Writable for GRSTCTLrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for GRSTCTLrs {
const RESET_VALUE: u32 = 0x8000_0000;
}