pub type R = crate::R<TISELrs>;
pub type W = crate::W<TISELrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum TI1SEL {
Selected = 0,
}
impl From<TI1SEL> for u8 {
#[inline(always)]
fn from(variant: TI1SEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for TI1SEL {
type Ux = u8;
}
impl crate::IsEnum for TI1SEL {}
pub type TI1SEL_R = crate::FieldReader<TI1SEL>;
impl TI1SEL_R {
#[inline(always)]
pub const fn variant(&self) -> Option<TI1SEL> {
match self.bits {
0 => Some(TI1SEL::Selected),
_ => None,
}
}
#[inline(always)]
pub fn is_selected(&self) -> bool {
*self == TI1SEL::Selected
}
}
pub type TI1SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 4, TI1SEL>;
impl<'a, REG> TI1SEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn selected(self) -> &'a mut crate::W<REG> {
self.variant(TI1SEL::Selected)
}
}
pub use TI1SEL_R as TI2SEL_R;
pub use TI1SEL_R as TI3SEL_R;
pub use TI1SEL_R as TI4SEL_R;
pub use TI1SEL_W as TI2SEL_W;
pub use TI1SEL_W as TI3SEL_W;
pub use TI1SEL_W as TI4SEL_W;
impl R {
#[inline(always)]
pub fn ti1sel(&self) -> TI1SEL_R {
TI1SEL_R::new((self.bits & 0x0f) as u8)
}
#[inline(always)]
pub fn ti2sel(&self) -> TI2SEL_R {
TI2SEL_R::new(((self.bits >> 8) & 0x0f) as u8)
}
#[inline(always)]
pub fn ti3sel(&self) -> TI3SEL_R {
TI3SEL_R::new(((self.bits >> 16) & 0x0f) as u8)
}
#[inline(always)]
pub fn ti4sel(&self) -> TI4SEL_R {
TI4SEL_R::new(((self.bits >> 24) & 0x0f) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("TISEL")
.field("ti1sel", &self.ti1sel())
.field("ti2sel", &self.ti2sel())
.field("ti3sel", &self.ti3sel())
.field("ti4sel", &self.ti4sel())
.finish()
}
}
impl W {
#[inline(always)]
pub fn ti1sel(&mut self) -> TI1SEL_W<TISELrs> {
TI1SEL_W::new(self, 0)
}
#[inline(always)]
pub fn ti2sel(&mut self) -> TI2SEL_W<TISELrs> {
TI2SEL_W::new(self, 8)
}
#[inline(always)]
pub fn ti3sel(&mut self) -> TI3SEL_W<TISELrs> {
TI3SEL_W::new(self, 16)
}
#[inline(always)]
pub fn ti4sel(&mut self) -> TI4SEL_W<TISELrs> {
TI4SEL_W::new(self, 24)
}
}
pub struct TISELrs;
impl crate::RegisterSpec for TISELrs {
type Ux = u32;
}
impl crate::Readable for TISELrs {}
impl crate::Writable for TISELrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for TISELrs {}