pub type R = crate::R<ODRrs>;
pub type W = crate::W<ODRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum OUTPUT_DATA {
Low = 0,
High = 1,
}
impl From<OUTPUT_DATA> for bool {
#[inline(always)]
fn from(variant: OUTPUT_DATA) -> Self {
variant as u8 != 0
}
}
pub type OD_R = crate::BitReader<OUTPUT_DATA>;
impl OD_R {
#[inline(always)]
pub const fn variant(&self) -> OUTPUT_DATA {
match self.bits {
false => OUTPUT_DATA::Low,
true => OUTPUT_DATA::High,
}
}
#[inline(always)]
pub fn is_low(&self) -> bool {
*self == OUTPUT_DATA::Low
}
#[inline(always)]
pub fn is_high(&self) -> bool {
*self == OUTPUT_DATA::High
}
}
pub type OD_W<'a, REG> = crate::BitWriter<'a, REG, OUTPUT_DATA>;
impl<'a, REG> OD_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn low(self) -> &'a mut crate::W<REG> {
self.variant(OUTPUT_DATA::Low)
}
#[inline(always)]
pub fn high(self) -> &'a mut crate::W<REG> {
self.variant(OUTPUT_DATA::High)
}
}
impl R {
#[inline(always)]
pub fn od(&self, n: u8) -> OD_R {
#[allow(clippy::no_effect)]
[(); 16][n as usize];
OD_R::new(((self.bits >> n) & 1) != 0)
}
#[inline(always)]
pub fn od_iter(&self) -> impl Iterator<Item = OD_R> + '_ {
(0..16).map(move |n| OD_R::new(((self.bits >> n) & 1) != 0))
}
#[inline(always)]
pub fn od0(&self) -> OD_R {
OD_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn od1(&self) -> OD_R {
OD_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn od2(&self) -> OD_R {
OD_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn od3(&self) -> OD_R {
OD_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn od4(&self) -> OD_R {
OD_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn od5(&self) -> OD_R {
OD_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn od6(&self) -> OD_R {
OD_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn od7(&self) -> OD_R {
OD_R::new(((self.bits >> 7) & 1) != 0)
}
#[inline(always)]
pub fn od8(&self) -> OD_R {
OD_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn od9(&self) -> OD_R {
OD_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn od10(&self) -> OD_R {
OD_R::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn od11(&self) -> OD_R {
OD_R::new(((self.bits >> 11) & 1) != 0)
}
#[inline(always)]
pub fn od12(&self) -> OD_R {
OD_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn od13(&self) -> OD_R {
OD_R::new(((self.bits >> 13) & 1) != 0)
}
#[inline(always)]
pub fn od14(&self) -> OD_R {
OD_R::new(((self.bits >> 14) & 1) != 0)
}
#[inline(always)]
pub fn od15(&self) -> OD_R {
OD_R::new(((self.bits >> 15) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("ODR")
.field("od0", &self.od0())
.field("od1", &self.od1())
.field("od2", &self.od2())
.field("od3", &self.od3())
.field("od4", &self.od4())
.field("od5", &self.od5())
.field("od6", &self.od6())
.field("od7", &self.od7())
.field("od8", &self.od8())
.field("od9", &self.od9())
.field("od10", &self.od10())
.field("od11", &self.od11())
.field("od12", &self.od12())
.field("od13", &self.od13())
.field("od14", &self.od14())
.field("od15", &self.od15())
.finish()
}
}
impl W {
#[inline(always)]
pub fn od(&mut self, n: u8) -> OD_W<ODRrs> {
#[allow(clippy::no_effect)]
[(); 16][n as usize];
OD_W::new(self, n)
}
#[inline(always)]
pub fn od0(&mut self) -> OD_W<ODRrs> {
OD_W::new(self, 0)
}
#[inline(always)]
pub fn od1(&mut self) -> OD_W<ODRrs> {
OD_W::new(self, 1)
}
#[inline(always)]
pub fn od2(&mut self) -> OD_W<ODRrs> {
OD_W::new(self, 2)
}
#[inline(always)]
pub fn od3(&mut self) -> OD_W<ODRrs> {
OD_W::new(self, 3)
}
#[inline(always)]
pub fn od4(&mut self) -> OD_W<ODRrs> {
OD_W::new(self, 4)
}
#[inline(always)]
pub fn od5(&mut self) -> OD_W<ODRrs> {
OD_W::new(self, 5)
}
#[inline(always)]
pub fn od6(&mut self) -> OD_W<ODRrs> {
OD_W::new(self, 6)
}
#[inline(always)]
pub fn od7(&mut self) -> OD_W<ODRrs> {
OD_W::new(self, 7)
}
#[inline(always)]
pub fn od8(&mut self) -> OD_W<ODRrs> {
OD_W::new(self, 8)
}
#[inline(always)]
pub fn od9(&mut self) -> OD_W<ODRrs> {
OD_W::new(self, 9)
}
#[inline(always)]
pub fn od10(&mut self) -> OD_W<ODRrs> {
OD_W::new(self, 10)
}
#[inline(always)]
pub fn od11(&mut self) -> OD_W<ODRrs> {
OD_W::new(self, 11)
}
#[inline(always)]
pub fn od12(&mut self) -> OD_W<ODRrs> {
OD_W::new(self, 12)
}
#[inline(always)]
pub fn od13(&mut self) -> OD_W<ODRrs> {
OD_W::new(self, 13)
}
#[inline(always)]
pub fn od14(&mut self) -> OD_W<ODRrs> {
OD_W::new(self, 14)
}
#[inline(always)]
pub fn od15(&mut self) -> OD_W<ODRrs> {
OD_W::new(self, 15)
}
}
pub struct ODRrs;
impl crate::RegisterSpec for ODRrs {
type Ux = u32;
}
impl crate::Readable for ODRrs {}
impl crate::Writable for ODRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for ODRrs {}