pub type R = crate::R<PFCRrs>;
pub type W = crate::W<PFCRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum PF {
Argb8888 = 0,
Rgb888 = 1,
Rgb565 = 2,
Argb1555 = 3,
Argb4444 = 4,
L8 = 5,
Al44 = 6,
Al88 = 7,
}
impl From<PF> for u8 {
#[inline(always)]
fn from(variant: PF) -> Self {
variant as _
}
}
impl crate::FieldSpec for PF {
type Ux = u8;
}
impl crate::IsEnum for PF {}
pub type PF_R = crate::FieldReader<PF>;
impl PF_R {
#[inline(always)]
pub const fn variant(&self) -> PF {
match self.bits {
0 => PF::Argb8888,
1 => PF::Rgb888,
2 => PF::Rgb565,
3 => PF::Argb1555,
4 => PF::Argb4444,
5 => PF::L8,
6 => PF::Al44,
7 => PF::Al88,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_argb8888(&self) -> bool {
*self == PF::Argb8888
}
#[inline(always)]
pub fn is_rgb888(&self) -> bool {
*self == PF::Rgb888
}
#[inline(always)]
pub fn is_rgb565(&self) -> bool {
*self == PF::Rgb565
}
#[inline(always)]
pub fn is_argb1555(&self) -> bool {
*self == PF::Argb1555
}
#[inline(always)]
pub fn is_argb4444(&self) -> bool {
*self == PF::Argb4444
}
#[inline(always)]
pub fn is_l8(&self) -> bool {
*self == PF::L8
}
#[inline(always)]
pub fn is_al44(&self) -> bool {
*self == PF::Al44
}
#[inline(always)]
pub fn is_al88(&self) -> bool {
*self == PF::Al88
}
}
pub type PF_W<'a, REG> = crate::FieldWriter<'a, REG, 3, PF, crate::Safe>;
impl<'a, REG> PF_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(PF::Argb8888)
}
#[inline(always)]
pub fn rgb888(self) -> &'a mut crate::W<REG> {
self.variant(PF::Rgb888)
}
#[inline(always)]
pub fn rgb565(self) -> &'a mut crate::W<REG> {
self.variant(PF::Rgb565)
}
#[inline(always)]
pub fn argb1555(self) -> &'a mut crate::W<REG> {
self.variant(PF::Argb1555)
}
#[inline(always)]
pub fn argb4444(self) -> &'a mut crate::W<REG> {
self.variant(PF::Argb4444)
}
#[inline(always)]
pub fn l8(self) -> &'a mut crate::W<REG> {
self.variant(PF::L8)
}
#[inline(always)]
pub fn al44(self) -> &'a mut crate::W<REG> {
self.variant(PF::Al44)
}
#[inline(always)]
pub fn al88(self) -> &'a mut crate::W<REG> {
self.variant(PF::Al88)
}
}
impl R {
#[inline(always)]
pub fn pf(&self) -> PF_R {
PF_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("PFCR").field("pf", &self.pf()).finish()
}
}
impl W {
#[inline(always)]
pub fn pf(&mut self) -> PF_W<PFCRrs> {
PF_W::new(self, 0)
}
}
pub struct PFCRrs;
impl crate::RegisterSpec for PFCRrs {
type Ux = u32;
}
impl crate::Readable for PFCRrs {}
impl crate::Writable for PFCRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for PFCRrs {}