#[doc = "Register `SLC_CONF0` reader"]
pub struct R(crate::R<SLC_CONF0_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<SLC_CONF0_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<SLC_CONF0_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<SLC_CONF0_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `SLC_CONF0` writer"]
pub struct W(crate::W<SLC_CONF0_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<SLC_CONF0_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<SLC_CONF0_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<SLC_CONF0_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `SLC_MODE` reader - "]
pub struct SLC_MODE_R(crate::FieldReader<u8, u8>);
impl SLC_MODE_R {
#[inline(always)]
pub(crate) fn new(bits: u8) -> Self {
SLC_MODE_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for SLC_MODE_R {
type Target = crate::FieldReader<u8, u8>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `SLC_MODE` writer - "]
pub struct SLC_MODE_W<'a> {
w: &'a mut W,
}
impl<'a> SLC_MODE_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 & !(3 << 12)) | ((value as u32 & 3) << 12);
self.w
}
}
#[doc = "Field `SLC_DATA_BURST_EN` reader - "]
pub struct SLC_DATA_BURST_EN_R(crate::FieldReader<bool, bool>);
impl SLC_DATA_BURST_EN_R {
#[inline(always)]
pub(crate) fn new(bits: bool) -> Self {
SLC_DATA_BURST_EN_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for SLC_DATA_BURST_EN_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `SLC_DATA_BURST_EN` writer - "]
pub struct SLC_DATA_BURST_EN_W<'a> {
w: &'a mut W,
}
impl<'a> SLC_DATA_BURST_EN_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 & !(1 << 9)) | ((value as u32 & 1) << 9);
self.w
}
}
#[doc = "Field `SLC_DSCR_BURST_EN` reader - "]
pub struct SLC_DSCR_BURST_EN_R(crate::FieldReader<bool, bool>);
impl SLC_DSCR_BURST_EN_R {
#[inline(always)]
pub(crate) fn new(bits: bool) -> Self {
SLC_DSCR_BURST_EN_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for SLC_DSCR_BURST_EN_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `SLC_DSCR_BURST_EN` writer - "]
pub struct SLC_DSCR_BURST_EN_W<'a> {
w: &'a mut W,
}
impl<'a> SLC_DSCR_BURST_EN_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 & !(1 << 8)) | ((value as u32 & 1) << 8);
self.w
}
}
#[doc = "Field `SLC_RX_NO_RESTART_CLR` reader - "]
pub struct SLC_RX_NO_RESTART_CLR_R(crate::FieldReader<bool, bool>);
impl SLC_RX_NO_RESTART_CLR_R {
#[inline(always)]
pub(crate) fn new(bits: bool) -> Self {
SLC_RX_NO_RESTART_CLR_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for SLC_RX_NO_RESTART_CLR_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `SLC_RX_NO_RESTART_CLR` writer - "]
pub struct SLC_RX_NO_RESTART_CLR_W<'a> {
w: &'a mut W,
}
impl<'a> SLC_RX_NO_RESTART_CLR_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 & !(1 << 7)) | ((value as u32 & 1) << 7);
self.w
}
}
#[doc = "Field `SLC_RX_AUTO_WRBACK` reader - "]
pub struct SLC_RX_AUTO_WRBACK_R(crate::FieldReader<bool, bool>);
impl SLC_RX_AUTO_WRBACK_R {
#[inline(always)]
pub(crate) fn new(bits: bool) -> Self {
SLC_RX_AUTO_WRBACK_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for SLC_RX_AUTO_WRBACK_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `SLC_RX_AUTO_WRBACK` writer - "]
pub struct SLC_RX_AUTO_WRBACK_W<'a> {
w: &'a mut W,
}
impl<'a> SLC_RX_AUTO_WRBACK_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 & !(1 << 6)) | ((value as u32 & 1) << 6);
self.w
}
}
#[doc = "Field `SLC_RX_LOOP_TEST` reader - "]
pub struct SLC_RX_LOOP_TEST_R(crate::FieldReader<bool, bool>);
impl SLC_RX_LOOP_TEST_R {
#[inline(always)]
pub(crate) fn new(bits: bool) -> Self {
SLC_RX_LOOP_TEST_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for SLC_RX_LOOP_TEST_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `SLC_RX_LOOP_TEST` writer - "]
pub struct SLC_RX_LOOP_TEST_W<'a> {
w: &'a mut W,
}
impl<'a> SLC_RX_LOOP_TEST_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 & !(1 << 5)) | ((value as u32 & 1) << 5);
self.w
}
}
#[doc = "Field `SLC_TX_LOOP_TEST` reader - "]
pub struct SLC_TX_LOOP_TEST_R(crate::FieldReader<bool, bool>);
impl SLC_TX_LOOP_TEST_R {
#[inline(always)]
pub(crate) fn new(bits: bool) -> Self {
SLC_TX_LOOP_TEST_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for SLC_TX_LOOP_TEST_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `SLC_TX_LOOP_TEST` writer - "]
pub struct SLC_TX_LOOP_TEST_W<'a> {
w: &'a mut W,
}
impl<'a> SLC_TX_LOOP_TEST_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 & !(1 << 4)) | ((value as u32 & 1) << 4);
self.w
}
}
#[doc = "Field `SLC_AHBM_RST` reader - "]
pub struct SLC_AHBM_RST_R(crate::FieldReader<bool, bool>);
impl SLC_AHBM_RST_R {
#[inline(always)]
pub(crate) fn new(bits: bool) -> Self {
SLC_AHBM_RST_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for SLC_AHBM_RST_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `SLC_AHBM_RST` writer - "]
pub struct SLC_AHBM_RST_W<'a> {
w: &'a mut W,
}
impl<'a> SLC_AHBM_RST_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 & !(1 << 3)) | ((value as u32 & 1) << 3);
self.w
}
}
#[doc = "Field `SLC_AHBM_FIFO_RST` reader - "]
pub struct SLC_AHBM_FIFO_RST_R(crate::FieldReader<bool, bool>);
impl SLC_AHBM_FIFO_RST_R {
#[inline(always)]
pub(crate) fn new(bits: bool) -> Self {
SLC_AHBM_FIFO_RST_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for SLC_AHBM_FIFO_RST_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `SLC_AHBM_FIFO_RST` writer - "]
pub struct SLC_AHBM_FIFO_RST_W<'a> {
w: &'a mut W,
}
impl<'a> SLC_AHBM_FIFO_RST_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 & !(1 << 2)) | ((value as u32 & 1) << 2);
self.w
}
}
#[doc = "Field `SLC_RXLINK_RST` reader - "]
pub struct SLC_RXLINK_RST_R(crate::FieldReader<bool, bool>);
impl SLC_RXLINK_RST_R {
#[inline(always)]
pub(crate) fn new(bits: bool) -> Self {
SLC_RXLINK_RST_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for SLC_RXLINK_RST_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `SLC_RXLINK_RST` writer - "]
pub struct SLC_RXLINK_RST_W<'a> {
w: &'a mut W,
}
impl<'a> SLC_RXLINK_RST_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 & !(1 << 1)) | ((value as u32 & 1) << 1);
self.w
}
}
#[doc = "Field `SLC_TXLINK_RST` reader - "]
pub struct SLC_TXLINK_RST_R(crate::FieldReader<bool, bool>);
impl SLC_TXLINK_RST_R {
#[inline(always)]
pub(crate) fn new(bits: bool) -> Self {
SLC_TXLINK_RST_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for SLC_TXLINK_RST_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `SLC_TXLINK_RST` writer - "]
pub struct SLC_TXLINK_RST_W<'a> {
w: &'a mut W,
}
impl<'a> SLC_TXLINK_RST_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 & !1) | (value as u32 & 1);
self.w
}
}
impl R {
#[doc = "Bits 12:13"]
#[inline(always)]
pub fn slc_mode(&self) -> SLC_MODE_R {
SLC_MODE_R::new(((self.bits >> 12) & 3) as u8)
}
#[doc = "Bit 9"]
#[inline(always)]
pub fn slc_data_burst_en(&self) -> SLC_DATA_BURST_EN_R {
SLC_DATA_BURST_EN_R::new(((self.bits >> 9) & 1) != 0)
}
#[doc = "Bit 8"]
#[inline(always)]
pub fn slc_dscr_burst_en(&self) -> SLC_DSCR_BURST_EN_R {
SLC_DSCR_BURST_EN_R::new(((self.bits >> 8) & 1) != 0)
}
#[doc = "Bit 7"]
#[inline(always)]
pub fn slc_rx_no_restart_clr(&self) -> SLC_RX_NO_RESTART_CLR_R {
SLC_RX_NO_RESTART_CLR_R::new(((self.bits >> 7) & 1) != 0)
}
#[doc = "Bit 6"]
#[inline(always)]
pub fn slc_rx_auto_wrback(&self) -> SLC_RX_AUTO_WRBACK_R {
SLC_RX_AUTO_WRBACK_R::new(((self.bits >> 6) & 1) != 0)
}
#[doc = "Bit 5"]
#[inline(always)]
pub fn slc_rx_loop_test(&self) -> SLC_RX_LOOP_TEST_R {
SLC_RX_LOOP_TEST_R::new(((self.bits >> 5) & 1) != 0)
}
#[doc = "Bit 4"]
#[inline(always)]
pub fn slc_tx_loop_test(&self) -> SLC_TX_LOOP_TEST_R {
SLC_TX_LOOP_TEST_R::new(((self.bits >> 4) & 1) != 0)
}
#[doc = "Bit 3"]
#[inline(always)]
pub fn slc_ahbm_rst(&self) -> SLC_AHBM_RST_R {
SLC_AHBM_RST_R::new(((self.bits >> 3) & 1) != 0)
}
#[doc = "Bit 2"]
#[inline(always)]
pub fn slc_ahbm_fifo_rst(&self) -> SLC_AHBM_FIFO_RST_R {
SLC_AHBM_FIFO_RST_R::new(((self.bits >> 2) & 1) != 0)
}
#[doc = "Bit 1"]
#[inline(always)]
pub fn slc_rxlink_rst(&self) -> SLC_RXLINK_RST_R {
SLC_RXLINK_RST_R::new(((self.bits >> 1) & 1) != 0)
}
#[doc = "Bit 0"]
#[inline(always)]
pub fn slc_txlink_rst(&self) -> SLC_TXLINK_RST_R {
SLC_TXLINK_RST_R::new((self.bits & 1) != 0)
}
}
impl W {
#[doc = "Bits 12:13"]
#[inline(always)]
pub fn slc_mode(&mut self) -> SLC_MODE_W {
SLC_MODE_W { w: self }
}
#[doc = "Bit 9"]
#[inline(always)]
pub fn slc_data_burst_en(&mut self) -> SLC_DATA_BURST_EN_W {
SLC_DATA_BURST_EN_W { w: self }
}
#[doc = "Bit 8"]
#[inline(always)]
pub fn slc_dscr_burst_en(&mut self) -> SLC_DSCR_BURST_EN_W {
SLC_DSCR_BURST_EN_W { w: self }
}
#[doc = "Bit 7"]
#[inline(always)]
pub fn slc_rx_no_restart_clr(&mut self) -> SLC_RX_NO_RESTART_CLR_W {
SLC_RX_NO_RESTART_CLR_W { w: self }
}
#[doc = "Bit 6"]
#[inline(always)]
pub fn slc_rx_auto_wrback(&mut self) -> SLC_RX_AUTO_WRBACK_W {
SLC_RX_AUTO_WRBACK_W { w: self }
}
#[doc = "Bit 5"]
#[inline(always)]
pub fn slc_rx_loop_test(&mut self) -> SLC_RX_LOOP_TEST_W {
SLC_RX_LOOP_TEST_W { w: self }
}
#[doc = "Bit 4"]
#[inline(always)]
pub fn slc_tx_loop_test(&mut self) -> SLC_TX_LOOP_TEST_W {
SLC_TX_LOOP_TEST_W { w: self }
}
#[doc = "Bit 3"]
#[inline(always)]
pub fn slc_ahbm_rst(&mut self) -> SLC_AHBM_RST_W {
SLC_AHBM_RST_W { w: self }
}
#[doc = "Bit 2"]
#[inline(always)]
pub fn slc_ahbm_fifo_rst(&mut self) -> SLC_AHBM_FIFO_RST_W {
SLC_AHBM_FIFO_RST_W { w: self }
}
#[doc = "Bit 1"]
#[inline(always)]
pub fn slc_rxlink_rst(&mut self) -> SLC_RXLINK_RST_W {
SLC_RXLINK_RST_W { w: self }
}
#[doc = "Bit 0"]
#[inline(always)]
pub fn slc_txlink_rst(&mut self) -> SLC_TXLINK_RST_W {
SLC_TXLINK_RST_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 = "SLC_CONF0\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 [slc_conf0]
(index.html) module"]
pub struct SLC_CONF0_SPEC;
impl crate::RegisterSpec for SLC_CONF0_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [slc_conf0::R]
(R) reader structure"]
impl crate::Readable for SLC_CONF0_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [slc_conf0::W]
(W) writer structure"]
impl crate::Writable for SLC_CONF0_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets SLC_CONF0 to value 0"]
impl crate::Resettable for SLC_CONF0_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}