cc3220sf/arcm/
uart1swrst.rs1#[doc = "Reader of register UART1SWRST"]
2pub type R = crate::R<u32, super::UART1SWRST>;
3#[doc = "Writer for register UART1SWRST"]
4pub type W = crate::W<u32, super::UART1SWRST>;
5#[doc = "Register UART1SWRST `reset()`'s with value 0"]
6impl crate::ResetValue for super::UART1SWRST {
7 type Type = u32;
8 #[inline(always)]
9 fn reset_value() -> Self::Type {
10 0
11 }
12}
13#[doc = "Reader of field `ENSTS`"]
14pub type ENSTS_R = crate::R<bool, bool>;
15#[doc = "Reader of field `SWRST`"]
16pub type SWRST_R = crate::R<bool, bool>;
17#[doc = "Write proxy for field `SWRST`"]
18pub struct SWRST_W<'a> {
19 w: &'a mut W,
20}
21impl<'a> SWRST_W<'a> {
22 #[doc = r"Sets the field bit"]
23 #[inline(always)]
24 pub fn set_bit(self) -> &'a mut W {
25 self.bit(true)
26 }
27 #[doc = r"Clears the field bit"]
28 #[inline(always)]
29 pub fn clear_bit(self) -> &'a mut W {
30 self.bit(false)
31 }
32 #[doc = r"Writes raw bits to the field"]
33 #[inline(always)]
34 pub fn bit(self, value: bool) -> &'a mut W {
35 self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01);
36 self.w
37 }
38}
39impl R {
40 #[doc = "Bit 1 - UART_A1_ENABLED_STATUS"]
41 #[inline(always)]
42 pub fn ensts(&self) -> ENSTS_R {
43 ENSTS_R::new(((self.bits >> 1) & 0x01) != 0)
44 }
45 #[doc = "Bit 0 - UART_A1_SOFT_RESET"]
46 #[inline(always)]
47 pub fn swrst(&self) -> SWRST_R {
48 SWRST_R::new((self.bits & 0x01) != 0)
49 }
50}
51impl W {
52 #[doc = "Bit 0 - UART_A1_SOFT_RESET"]
53 #[inline(always)]
54 pub fn swrst(&mut self) -> SWRST_W {
55 SWRST_W { w: self }
56 }
57}