pub type R = crate::R<OPFCCRrs>;
pub type W = crate::W<OPFCCRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum CM {
Argb8888 = 0,
Rgb888 = 1,
Rgb565 = 2,
Argb1555 = 3,
Argb4444 = 4,
}
impl From<CM> for u8 {
#[inline(always)]
fn from(variant: CM) -> Self {
variant as _
}
}
impl crate::FieldSpec for CM {
type Ux = u8;
}
impl crate::IsEnum for CM {}
pub type CM_R = crate::FieldReader<CM>;
impl CM_R {
#[inline(always)]
pub const fn variant(&self) -> Option<CM> {
match self.bits {
0 => Some(CM::Argb8888),
1 => Some(CM::Rgb888),
2 => Some(CM::Rgb565),
3 => Some(CM::Argb1555),
4 => Some(CM::Argb4444),
_ => None,
}
}
#[inline(always)]
pub fn is_argb8888(&self) -> bool {
*self == CM::Argb8888
}
#[inline(always)]
pub fn is_rgb888(&self) -> bool {
*self == CM::Rgb888
}
#[inline(always)]
pub fn is_rgb565(&self) -> bool {
*self == CM::Rgb565
}
#[inline(always)]
pub fn is_argb1555(&self) -> bool {
*self == CM::Argb1555
}
#[inline(always)]
pub fn is_argb4444(&self) -> bool {
*self == CM::Argb4444
}
}
pub type CM_W<'a, REG> = crate::FieldWriter<'a, REG, 3, CM>;
impl<'a, REG> CM_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn argb8888(self) -> &'a mut crate::W<REG> {
self.variant(CM::Argb8888)
}
#[inline(always)]
pub fn rgb888(self) -> &'a mut crate::W<REG> {
self.variant(CM::Rgb888)
}
#[inline(always)]
pub fn rgb565(self) -> &'a mut crate::W<REG> {
self.variant(CM::Rgb565)
}
#[inline(always)]
pub fn argb1555(self) -> &'a mut crate::W<REG> {
self.variant(CM::Argb1555)
}
#[inline(always)]
pub fn argb4444(self) -> &'a mut crate::W<REG> {
self.variant(CM::Argb4444)
}
}
impl R {
#[inline(always)]
pub fn cm(&self) -> CM_R {
CM_R::new((self.bits & 7) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("OPFCCR").field("cm", &self.cm()).finish()
}
}
impl W {
#[inline(always)]
pub fn cm(&mut self) -> CM_W<OPFCCRrs> {
CM_W::new(self, 0)
}
}
pub struct OPFCCRrs;
impl crate::RegisterSpec for OPFCCRrs {
type Ux = u32;
}
impl crate::Readable for OPFCCRrs {}
impl crate::Writable for OPFCCRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for OPFCCRrs {}