pub type R = crate::R<OENRrs>;
pub type W = crate::W<OENRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TOENR {
Disabled = 0,
Enabled = 1,
}
impl From<TOENR> for bool {
#[inline(always)]
fn from(variant: TOENR) -> Self {
variant as u8 != 0
}
}
pub type T1OEN_R = crate::BitReader<TOENR>;
impl T1OEN_R {
#[inline(always)]
pub const fn variant(&self) -> TOENR {
match self.bits {
false => TOENR::Disabled,
true => TOENR::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == TOENR::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == TOENR::Enabled
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TORNW {
Enable = 1,
}
impl From<TORNW> for bool {
#[inline(always)]
fn from(variant: TORNW) -> Self {
variant as u8 != 0
}
}
pub type T1OEN_W<'a, REG> = crate::BitWriter1S<'a, REG, TORNW>;
impl<'a, REG> T1OEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn enable(self) -> &'a mut crate::W<REG> {
self.variant(TORNW::Enable)
}
}
pub use T1OEN_R as T2OEN_R;
pub use T1OEN_W as T2OEN_W;
impl R {
#[inline(always)]
pub fn t1oen(&self, n: u8) -> T1OEN_R {
#[allow(clippy::no_effect)] [(); 5][n as usize];
T1OEN_R::new(((self.bits >> (n * 2)) & 1) != 0)
}
#[inline(always)]
pub fn t1oen_iter(&self) -> impl Iterator<Item = T1OEN_R> + '_ {
(0..5).map(move |n| T1OEN_R::new(((self.bits >> (n * 2)) & 1) != 0))
}
#[inline(always)]
pub fn ta1oen(&self) -> T1OEN_R {
T1OEN_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn tb1oen(&self) -> T1OEN_R {
T1OEN_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn tc1oen(&self) -> T1OEN_R {
T1OEN_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn td1oen(&self) -> T1OEN_R {
T1OEN_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn te1oen(&self) -> T1OEN_R {
T1OEN_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn t2oen(&self, n: u8) -> T2OEN_R {
#[allow(clippy::no_effect)] [(); 5][n as usize];
T2OEN_R::new(((self.bits >> (n * 2 + 1)) & 1) != 0)
}
#[inline(always)]
pub fn t2oen_iter(&self) -> impl Iterator<Item = T2OEN_R> + '_ {
(0..5).map(move |n| T2OEN_R::new(((self.bits >> (n * 2 + 1)) & 1) != 0))
}
#[inline(always)]
pub fn ta2oen(&self) -> T2OEN_R {
T2OEN_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn tb2oen(&self) -> T2OEN_R {
T2OEN_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn tc2oen(&self) -> T2OEN_R {
T2OEN_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn td2oen(&self) -> T2OEN_R {
T2OEN_R::new(((self.bits >> 7) & 1) != 0)
}
#[inline(always)]
pub fn te2oen(&self) -> T2OEN_R {
T2OEN_R::new(((self.bits >> 9) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("OENR")
.field("ta1oen", &self.ta1oen())
.field("tb1oen", &self.tb1oen())
.field("tc1oen", &self.tc1oen())
.field("td1oen", &self.td1oen())
.field("te1oen", &self.te1oen())
.field("ta2oen", &self.ta2oen())
.field("tb2oen", &self.tb2oen())
.field("tc2oen", &self.tc2oen())
.field("td2oen", &self.td2oen())
.field("te2oen", &self.te2oen())
.finish()
}
}
impl W {
#[inline(always)]
pub fn t1oen(&mut self, n: u8) -> T1OEN_W<OENRrs> {
#[allow(clippy::no_effect)] [(); 5][n as usize];
T1OEN_W::new(self, n * 2)
}
#[inline(always)]
pub fn ta1oen(&mut self) -> T1OEN_W<OENRrs> {
T1OEN_W::new(self, 0)
}
#[inline(always)]
pub fn tb1oen(&mut self) -> T1OEN_W<OENRrs> {
T1OEN_W::new(self, 2)
}
#[inline(always)]
pub fn tc1oen(&mut self) -> T1OEN_W<OENRrs> {
T1OEN_W::new(self, 4)
}
#[inline(always)]
pub fn td1oen(&mut self) -> T1OEN_W<OENRrs> {
T1OEN_W::new(self, 6)
}
#[inline(always)]
pub fn te1oen(&mut self) -> T1OEN_W<OENRrs> {
T1OEN_W::new(self, 8)
}
#[inline(always)]
pub fn t2oen(&mut self, n: u8) -> T2OEN_W<OENRrs> {
#[allow(clippy::no_effect)] [(); 5][n as usize];
T2OEN_W::new(self, n * 2 + 1)
}
#[inline(always)]
pub fn ta2oen(&mut self) -> T2OEN_W<OENRrs> {
T2OEN_W::new(self, 1)
}
#[inline(always)]
pub fn tb2oen(&mut self) -> T2OEN_W<OENRrs> {
T2OEN_W::new(self, 3)
}
#[inline(always)]
pub fn tc2oen(&mut self) -> T2OEN_W<OENRrs> {
T2OEN_W::new(self, 5)
}
#[inline(always)]
pub fn td2oen(&mut self) -> T2OEN_W<OENRrs> {
T2OEN_W::new(self, 7)
}
#[inline(always)]
pub fn te2oen(&mut self) -> T2OEN_W<OENRrs> {
T2OEN_W::new(self, 9)
}
}
pub struct OENRrs;
impl crate::RegisterSpec for OENRrs {
type Ux = u32;
}
impl crate::Readable for OENRrs {}
impl crate::Writable for OENRrs {
type Safety = crate::Unsafe;
const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0x03ff;
}
impl crate::Resettable for OENRrs {}