#[doc = "Register `DMAINTEN` reader"]
pub type R = crate::R<DmaintenSpec>;
#[doc = "Register `DMAINTEN` writer"]
pub type W = crate::W<DmaintenSpec>;
#[doc = "Channel 0 interrupt enable"]
pub use crate::gd32f190::timer0::dmainten::Ch0ie;
#[doc = "Field `CH0IE` reader - Channel 0 interrupt enable"]
pub use crate::gd32f190::timer0::dmainten::Ch0ieR;
#[doc = "Field `CH0IE` writer - Channel 0 interrupt enable"]
pub use crate::gd32f190::timer0::dmainten::Ch0ieW;
#[doc = "Update interrupt enable"]
pub use crate::gd32f190::timer0::dmainten::Upie;
#[doc = "Field `UPIE` reader - Update interrupt enable"]
pub use crate::gd32f190::timer0::dmainten::UpieR;
#[doc = "Field `UPIE` writer - Update interrupt enable"]
pub use crate::gd32f190::timer0::dmainten::UpieW;
impl R {
#[doc = "Bit 0 - Update interrupt enable"]
#[inline(always)]
pub fn upie(&self) -> UpieR {
UpieR::new((self.bits & 1) != 0)
}
#[doc = "Bit 1 - Channel 0 interrupt enable"]
#[inline(always)]
pub fn ch0ie(&self) -> Ch0ieR {
Ch0ieR::new(((self.bits >> 1) & 1) != 0)
}
}
impl W {
#[doc = "Bit 0 - Update interrupt enable"]
#[inline(always)]
#[must_use]
pub fn upie(&mut self) -> UpieW<DmaintenSpec> {
UpieW::new(self, 0)
}
#[doc = "Bit 1 - Channel 0 interrupt enable"]
#[inline(always)]
#[must_use]
pub fn ch0ie(&mut self) -> Ch0ieW<DmaintenSpec> {
Ch0ieW::new(self, 1)
}
}
#[doc = "Interrupt enable register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dmainten::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dmainten::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct DmaintenSpec;
impl crate::RegisterSpec for DmaintenSpec {
type Ux = u16;
}
#[doc = "`read()` method returns [`dmainten::R`](R) reader structure"]
impl crate::Readable for DmaintenSpec {}
#[doc = "`write(|w| ..)` method takes [`dmainten::W`](W) writer structure"]
impl crate::Writable for DmaintenSpec {
type Safety = crate::Unsafe;
const ZERO_TO_MODIFY_FIELDS_BITMAP: u16 = 0;
const ONE_TO_MODIFY_FIELDS_BITMAP: u16 = 0;
}
#[doc = "`reset()` method sets DMAINTEN to value 0"]
impl crate::Resettable for DmaintenSpec {
const RESET_VALUE: u16 = 0;
}