#[doc = "Register `CH2STATUS` reader"]
pub struct R(crate::R<CH2STATUS_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<CH2STATUS_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::convert::From<crate::R<CH2STATUS_SPEC>> for R {
fn from(reader: crate::R<CH2STATUS_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `CH2STATUS` writer"]
pub struct W(crate::W<CH2STATUS_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<CH2STATUS_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 core::convert::From<crate::W<CH2STATUS_SPEC>> for W {
fn from(writer: crate::W<CH2STATUS_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `STATUS_CH2` reader - "]
pub struct STATUS_CH2_R(crate::FieldReader<u32, u32>);
impl STATUS_CH2_R {
pub(crate) fn new(bits: u32) -> Self {
STATUS_CH2_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for STATUS_CH2_R {
type Target = crate::FieldReader<u32, u32>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `STATUS_CH2` writer - "]
pub struct STATUS_CH2_W<'a> {
w: &'a mut W,
}
impl<'a> STATUS_CH2_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u32) -> &'a mut W {
self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xffff_ffff);
self.w
}
}
#[doc = "Field `APB_MEM_RD_ERR_CH2` reader - "]
pub struct APB_MEM_RD_ERR_CH2_R(crate::FieldReader<bool, bool>);
impl APB_MEM_RD_ERR_CH2_R {
pub(crate) fn new(bits: bool) -> Self {
APB_MEM_RD_ERR_CH2_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for APB_MEM_RD_ERR_CH2_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `APB_MEM_RD_ERR_CH2` writer - "]
pub struct APB_MEM_RD_ERR_CH2_W<'a> {
w: &'a mut W,
}
impl<'a> APB_MEM_RD_ERR_CH2_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 << 31)) | (((value as u32) & 0x01) << 31);
self.w
}
}
#[doc = "Field `APB_MEM_WR_ERR_CH2` reader - "]
pub struct APB_MEM_WR_ERR_CH2_R(crate::FieldReader<bool, bool>);
impl APB_MEM_WR_ERR_CH2_R {
pub(crate) fn new(bits: bool) -> Self {
APB_MEM_WR_ERR_CH2_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for APB_MEM_WR_ERR_CH2_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `APB_MEM_WR_ERR_CH2` writer - "]
pub struct APB_MEM_WR_ERR_CH2_W<'a> {
w: &'a mut W,
}
impl<'a> APB_MEM_WR_ERR_CH2_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 << 30)) | (((value as u32) & 0x01) << 30);
self.w
}
}
#[doc = "Field `MEM_EMPTY_CH2` reader - "]
pub struct MEM_EMPTY_CH2_R(crate::FieldReader<bool, bool>);
impl MEM_EMPTY_CH2_R {
pub(crate) fn new(bits: bool) -> Self {
MEM_EMPTY_CH2_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for MEM_EMPTY_CH2_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `MEM_EMPTY_CH2` writer - "]
pub struct MEM_EMPTY_CH2_W<'a> {
w: &'a mut W,
}
impl<'a> MEM_EMPTY_CH2_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 << 29)) | (((value as u32) & 0x01) << 29);
self.w
}
}
#[doc = "Field `MEM_FULL_CH2` reader - "]
pub struct MEM_FULL_CH2_R(crate::FieldReader<bool, bool>);
impl MEM_FULL_CH2_R {
pub(crate) fn new(bits: bool) -> Self {
MEM_FULL_CH2_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for MEM_FULL_CH2_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `MEM_FULL_CH2` writer - "]
pub struct MEM_FULL_CH2_W<'a> {
w: &'a mut W,
}
impl<'a> MEM_FULL_CH2_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 << 28)) | (((value as u32) & 0x01) << 28);
self.w
}
}
#[doc = "Field `MEM_OWNER_ERR_CH2` reader - "]
pub struct MEM_OWNER_ERR_CH2_R(crate::FieldReader<bool, bool>);
impl MEM_OWNER_ERR_CH2_R {
pub(crate) fn new(bits: bool) -> Self {
MEM_OWNER_ERR_CH2_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for MEM_OWNER_ERR_CH2_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `MEM_OWNER_ERR_CH2` writer - "]
pub struct MEM_OWNER_ERR_CH2_W<'a> {
w: &'a mut W,
}
impl<'a> MEM_OWNER_ERR_CH2_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 << 27)) | (((value as u32) & 0x01) << 27);
self.w
}
}
#[doc = "Field `STATE_CH2` reader - "]
pub struct STATE_CH2_R(crate::FieldReader<u8, u8>);
impl STATE_CH2_R {
pub(crate) fn new(bits: u8) -> Self {
STATE_CH2_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for STATE_CH2_R {
type Target = crate::FieldReader<u8, u8>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `STATE_CH2` writer - "]
pub struct STATE_CH2_W<'a> {
w: &'a mut W,
}
impl<'a> STATE_CH2_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 & !(0x07 << 24)) | (((value as u32) & 0x07) << 24);
self.w
}
}
#[doc = "Field `MEM_RADDR_EX_CH2` reader - "]
pub struct MEM_RADDR_EX_CH2_R(crate::FieldReader<u16, u16>);
impl MEM_RADDR_EX_CH2_R {
pub(crate) fn new(bits: u16) -> Self {
MEM_RADDR_EX_CH2_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for MEM_RADDR_EX_CH2_R {
type Target = crate::FieldReader<u16, u16>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `MEM_RADDR_EX_CH2` writer - "]
pub struct MEM_RADDR_EX_CH2_W<'a> {
w: &'a mut W,
}
impl<'a> MEM_RADDR_EX_CH2_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u16) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x03ff << 12)) | (((value as u32) & 0x03ff) << 12);
self.w
}
}
#[doc = "Field `MEM_WADDR_EX_CH2` reader - "]
pub struct MEM_WADDR_EX_CH2_R(crate::FieldReader<u16, u16>);
impl MEM_WADDR_EX_CH2_R {
pub(crate) fn new(bits: u16) -> Self {
MEM_WADDR_EX_CH2_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for MEM_WADDR_EX_CH2_R {
type Target = crate::FieldReader<u16, u16>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `MEM_WADDR_EX_CH2` writer - "]
pub struct MEM_WADDR_EX_CH2_W<'a> {
w: &'a mut W,
}
impl<'a> MEM_WADDR_EX_CH2_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u16) -> &'a mut W {
self.w.bits = (self.w.bits & !0x03ff) | ((value as u32) & 0x03ff);
self.w
}
}
impl R {
#[doc = "Bits 0:31"]
#[inline(always)]
pub fn status_ch2(&self) -> STATUS_CH2_R {
STATUS_CH2_R::new((self.bits & 0xffff_ffff) as u32)
}
#[doc = "Bit 31"]
#[inline(always)]
pub fn apb_mem_rd_err_ch2(&self) -> APB_MEM_RD_ERR_CH2_R {
APB_MEM_RD_ERR_CH2_R::new(((self.bits >> 31) & 0x01) != 0)
}
#[doc = "Bit 30"]
#[inline(always)]
pub fn apb_mem_wr_err_ch2(&self) -> APB_MEM_WR_ERR_CH2_R {
APB_MEM_WR_ERR_CH2_R::new(((self.bits >> 30) & 0x01) != 0)
}
#[doc = "Bit 29"]
#[inline(always)]
pub fn mem_empty_ch2(&self) -> MEM_EMPTY_CH2_R {
MEM_EMPTY_CH2_R::new(((self.bits >> 29) & 0x01) != 0)
}
#[doc = "Bit 28"]
#[inline(always)]
pub fn mem_full_ch2(&self) -> MEM_FULL_CH2_R {
MEM_FULL_CH2_R::new(((self.bits >> 28) & 0x01) != 0)
}
#[doc = "Bit 27"]
#[inline(always)]
pub fn mem_owner_err_ch2(&self) -> MEM_OWNER_ERR_CH2_R {
MEM_OWNER_ERR_CH2_R::new(((self.bits >> 27) & 0x01) != 0)
}
#[doc = "Bits 24:26"]
#[inline(always)]
pub fn state_ch2(&self) -> STATE_CH2_R {
STATE_CH2_R::new(((self.bits >> 24) & 0x07) as u8)
}
#[doc = "Bits 12:21"]
#[inline(always)]
pub fn mem_raddr_ex_ch2(&self) -> MEM_RADDR_EX_CH2_R {
MEM_RADDR_EX_CH2_R::new(((self.bits >> 12) & 0x03ff) as u16)
}
#[doc = "Bits 0:9"]
#[inline(always)]
pub fn mem_waddr_ex_ch2(&self) -> MEM_WADDR_EX_CH2_R {
MEM_WADDR_EX_CH2_R::new((self.bits & 0x03ff) as u16)
}
}
impl W {
#[doc = "Bits 0:31"]
#[inline(always)]
pub fn status_ch2(&mut self) -> STATUS_CH2_W {
STATUS_CH2_W { w: self }
}
#[doc = "Bit 31"]
#[inline(always)]
pub fn apb_mem_rd_err_ch2(&mut self) -> APB_MEM_RD_ERR_CH2_W {
APB_MEM_RD_ERR_CH2_W { w: self }
}
#[doc = "Bit 30"]
#[inline(always)]
pub fn apb_mem_wr_err_ch2(&mut self) -> APB_MEM_WR_ERR_CH2_W {
APB_MEM_WR_ERR_CH2_W { w: self }
}
#[doc = "Bit 29"]
#[inline(always)]
pub fn mem_empty_ch2(&mut self) -> MEM_EMPTY_CH2_W {
MEM_EMPTY_CH2_W { w: self }
}
#[doc = "Bit 28"]
#[inline(always)]
pub fn mem_full_ch2(&mut self) -> MEM_FULL_CH2_W {
MEM_FULL_CH2_W { w: self }
}
#[doc = "Bit 27"]
#[inline(always)]
pub fn mem_owner_err_ch2(&mut self) -> MEM_OWNER_ERR_CH2_W {
MEM_OWNER_ERR_CH2_W { w: self }
}
#[doc = "Bits 24:26"]
#[inline(always)]
pub fn state_ch2(&mut self) -> STATE_CH2_W {
STATE_CH2_W { w: self }
}
#[doc = "Bits 12:21"]
#[inline(always)]
pub fn mem_raddr_ex_ch2(&mut self) -> MEM_RADDR_EX_CH2_W {
MEM_RADDR_EX_CH2_W { w: self }
}
#[doc = "Bits 0:9"]
#[inline(always)]
pub fn mem_waddr_ex_ch2(&mut self) -> MEM_WADDR_EX_CH2_W {
MEM_WADDR_EX_CH2_W { w: self }
}
#[doc = "Writes raw bits to the register."]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "RMT_CH2STATUS\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 [ch2status](index.html) module"]
pub struct CH2STATUS_SPEC;
impl crate::RegisterSpec for CH2STATUS_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [ch2status::R](R) reader structure"]
impl crate::Readable for CH2STATUS_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [ch2status::W](W) writer structure"]
impl crate::Writable for CH2STATUS_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets CH2STATUS to value 0"]
impl crate::Resettable for CH2STATUS_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}