pub type R = crate::R<D3PCR1Hrs>;
pub type W = crate::W<D3PCR1Hrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum PCS19 {
DmaCh6 = 0,
DmaCh7 = 1,
Lptim4 = 2,
Lptim5 = 3,
}
impl From<PCS19> for u8 {
#[inline(always)]
fn from(variant: PCS19) -> Self {
variant as _
}
}
impl crate::FieldSpec for PCS19 {
type Ux = u8;
}
impl crate::IsEnum for PCS19 {}
pub type PCS19_R = crate::FieldReader<PCS19>;
impl PCS19_R {
#[inline(always)]
pub const fn variant(&self) -> PCS19 {
match self.bits {
0 => PCS19::DmaCh6,
1 => PCS19::DmaCh7,
2 => PCS19::Lptim4,
3 => PCS19::Lptim5,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_dma_ch6(&self) -> bool {
*self == PCS19::DmaCh6
}
#[inline(always)]
pub fn is_dma_ch7(&self) -> bool {
*self == PCS19::DmaCh7
}
#[inline(always)]
pub fn is_lptim4(&self) -> bool {
*self == PCS19::Lptim4
}
#[inline(always)]
pub fn is_lptim5(&self) -> bool {
*self == PCS19::Lptim5
}
}
pub type PCS19_W<'a, REG> = crate::FieldWriter<'a, REG, 2, PCS19, crate::Safe>;
impl<'a, REG> PCS19_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn dma_ch6(self) -> &'a mut crate::W<REG> {
self.variant(PCS19::DmaCh6)
}
#[inline(always)]
pub fn dma_ch7(self) -> &'a mut crate::W<REG> {
self.variant(PCS19::DmaCh7)
}
#[inline(always)]
pub fn lptim4(self) -> &'a mut crate::W<REG> {
self.variant(PCS19::Lptim4)
}
#[inline(always)]
pub fn lptim5(self) -> &'a mut crate::W<REG> {
self.variant(PCS19::Lptim5)
}
}
pub use PCS19_R as PCS20_R;
pub use PCS19_R as PCS21_R;
pub use PCS19_R as PCS25_R;
pub use PCS19_W as PCS20_W;
pub use PCS19_W as PCS21_W;
pub use PCS19_W as PCS25_W;
impl R {
#[inline(always)]
pub fn pcs19(&self) -> PCS19_R {
PCS19_R::new(((self.bits >> 6) & 3) as u8)
}
#[inline(always)]
pub fn pcs20(&self) -> PCS20_R {
PCS20_R::new(((self.bits >> 8) & 3) as u8)
}
#[inline(always)]
pub fn pcs21(&self) -> PCS21_R {
PCS21_R::new(((self.bits >> 10) & 3) as u8)
}
#[inline(always)]
pub fn pcs25(&self) -> PCS25_R {
PCS25_R::new(((self.bits >> 18) & 3) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("D3PCR1H")
.field("pcs19", &self.pcs19())
.field("pcs20", &self.pcs20())
.field("pcs21", &self.pcs21())
.field("pcs25", &self.pcs25())
.finish()
}
}
impl W {
#[inline(always)]
pub fn pcs19(&mut self) -> PCS19_W<D3PCR1Hrs> {
PCS19_W::new(self, 6)
}
#[inline(always)]
pub fn pcs20(&mut self) -> PCS20_W<D3PCR1Hrs> {
PCS20_W::new(self, 8)
}
#[inline(always)]
pub fn pcs21(&mut self) -> PCS21_W<D3PCR1Hrs> {
PCS21_W::new(self, 10)
}
#[inline(always)]
pub fn pcs25(&mut self) -> PCS25_W<D3PCR1Hrs> {
PCS25_W::new(self, 18)
}
}
pub struct D3PCR1Hrs;
impl crate::RegisterSpec for D3PCR1Hrs {
type Ux = u32;
}
impl crate::Readable for D3PCR1Hrs {}
impl crate::Writable for D3PCR1Hrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for D3PCR1Hrs {}