#[doc = "Register `CLEARSRCTRAN` writer"]
pub type W = crate::W<ClearsrctranSpec>;
#[doc = "Clear Interrupt Status and Raw Status for channel 0\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Ch0 {
#[doc = "0: no effect"]
Value1 = 0,
#[doc = "1: clear status"]
Value2 = 1,
}
impl From<Ch0> for bool {
#[inline(always)]
fn from(variant: Ch0) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `CH0` writer - Clear Interrupt Status and Raw Status for channel 0"]
pub type Ch0W<'a, REG> = crate::BitWriter<'a, REG, Ch0>;
impl<'a, REG> Ch0W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[doc = "no effect"]
#[inline(always)]
pub fn value1(self) -> &'a mut crate::W<REG> {
self.variant(Ch0::Value1)
}
#[doc = "clear status"]
#[inline(always)]
pub fn value2(self) -> &'a mut crate::W<REG> {
self.variant(Ch0::Value2)
}
}
#[doc = "Clear Interrupt Status and Raw Status for channel 1\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Ch1 {
#[doc = "0: no effect"]
Value1 = 0,
#[doc = "1: clear status"]
Value2 = 1,
}
impl From<Ch1> for bool {
#[inline(always)]
fn from(variant: Ch1) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `CH1` writer - Clear Interrupt Status and Raw Status for channel 1"]
pub type Ch1W<'a, REG> = crate::BitWriter<'a, REG, Ch1>;
impl<'a, REG> Ch1W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[doc = "no effect"]
#[inline(always)]
pub fn value1(self) -> &'a mut crate::W<REG> {
self.variant(Ch1::Value1)
}
#[doc = "clear status"]
#[inline(always)]
pub fn value2(self) -> &'a mut crate::W<REG> {
self.variant(Ch1::Value2)
}
}
#[doc = "Clear Interrupt Status and Raw Status for channel 2\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Ch2 {
#[doc = "0: no effect"]
Value1 = 0,
#[doc = "1: clear status"]
Value2 = 1,
}
impl From<Ch2> for bool {
#[inline(always)]
fn from(variant: Ch2) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `CH2` writer - Clear Interrupt Status and Raw Status for channel 2"]
pub type Ch2W<'a, REG> = crate::BitWriter<'a, REG, Ch2>;
impl<'a, REG> Ch2W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[doc = "no effect"]
#[inline(always)]
pub fn value1(self) -> &'a mut crate::W<REG> {
self.variant(Ch2::Value1)
}
#[doc = "clear status"]
#[inline(always)]
pub fn value2(self) -> &'a mut crate::W<REG> {
self.variant(Ch2::Value2)
}
}
#[doc = "Clear Interrupt Status and Raw Status for channel 3\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Ch3 {
#[doc = "0: no effect"]
Value1 = 0,
#[doc = "1: clear status"]
Value2 = 1,
}
impl From<Ch3> for bool {
#[inline(always)]
fn from(variant: Ch3) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `CH3` writer - Clear Interrupt Status and Raw Status for channel 3"]
pub type Ch3W<'a, REG> = crate::BitWriter<'a, REG, Ch3>;
impl<'a, REG> Ch3W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[doc = "no effect"]
#[inline(always)]
pub fn value1(self) -> &'a mut crate::W<REG> {
self.variant(Ch3::Value1)
}
#[doc = "clear status"]
#[inline(always)]
pub fn value2(self) -> &'a mut crate::W<REG> {
self.variant(Ch3::Value2)
}
}
impl W {
#[doc = "Bit 0 - Clear Interrupt Status and Raw Status for channel 0"]
#[inline(always)]
#[must_use]
pub fn ch0(&mut self) -> Ch0W<ClearsrctranSpec> {
Ch0W::new(self, 0)
}
#[doc = "Bit 1 - Clear Interrupt Status and Raw Status for channel 1"]
#[inline(always)]
#[must_use]
pub fn ch1(&mut self) -> Ch1W<ClearsrctranSpec> {
Ch1W::new(self, 1)
}
#[doc = "Bit 2 - Clear Interrupt Status and Raw Status for channel 2"]
#[inline(always)]
#[must_use]
pub fn ch2(&mut self) -> Ch2W<ClearsrctranSpec> {
Ch2W::new(self, 2)
}
#[doc = "Bit 3 - Clear Interrupt Status and Raw Status for channel 3"]
#[inline(always)]
#[must_use]
pub fn ch3(&mut self) -> Ch3W<ClearsrctranSpec> {
Ch3W::new(self, 3)
}
}
#[doc = "IntSrcTran Status\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`clearsrctran::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct ClearsrctranSpec;
impl crate::RegisterSpec for ClearsrctranSpec {
type Ux = u32;
}
#[doc = "`write(|w| ..)` method takes [`clearsrctran::W`](W) writer structure"]
impl crate::Writable for ClearsrctranSpec {
type Safety = crate::Unsafe;
const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
#[doc = "`reset()` method sets CLEARSRCTRAN to value 0"]
impl crate::Resettable for ClearsrctranSpec {
const RESET_VALUE: u32 = 0;
}