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)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SB {
Regular = 0,
SwapBytes = 1,
}
impl From<SB> for bool {
#[inline(always)]
fn from(variant: SB) -> Self {
variant as u8 != 0
}
}
pub type SB_R = crate::BitReader<SB>;
impl SB_R {
#[inline(always)]
pub const fn variant(&self) -> SB {
match self.bits {
false => SB::Regular,
true => SB::SwapBytes,
}
}
#[inline(always)]
pub fn is_regular(&self) -> bool {
*self == SB::Regular
}
#[inline(always)]
pub fn is_swap_bytes(&self) -> bool {
*self == SB::SwapBytes
}
}
pub type SB_W<'a, REG> = crate::BitWriter<'a, REG, SB>;
impl<'a, REG> SB_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn regular(self) -> &'a mut crate::W<REG> {
self.variant(SB::Regular)
}
#[inline(always)]
pub fn swap_bytes(self) -> &'a mut crate::W<REG> {
self.variant(SB::SwapBytes)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum AI {
RegularAlpha = 0,
InvertedAlpha = 1,
}
impl From<AI> for bool {
#[inline(always)]
fn from(variant: AI) -> Self {
variant as u8 != 0
}
}
pub type AI_R = crate::BitReader<AI>;
impl AI_R {
#[inline(always)]
pub const fn variant(&self) -> AI {
match self.bits {
false => AI::RegularAlpha,
true => AI::InvertedAlpha,
}
}
#[inline(always)]
pub fn is_regular_alpha(&self) -> bool {
*self == AI::RegularAlpha
}
#[inline(always)]
pub fn is_inverted_alpha(&self) -> bool {
*self == AI::InvertedAlpha
}
}
pub type AI_W<'a, REG> = crate::BitWriter<'a, REG, AI>;
impl<'a, REG> AI_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn regular_alpha(self) -> &'a mut crate::W<REG> {
self.variant(AI::RegularAlpha)
}
#[inline(always)]
pub fn inverted_alpha(self) -> &'a mut crate::W<REG> {
self.variant(AI::InvertedAlpha)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RBS {
Regular = 0,
Swap = 1,
}
impl From<RBS> for bool {
#[inline(always)]
fn from(variant: RBS) -> Self {
variant as u8 != 0
}
}
pub type RBS_R = crate::BitReader<RBS>;
impl RBS_R {
#[inline(always)]
pub const fn variant(&self) -> RBS {
match self.bits {
false => RBS::Regular,
true => RBS::Swap,
}
}
#[inline(always)]
pub fn is_regular(&self) -> bool {
*self == RBS::Regular
}
#[inline(always)]
pub fn is_swap(&self) -> bool {
*self == RBS::Swap
}
}
pub type RBS_W<'a, REG> = crate::BitWriter<'a, REG, RBS>;
impl<'a, REG> RBS_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn regular(self) -> &'a mut crate::W<REG> {
self.variant(RBS::Regular)
}
#[inline(always)]
pub fn swap(self) -> &'a mut crate::W<REG> {
self.variant(RBS::Swap)
}
}
impl R {
#[inline(always)]
pub fn cm(&self) -> CM_R {
CM_R::new((self.bits & 7) as u8)
}
#[inline(always)]
pub fn sb(&self) -> SB_R {
SB_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn ai(&self) -> AI_R {
AI_R::new(((self.bits >> 20) & 1) != 0)
}
#[inline(always)]
pub fn rbs(&self) -> RBS_R {
RBS_R::new(((self.bits >> 21) & 1) != 0)
}
}
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())
.field("ai", &self.ai())
.field("rbs", &self.rbs())
.field("sb", &self.sb())
.finish()
}
}
impl W {
#[inline(always)]
pub fn cm(&mut self) -> CM_W<OPFCCRrs> {
CM_W::new(self, 0)
}
#[inline(always)]
pub fn sb(&mut self) -> SB_W<OPFCCRrs> {
SB_W::new(self, 8)
}
#[inline(always)]
pub fn ai(&mut self) -> AI_W<OPFCCRrs> {
AI_W::new(self, 20)
}
#[inline(always)]
pub fn rbs(&mut self) -> RBS_W<OPFCCRrs> {
RBS_W::new(self, 21)
}
}
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 {}