#[doc = "Register `CR` reader"]
pub struct R(crate::R<CR_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<CR_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<CR_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<CR_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `CR` writer"]
pub struct W(crate::W<CR_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<CR_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<CR_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<CR_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `ENABLE` reader - DCMI enable"]
pub struct ENABLE_R(crate::FieldReader<bool, bool>);
impl ENABLE_R {
pub(crate) fn new(bits: bool) -> Self {
ENABLE_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for ENABLE_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `ENABLE` writer - DCMI enable"]
pub struct ENABLE_W<'a> {
w: &'a mut W,
}
impl<'a> ENABLE_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14);
self.w
}
}
#[doc = "Field `EDM` reader - Extended data mode"]
pub struct EDM_R(crate::FieldReader<u8, u8>);
impl EDM_R {
pub(crate) fn new(bits: u8) -> Self {
EDM_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for EDM_R {
type Target = crate::FieldReader<u8, u8>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `EDM` writer - Extended data mode"]
pub struct EDM_W<'a> {
w: &'a mut W,
}
impl<'a> EDM_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x03 << 10)) | ((value as u32 & 0x03) << 10);
self.w
}
}
#[doc = "Field `FCRC` reader - Frame capture rate control"]
pub struct FCRC_R(crate::FieldReader<u8, u8>);
impl FCRC_R {
pub(crate) fn new(bits: u8) -> Self {
FCRC_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for FCRC_R {
type Target = crate::FieldReader<u8, u8>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `FCRC` writer - Frame capture rate control"]
pub struct FCRC_W<'a> {
w: &'a mut W,
}
impl<'a> FCRC_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x03 << 8)) | ((value as u32 & 0x03) << 8);
self.w
}
}
#[doc = "Field `VSPOL` reader - Vertical synchronization polarity"]
pub struct VSPOL_R(crate::FieldReader<bool, bool>);
impl VSPOL_R {
pub(crate) fn new(bits: bool) -> Self {
VSPOL_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for VSPOL_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `VSPOL` writer - Vertical synchronization polarity"]
pub struct VSPOL_W<'a> {
w: &'a mut W,
}
impl<'a> VSPOL_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7);
self.w
}
}
#[doc = "Field `HSPOL` reader - Horizontal synchronization polarity"]
pub struct HSPOL_R(crate::FieldReader<bool, bool>);
impl HSPOL_R {
pub(crate) fn new(bits: bool) -> Self {
HSPOL_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for HSPOL_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `HSPOL` writer - Horizontal synchronization polarity"]
pub struct HSPOL_W<'a> {
w: &'a mut W,
}
impl<'a> HSPOL_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6);
self.w
}
}
#[doc = "Field `PCKPOL` reader - Pixel clock polarity"]
pub struct PCKPOL_R(crate::FieldReader<bool, bool>);
impl PCKPOL_R {
pub(crate) fn new(bits: bool) -> Self {
PCKPOL_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for PCKPOL_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `PCKPOL` writer - Pixel clock polarity"]
pub struct PCKPOL_W<'a> {
w: &'a mut W,
}
impl<'a> PCKPOL_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5);
self.w
}
}
#[doc = "Field `ESS` reader - Embedded synchronization select"]
pub struct ESS_R(crate::FieldReader<bool, bool>);
impl ESS_R {
pub(crate) fn new(bits: bool) -> Self {
ESS_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for ESS_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `ESS` writer - Embedded synchronization select"]
pub struct ESS_W<'a> {
w: &'a mut W,
}
impl<'a> ESS_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4);
self.w
}
}
#[doc = "Field `JPEG` reader - JPEG format"]
pub struct JPEG_R(crate::FieldReader<bool, bool>);
impl JPEG_R {
pub(crate) fn new(bits: bool) -> Self {
JPEG_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for JPEG_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `JPEG` writer - JPEG format"]
pub struct JPEG_W<'a> {
w: &'a mut W,
}
impl<'a> JPEG_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3);
self.w
}
}
#[doc = "Field `CROP` reader - Crop feature"]
pub struct CROP_R(crate::FieldReader<bool, bool>);
impl CROP_R {
pub(crate) fn new(bits: bool) -> Self {
CROP_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for CROP_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `CROP` writer - Crop feature"]
pub struct CROP_W<'a> {
w: &'a mut W,
}
impl<'a> CROP_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2);
self.w
}
}
#[doc = "Field `CM` reader - Capture mode"]
pub struct CM_R(crate::FieldReader<bool, bool>);
impl CM_R {
pub(crate) fn new(bits: bool) -> Self {
CM_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for CM_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `CM` writer - Capture mode"]
pub struct CM_W<'a> {
w: &'a mut W,
}
impl<'a> CM_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1);
self.w
}
}
#[doc = "Field `CAPTURE` reader - Capture enable"]
pub struct CAPTURE_R(crate::FieldReader<bool, bool>);
impl CAPTURE_R {
pub(crate) fn new(bits: bool) -> Self {
CAPTURE_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for CAPTURE_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `CAPTURE` writer - Capture enable"]
pub struct CAPTURE_W<'a> {
w: &'a mut W,
}
impl<'a> CAPTURE_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01);
self.w
}
}
impl R {
#[doc = "Bit 14 - DCMI enable"]
#[inline(always)]
pub fn enable(&self) -> ENABLE_R {
ENABLE_R::new(((self.bits >> 14) & 0x01) != 0)
}
#[doc = "Bits 10:11 - Extended data mode"]
#[inline(always)]
pub fn edm(&self) -> EDM_R {
EDM_R::new(((self.bits >> 10) & 0x03) as u8)
}
#[doc = "Bits 8:9 - Frame capture rate control"]
#[inline(always)]
pub fn fcrc(&self) -> FCRC_R {
FCRC_R::new(((self.bits >> 8) & 0x03) as u8)
}
#[doc = "Bit 7 - Vertical synchronization polarity"]
#[inline(always)]
pub fn vspol(&self) -> VSPOL_R {
VSPOL_R::new(((self.bits >> 7) & 0x01) != 0)
}
#[doc = "Bit 6 - Horizontal synchronization polarity"]
#[inline(always)]
pub fn hspol(&self) -> HSPOL_R {
HSPOL_R::new(((self.bits >> 6) & 0x01) != 0)
}
#[doc = "Bit 5 - Pixel clock polarity"]
#[inline(always)]
pub fn pckpol(&self) -> PCKPOL_R {
PCKPOL_R::new(((self.bits >> 5) & 0x01) != 0)
}
#[doc = "Bit 4 - Embedded synchronization select"]
#[inline(always)]
pub fn ess(&self) -> ESS_R {
ESS_R::new(((self.bits >> 4) & 0x01) != 0)
}
#[doc = "Bit 3 - JPEG format"]
#[inline(always)]
pub fn jpeg(&self) -> JPEG_R {
JPEG_R::new(((self.bits >> 3) & 0x01) != 0)
}
#[doc = "Bit 2 - Crop feature"]
#[inline(always)]
pub fn crop(&self) -> CROP_R {
CROP_R::new(((self.bits >> 2) & 0x01) != 0)
}
#[doc = "Bit 1 - Capture mode"]
#[inline(always)]
pub fn cm(&self) -> CM_R {
CM_R::new(((self.bits >> 1) & 0x01) != 0)
}
#[doc = "Bit 0 - Capture enable"]
#[inline(always)]
pub fn capture(&self) -> CAPTURE_R {
CAPTURE_R::new((self.bits & 0x01) != 0)
}
}
impl W {
#[doc = "Bit 14 - DCMI enable"]
#[inline(always)]
pub fn enable(&mut self) -> ENABLE_W {
ENABLE_W { w: self }
}
#[doc = "Bits 10:11 - Extended data mode"]
#[inline(always)]
pub fn edm(&mut self) -> EDM_W {
EDM_W { w: self }
}
#[doc = "Bits 8:9 - Frame capture rate control"]
#[inline(always)]
pub fn fcrc(&mut self) -> FCRC_W {
FCRC_W { w: self }
}
#[doc = "Bit 7 - Vertical synchronization polarity"]
#[inline(always)]
pub fn vspol(&mut self) -> VSPOL_W {
VSPOL_W { w: self }
}
#[doc = "Bit 6 - Horizontal synchronization polarity"]
#[inline(always)]
pub fn hspol(&mut self) -> HSPOL_W {
HSPOL_W { w: self }
}
#[doc = "Bit 5 - Pixel clock polarity"]
#[inline(always)]
pub fn pckpol(&mut self) -> PCKPOL_W {
PCKPOL_W { w: self }
}
#[doc = "Bit 4 - Embedded synchronization select"]
#[inline(always)]
pub fn ess(&mut self) -> ESS_W {
ESS_W { w: self }
}
#[doc = "Bit 3 - JPEG format"]
#[inline(always)]
pub fn jpeg(&mut self) -> JPEG_W {
JPEG_W { w: self }
}
#[doc = "Bit 2 - Crop feature"]
#[inline(always)]
pub fn crop(&mut self) -> CROP_W {
CROP_W { w: self }
}
#[doc = "Bit 1 - Capture mode"]
#[inline(always)]
pub fn cm(&mut self) -> CM_W {
CM_W { w: self }
}
#[doc = "Bit 0 - Capture enable"]
#[inline(always)]
pub fn capture(&mut self) -> CAPTURE_W {
CAPTURE_W { w: self }
}
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "control register 1\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cr](index.html) module"]
pub struct CR_SPEC;
impl crate::RegisterSpec for CR_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [cr::R](R) reader structure"]
impl crate::Readable for CR_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [cr::W](W) writer structure"]
impl crate::Writable for CR_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets CR to value 0"]
impl crate::Resettable for CR_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}