pub type R = crate::R<CCRrs>;
pub type W = crate::W<CCRrs>;
pub type OTRIM_R = crate::FieldReader;
pub type OTRIM_W<'a, REG> = crate::FieldWriter<'a, REG, 5, u8, crate::Safe>;
impl R {
#[inline(always)]
pub fn otrim(&self, n: u8) -> OTRIM_R {
#[allow(clippy::no_effect)]
[(); 2][n as usize];
OTRIM_R::new(((self.bits >> (n * 16)) & 0x1f) as u8)
}
#[inline(always)]
pub fn otrim_iter(&self) -> impl Iterator<Item = OTRIM_R> + '_ {
(0..2).map(move |n| OTRIM_R::new(((self.bits >> (n * 16)) & 0x1f) as u8))
}
#[inline(always)]
pub fn otrim1(&self) -> OTRIM_R {
OTRIM_R::new((self.bits & 0x1f) as u8)
}
#[inline(always)]
pub fn otrim2(&self) -> OTRIM_R {
OTRIM_R::new(((self.bits >> 16) & 0x1f) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CCR")
.field("otrim1", &self.otrim1())
.field("otrim2", &self.otrim2())
.finish()
}
}
impl W {
#[inline(always)]
pub fn otrim(&mut self, n: u8) -> OTRIM_W<CCRrs> {
#[allow(clippy::no_effect)]
[(); 2][n as usize];
OTRIM_W::new(self, n * 16)
}
#[inline(always)]
pub fn otrim1(&mut self) -> OTRIM_W<CCRrs> {
OTRIM_W::new(self, 0)
}
#[inline(always)]
pub fn otrim2(&mut self) -> OTRIM_W<CCRrs> {
OTRIM_W::new(self, 16)
}
}
pub struct CCRrs;
impl crate::RegisterSpec for CCRrs {
type Ux = u32;
}
impl crate::Readable for CCRrs {}
impl crate::Writable for CCRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CCRrs {}