corstone300_pac/ethernet/
tx_cfg.rs

1// Copyright 2022 Arm Limited and/or its affiliates <open-source-office@arm.com>
2//
3// SPDX-License-Identifier: MIT
4
5#[doc = "Register `TX_CFG` reader"]
6pub struct R(crate::R<TX_CFG_SPEC>);
7impl core::ops::Deref for R {
8    type Target = crate::R<TX_CFG_SPEC>;
9    #[inline(always)]
10    fn deref(&self) -> &Self::Target {
11        &self.0
12    }
13}
14impl From<crate::R<TX_CFG_SPEC>> for R {
15    #[inline(always)]
16    fn from(reader: crate::R<TX_CFG_SPEC>) -> Self {
17        R(reader)
18    }
19}
20#[doc = "Register `TX_CFG` writer"]
21pub struct W(crate::W<TX_CFG_SPEC>);
22impl core::ops::Deref for W {
23    type Target = crate::W<TX_CFG_SPEC>;
24    #[inline(always)]
25    fn deref(&self) -> &Self::Target {
26        &self.0
27    }
28}
29impl core::ops::DerefMut for W {
30    #[inline(always)]
31    fn deref_mut(&mut self) -> &mut Self::Target {
32        &mut self.0
33    }
34}
35impl From<crate::W<TX_CFG_SPEC>> for W {
36    #[inline(always)]
37    fn from(writer: crate::W<TX_CFG_SPEC>) -> Self {
38        W(writer)
39    }
40}
41#[doc = "Field `STOP_TX` reader - Stop Transmitter"]
42pub type STOP_TX_R = crate::BitReader<bool>;
43#[doc = "Field `STOP_TX` writer - Stop Transmitter"]
44pub type STOP_TX_W<'a, const O: u8> = crate::BitWriter<'a, u32, TX_CFG_SPEC, bool, O>;
45#[doc = "Field `TX_ON` reader - Transmitter Enable"]
46pub type TX_ON_R = crate::BitReader<bool>;
47#[doc = "Field `TX_ON` writer - Transmitter Enable"]
48pub type TX_ON_W<'a, const O: u8> = crate::BitWriter<'a, u32, TX_CFG_SPEC, bool, O>;
49#[doc = "Field `TXSAO` reader - TX Status Allow Overun"]
50pub type TXSAO_R = crate::BitReader<bool>;
51#[doc = "Field `TXSAO` writer - TX Status Allow Overun"]
52pub type TXSAO_W<'a, const O: u8> = crate::BitWriter<'a, u32, TX_CFG_SPEC, bool, O>;
53#[doc = "Field `TXD_DUMP` reader - Force TX Data Discard"]
54pub type TXD_DUMP_R = crate::BitReader<bool>;
55#[doc = "Field `TXD_DUMP` writer - Force TX Data Discard"]
56pub type TXD_DUMP_W<'a, const O: u8> = crate::BitWriter<'a, u32, TX_CFG_SPEC, bool, O>;
57#[doc = "Field `TXS_DUMP` reader - Force TX Status Discard"]
58pub type TXS_DUMP_R = crate::BitReader<bool>;
59#[doc = "Field `TXS_DUMP` writer - Force TX Status Discard"]
60pub type TXS_DUMP_W<'a, const O: u8> = crate::BitWriter<'a, u32, TX_CFG_SPEC, bool, O>;
61impl R {
62    #[doc = "Bit 0 - Stop Transmitter"]
63    #[inline(always)]
64    pub fn stop_tx(&self) -> STOP_TX_R {
65        STOP_TX_R::new((self.bits & 1) != 0)
66    }
67    #[doc = "Bit 1 - Transmitter Enable"]
68    #[inline(always)]
69    pub fn tx_on(&self) -> TX_ON_R {
70        TX_ON_R::new(((self.bits >> 1) & 1) != 0)
71    }
72    #[doc = "Bit 2 - TX Status Allow Overun"]
73    #[inline(always)]
74    pub fn txsao(&self) -> TXSAO_R {
75        TXSAO_R::new(((self.bits >> 2) & 1) != 0)
76    }
77    #[doc = "Bit 14 - Force TX Data Discard"]
78    #[inline(always)]
79    pub fn txd_dump(&self) -> TXD_DUMP_R {
80        TXD_DUMP_R::new(((self.bits >> 14) & 1) != 0)
81    }
82    #[doc = "Bit 15 - Force TX Status Discard"]
83    #[inline(always)]
84    pub fn txs_dump(&self) -> TXS_DUMP_R {
85        TXS_DUMP_R::new(((self.bits >> 15) & 1) != 0)
86    }
87}
88impl W {
89    #[doc = "Bit 0 - Stop Transmitter"]
90    #[inline(always)]
91    pub fn stop_tx(&mut self) -> STOP_TX_W<0> {
92        STOP_TX_W::new(self)
93    }
94    #[doc = "Bit 1 - Transmitter Enable"]
95    #[inline(always)]
96    pub fn tx_on(&mut self) -> TX_ON_W<1> {
97        TX_ON_W::new(self)
98    }
99    #[doc = "Bit 2 - TX Status Allow Overun"]
100    #[inline(always)]
101    pub fn txsao(&mut self) -> TXSAO_W<2> {
102        TXSAO_W::new(self)
103    }
104    #[doc = "Bit 14 - Force TX Data Discard"]
105    #[inline(always)]
106    pub fn txd_dump(&mut self) -> TXD_DUMP_W<14> {
107        TXD_DUMP_W::new(self)
108    }
109    #[doc = "Bit 15 - Force TX Status Discard"]
110    #[inline(always)]
111    pub fn txs_dump(&mut self) -> TXS_DUMP_W<15> {
112        TXS_DUMP_W::new(self)
113    }
114    #[doc = "Writes raw bits to the register."]
115    #[inline(always)]
116    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
117        self.0.bits(bits);
118        self
119    }
120}
121#[doc = "Transmit Configuration\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 [tx_cfg](index.html) module"]
122pub struct TX_CFG_SPEC;
123impl crate::RegisterSpec for TX_CFG_SPEC {
124    type Ux = u32;
125}
126#[doc = "`read()` method returns [tx_cfg::R](R) reader structure"]
127impl crate::Readable for TX_CFG_SPEC {
128    type Reader = R;
129}
130#[doc = "`write(|w| ..)` method takes [tx_cfg::W](W) writer structure"]
131impl crate::Writable for TX_CFG_SPEC {
132    type Writer = W;
133}
134#[doc = "`reset()` method sets TX_CFG to value 0"]
135impl crate::Resettable for TX_CFG_SPEC {
136    #[inline(always)]
137    fn reset_value() -> Self::Ux {
138        0
139    }
140}