pub type R = crate::R<GCRrs>;
pub type W = crate::W<GCRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum LTDCEN {
Disabled = 0,
Enabled = 1,
}
impl From<LTDCEN> for bool {
#[inline(always)]
fn from(variant: LTDCEN) -> Self {
variant as u8 != 0
}
}
pub type LTDCEN_R = crate::BitReader<LTDCEN>;
impl LTDCEN_R {
#[inline(always)]
pub const fn variant(&self) -> LTDCEN {
match self.bits {
false => LTDCEN::Disabled,
true => LTDCEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == LTDCEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == LTDCEN::Enabled
}
}
pub type LTDCEN_W<'a, REG> = crate::BitWriter<'a, REG, LTDCEN>;
impl<'a, REG> LTDCEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(LTDCEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(LTDCEN::Enabled)
}
}
pub type DBW_R = crate::FieldReader;
pub type DGW_R = crate::FieldReader;
pub type DRW_R = crate::FieldReader;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DEN {
Disabled = 0,
Enabled = 1,
}
impl From<DEN> for bool {
#[inline(always)]
fn from(variant: DEN) -> Self {
variant as u8 != 0
}
}
pub type DEN_R = crate::BitReader<DEN>;
impl DEN_R {
#[inline(always)]
pub const fn variant(&self) -> DEN {
match self.bits {
false => DEN::Disabled,
true => DEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == DEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == DEN::Enabled
}
}
pub type DEN_W<'a, REG> = crate::BitWriter<'a, REG, DEN>;
impl<'a, REG> DEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(DEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(DEN::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PCPOL {
RisingEdge = 0,
FallingEdge = 1,
}
impl From<PCPOL> for bool {
#[inline(always)]
fn from(variant: PCPOL) -> Self {
variant as u8 != 0
}
}
pub type PCPOL_R = crate::BitReader<PCPOL>;
impl PCPOL_R {
#[inline(always)]
pub const fn variant(&self) -> PCPOL {
match self.bits {
false => PCPOL::RisingEdge,
true => PCPOL::FallingEdge,
}
}
#[inline(always)]
pub fn is_rising_edge(&self) -> bool {
*self == PCPOL::RisingEdge
}
#[inline(always)]
pub fn is_falling_edge(&self) -> bool {
*self == PCPOL::FallingEdge
}
}
pub type PCPOL_W<'a, REG> = crate::BitWriter<'a, REG, PCPOL>;
impl<'a, REG> PCPOL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn rising_edge(self) -> &'a mut crate::W<REG> {
self.variant(PCPOL::RisingEdge)
}
#[inline(always)]
pub fn falling_edge(self) -> &'a mut crate::W<REG> {
self.variant(PCPOL::FallingEdge)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DEPOL {
ActiveLow = 0,
ActiveHigh = 1,
}
impl From<DEPOL> for bool {
#[inline(always)]
fn from(variant: DEPOL) -> Self {
variant as u8 != 0
}
}
pub type DEPOL_R = crate::BitReader<DEPOL>;
impl DEPOL_R {
#[inline(always)]
pub const fn variant(&self) -> DEPOL {
match self.bits {
false => DEPOL::ActiveLow,
true => DEPOL::ActiveHigh,
}
}
#[inline(always)]
pub fn is_active_low(&self) -> bool {
*self == DEPOL::ActiveLow
}
#[inline(always)]
pub fn is_active_high(&self) -> bool {
*self == DEPOL::ActiveHigh
}
}
pub type DEPOL_W<'a, REG> = crate::BitWriter<'a, REG, DEPOL>;
impl<'a, REG> DEPOL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn active_low(self) -> &'a mut crate::W<REG> {
self.variant(DEPOL::ActiveLow)
}
#[inline(always)]
pub fn active_high(self) -> &'a mut crate::W<REG> {
self.variant(DEPOL::ActiveHigh)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum VSPOL {
ActiveLow = 0,
ActiveHigh = 1,
}
impl From<VSPOL> for bool {
#[inline(always)]
fn from(variant: VSPOL) -> Self {
variant as u8 != 0
}
}
pub type VSPOL_R = crate::BitReader<VSPOL>;
impl VSPOL_R {
#[inline(always)]
pub const fn variant(&self) -> VSPOL {
match self.bits {
false => VSPOL::ActiveLow,
true => VSPOL::ActiveHigh,
}
}
#[inline(always)]
pub fn is_active_low(&self) -> bool {
*self == VSPOL::ActiveLow
}
#[inline(always)]
pub fn is_active_high(&self) -> bool {
*self == VSPOL::ActiveHigh
}
}
pub type VSPOL_W<'a, REG> = crate::BitWriter<'a, REG, VSPOL>;
impl<'a, REG> VSPOL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn active_low(self) -> &'a mut crate::W<REG> {
self.variant(VSPOL::ActiveLow)
}
#[inline(always)]
pub fn active_high(self) -> &'a mut crate::W<REG> {
self.variant(VSPOL::ActiveHigh)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum HSPOL {
ActiveLow = 0,
ActiveHigh = 1,
}
impl From<HSPOL> for bool {
#[inline(always)]
fn from(variant: HSPOL) -> Self {
variant as u8 != 0
}
}
pub type HSPOL_R = crate::BitReader<HSPOL>;
impl HSPOL_R {
#[inline(always)]
pub const fn variant(&self) -> HSPOL {
match self.bits {
false => HSPOL::ActiveLow,
true => HSPOL::ActiveHigh,
}
}
#[inline(always)]
pub fn is_active_low(&self) -> bool {
*self == HSPOL::ActiveLow
}
#[inline(always)]
pub fn is_active_high(&self) -> bool {
*self == HSPOL::ActiveHigh
}
}
pub type HSPOL_W<'a, REG> = crate::BitWriter<'a, REG, HSPOL>;
impl<'a, REG> HSPOL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn active_low(self) -> &'a mut crate::W<REG> {
self.variant(HSPOL::ActiveLow)
}
#[inline(always)]
pub fn active_high(self) -> &'a mut crate::W<REG> {
self.variant(HSPOL::ActiveHigh)
}
}
impl R {
#[inline(always)]
pub fn ltdcen(&self) -> LTDCEN_R {
LTDCEN_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn dbw(&self) -> DBW_R {
DBW_R::new(((self.bits >> 4) & 7) as u8)
}
#[inline(always)]
pub fn dgw(&self) -> DGW_R {
DGW_R::new(((self.bits >> 8) & 7) as u8)
}
#[inline(always)]
pub fn drw(&self) -> DRW_R {
DRW_R::new(((self.bits >> 12) & 7) as u8)
}
#[inline(always)]
pub fn den(&self) -> DEN_R {
DEN_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn pcpol(&self) -> PCPOL_R {
PCPOL_R::new(((self.bits >> 28) & 1) != 0)
}
#[inline(always)]
pub fn depol(&self) -> DEPOL_R {
DEPOL_R::new(((self.bits >> 29) & 1) != 0)
}
#[inline(always)]
pub fn vspol(&self) -> VSPOL_R {
VSPOL_R::new(((self.bits >> 30) & 1) != 0)
}
#[inline(always)]
pub fn hspol(&self) -> HSPOL_R {
HSPOL_R::new(((self.bits >> 31) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("GCR")
.field("hspol", &self.hspol())
.field("vspol", &self.vspol())
.field("depol", &self.depol())
.field("pcpol", &self.pcpol())
.field("den", &self.den())
.field("drw", &self.drw())
.field("dgw", &self.dgw())
.field("dbw", &self.dbw())
.field("ltdcen", &self.ltdcen())
.finish()
}
}
impl W {
#[inline(always)]
pub fn ltdcen(&mut self) -> LTDCEN_W<GCRrs> {
LTDCEN_W::new(self, 0)
}
#[inline(always)]
pub fn den(&mut self) -> DEN_W<GCRrs> {
DEN_W::new(self, 16)
}
#[inline(always)]
pub fn pcpol(&mut self) -> PCPOL_W<GCRrs> {
PCPOL_W::new(self, 28)
}
#[inline(always)]
pub fn depol(&mut self) -> DEPOL_W<GCRrs> {
DEPOL_W::new(self, 29)
}
#[inline(always)]
pub fn vspol(&mut self) -> VSPOL_W<GCRrs> {
VSPOL_W::new(self, 30)
}
#[inline(always)]
pub fn hspol(&mut self) -> HSPOL_W<GCRrs> {
HSPOL_W::new(self, 31)
}
}
pub struct GCRrs;
impl crate::RegisterSpec for GCRrs {
type Ux = u32;
}
impl crate::Readable for GCRrs {}
impl crate::Writable for GCRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for GCRrs {
const RESET_VALUE: u32 = 0x2220;
}