#[doc = "Register `FIFOCFG` reader"]
pub struct R(crate::R<FIFOCFG_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<FIFOCFG_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::convert::From<crate::R<FIFOCFG_SPEC>> for R {
fn from(reader: crate::R<FIFOCFG_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `FIFOCFG` writer"]
pub struct W(crate::W<FIFOCFG_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<FIFOCFG_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<FIFOCFG_SPEC>> for W {
fn from(writer: crate::W<FIFOCFG_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Enable the transmit FIFO.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ENABLETX_A {
#[doc = "0: The transmit FIFO is not enabled."]
DISABLED = 0,
#[doc = "1: The transmit FIFO is enabled."]
ENABLED = 1,
}
impl From<ENABLETX_A> for bool {
#[inline(always)]
fn from(variant: ENABLETX_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `ENABLETX` reader - Enable the transmit FIFO."]
pub struct ENABLETX_R(crate::FieldReader<bool, ENABLETX_A>);
impl ENABLETX_R {
pub(crate) fn new(bits: bool) -> Self {
ENABLETX_R(crate::FieldReader::new(bits))
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> ENABLETX_A {
match self.bits {
false => ENABLETX_A::DISABLED,
true => ENABLETX_A::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
**self == ENABLETX_A::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
**self == ENABLETX_A::ENABLED
}
}
impl core::ops::Deref for ENABLETX_R {
type Target = crate::FieldReader<bool, ENABLETX_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `ENABLETX` writer - Enable the transmit FIFO."]
pub struct ENABLETX_W<'a> {
w: &'a mut W,
}
impl<'a> ENABLETX_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: ENABLETX_A) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "The transmit FIFO is not enabled."]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(ENABLETX_A::DISABLED)
}
#[doc = "The transmit FIFO is enabled."]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(ENABLETX_A::ENABLED)
}
#[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
}
}
#[doc = "Enable the receive FIFO.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ENABLERX_A {
#[doc = "0: The receive FIFO is not enabled."]
DISABLED = 0,
#[doc = "1: The receive FIFO is enabled."]
ENABLED = 1,
}
impl From<ENABLERX_A> for bool {
#[inline(always)]
fn from(variant: ENABLERX_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `ENABLERX` reader - Enable the receive FIFO."]
pub struct ENABLERX_R(crate::FieldReader<bool, ENABLERX_A>);
impl ENABLERX_R {
pub(crate) fn new(bits: bool) -> Self {
ENABLERX_R(crate::FieldReader::new(bits))
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> ENABLERX_A {
match self.bits {
false => ENABLERX_A::DISABLED,
true => ENABLERX_A::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
**self == ENABLERX_A::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
**self == ENABLERX_A::ENABLED
}
}
impl core::ops::Deref for ENABLERX_R {
type Target = crate::FieldReader<bool, ENABLERX_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `ENABLERX` writer - Enable the receive FIFO."]
pub struct ENABLERX_W<'a> {
w: &'a mut W,
}
impl<'a> ENABLERX_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: ENABLERX_A) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "The receive FIFO is not enabled."]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(ENABLERX_A::DISABLED)
}
#[doc = "The receive FIFO is enabled."]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(ENABLERX_A::ENABLED)
}
#[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 `SIZE` reader - FIFO size configuration. This is a read-only field. 0x0 = FIFO is configured as 16 entries of 8 bits. 0x1, 0x2, 0x3 = not applicable to USART."]
pub struct SIZE_R(crate::FieldReader<u8, u8>);
impl SIZE_R {
pub(crate) fn new(bits: u8) -> Self {
SIZE_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for SIZE_R {
type Target = crate::FieldReader<u8, u8>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "DMA configuration for transmit.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum DMATX_A {
#[doc = "0: DMA is not used for the transmit function."]
DISABLED = 0,
#[doc = "1: Trigger DMA for the transmit function if the FIFO is not full. Generally, data interrupts would be disabled if DMA is enabled."]
ENABLED = 1,
}
impl From<DMATX_A> for bool {
#[inline(always)]
fn from(variant: DMATX_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `DMATX` reader - DMA configuration for transmit."]
pub struct DMATX_R(crate::FieldReader<bool, DMATX_A>);
impl DMATX_R {
pub(crate) fn new(bits: bool) -> Self {
DMATX_R(crate::FieldReader::new(bits))
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> DMATX_A {
match self.bits {
false => DMATX_A::DISABLED,
true => DMATX_A::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
**self == DMATX_A::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
**self == DMATX_A::ENABLED
}
}
impl core::ops::Deref for DMATX_R {
type Target = crate::FieldReader<bool, DMATX_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `DMATX` writer - DMA configuration for transmit."]
pub struct DMATX_W<'a> {
w: &'a mut W,
}
impl<'a> DMATX_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: DMATX_A) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "DMA is not used for the transmit function."]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(DMATX_A::DISABLED)
}
#[doc = "Trigger DMA for the transmit function if the FIFO is not full. Generally, data interrupts would be disabled if DMA is enabled."]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(DMATX_A::ENABLED)
}
#[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 << 12)) | ((value as u32 & 0x01) << 12);
self.w
}
}
#[doc = "DMA configuration for receive.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum DMARX_A {
#[doc = "0: DMA is not used for the receive function."]
DISABLED = 0,
#[doc = "1: Trigger DMA for the receive function if the FIFO is not empty. Generally, data interrupts would be disabled if DMA is enabled."]
ENABLED = 1,
}
impl From<DMARX_A> for bool {
#[inline(always)]
fn from(variant: DMARX_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `DMARX` reader - DMA configuration for receive."]
pub struct DMARX_R(crate::FieldReader<bool, DMARX_A>);
impl DMARX_R {
pub(crate) fn new(bits: bool) -> Self {
DMARX_R(crate::FieldReader::new(bits))
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> DMARX_A {
match self.bits {
false => DMARX_A::DISABLED,
true => DMARX_A::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
**self == DMARX_A::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
**self == DMARX_A::ENABLED
}
}
impl core::ops::Deref for DMARX_R {
type Target = crate::FieldReader<bool, DMARX_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `DMARX` writer - DMA configuration for receive."]
pub struct DMARX_W<'a> {
w: &'a mut W,
}
impl<'a> DMARX_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: DMARX_A) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "DMA is not used for the receive function."]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(DMARX_A::DISABLED)
}
#[doc = "Trigger DMA for the receive function if the FIFO is not empty. Generally, data interrupts would be disabled if DMA is enabled."]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(DMARX_A::ENABLED)
}
#[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 << 13)) | ((value as u32 & 0x01) << 13);
self.w
}
}
#[doc = "Wake-up for transmit FIFO level. This allows the device to be woken from reduced power modes (up to power-down, as long as the peripheral function works in that power mode) without enabling the TXLVL interrupt. Only DMA wakes up, processes data, and goes back to sleep. The CPU will remain stopped until woken by another cause, such as DMA completion. See Hardware Wake-up control register.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum WAKETX_A {
#[doc = "0: Only enabled interrupts will wake up the device form reduced power modes."]
DISABLED = 0,
#[doc = "1: A device wake-up for DMA will occur if the transmit FIFO level reaches the value specified by TXLVL in FIFOTRIG, even when the TXLVL interrupt is not enabled."]
ENABLED = 1,
}
impl From<WAKETX_A> for bool {
#[inline(always)]
fn from(variant: WAKETX_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `WAKETX` reader - Wake-up for transmit FIFO level. This allows the device to be woken from reduced power modes (up to power-down, as long as the peripheral function works in that power mode) without enabling the TXLVL interrupt. Only DMA wakes up, processes data, and goes back to sleep. The CPU will remain stopped until woken by another cause, such as DMA completion. See Hardware Wake-up control register."]
pub struct WAKETX_R(crate::FieldReader<bool, WAKETX_A>);
impl WAKETX_R {
pub(crate) fn new(bits: bool) -> Self {
WAKETX_R(crate::FieldReader::new(bits))
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> WAKETX_A {
match self.bits {
false => WAKETX_A::DISABLED,
true => WAKETX_A::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
**self == WAKETX_A::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
**self == WAKETX_A::ENABLED
}
}
impl core::ops::Deref for WAKETX_R {
type Target = crate::FieldReader<bool, WAKETX_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `WAKETX` writer - Wake-up for transmit FIFO level. This allows the device to be woken from reduced power modes (up to power-down, as long as the peripheral function works in that power mode) without enabling the TXLVL interrupt. Only DMA wakes up, processes data, and goes back to sleep. The CPU will remain stopped until woken by another cause, such as DMA completion. See Hardware Wake-up control register."]
pub struct WAKETX_W<'a> {
w: &'a mut W,
}
impl<'a> WAKETX_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: WAKETX_A) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "Only enabled interrupts will wake up the device form reduced power modes."]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(WAKETX_A::DISABLED)
}
#[doc = "A device wake-up for DMA will occur if the transmit FIFO level reaches the value specified by TXLVL in FIFOTRIG, even when the TXLVL interrupt is not enabled."]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(WAKETX_A::ENABLED)
}
#[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 = "Wake-up for receive FIFO level. This allows the device to be woken from reduced power modes (up to power-down, as long as the peripheral function works in that power mode) without enabling the TXLVL interrupt. Only DMA wakes up, processes data, and goes back to sleep. The CPU will remain stopped until woken by another cause, such as DMA completion. See Hardware Wake-up control register.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum WAKERX_A {
#[doc = "0: Only enabled interrupts will wake up the device form reduced power modes."]
DISABLED = 0,
#[doc = "1: A device wake-up for DMA will occur if the receive FIFO level reaches the value specified by RXLVL in FIFOTRIG, even when the RXLVL interrupt is not enabled."]
ENABLED = 1,
}
impl From<WAKERX_A> for bool {
#[inline(always)]
fn from(variant: WAKERX_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `WAKERX` reader - Wake-up for receive FIFO level. This allows the device to be woken from reduced power modes (up to power-down, as long as the peripheral function works in that power mode) without enabling the TXLVL interrupt. Only DMA wakes up, processes data, and goes back to sleep. The CPU will remain stopped until woken by another cause, such as DMA completion. See Hardware Wake-up control register."]
pub struct WAKERX_R(crate::FieldReader<bool, WAKERX_A>);
impl WAKERX_R {
pub(crate) fn new(bits: bool) -> Self {
WAKERX_R(crate::FieldReader::new(bits))
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> WAKERX_A {
match self.bits {
false => WAKERX_A::DISABLED,
true => WAKERX_A::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
**self == WAKERX_A::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
**self == WAKERX_A::ENABLED
}
}
impl core::ops::Deref for WAKERX_R {
type Target = crate::FieldReader<bool, WAKERX_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `WAKERX` writer - Wake-up for receive FIFO level. This allows the device to be woken from reduced power modes (up to power-down, as long as the peripheral function works in that power mode) without enabling the TXLVL interrupt. Only DMA wakes up, processes data, and goes back to sleep. The CPU will remain stopped until woken by another cause, such as DMA completion. See Hardware Wake-up control register."]
pub struct WAKERX_W<'a> {
w: &'a mut W,
}
impl<'a> WAKERX_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: WAKERX_A) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "Only enabled interrupts will wake up the device form reduced power modes."]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(WAKERX_A::DISABLED)
}
#[doc = "A device wake-up for DMA will occur if the receive FIFO level reaches the value specified by RXLVL in FIFOTRIG, even when the RXLVL interrupt is not enabled."]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(WAKERX_A::ENABLED)
}
#[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 << 15)) | ((value as u32 & 0x01) << 15);
self.w
}
}
#[doc = "Field `EMPTYTX` reader - Empty command for the transmit FIFO. When a 1 is written to this bit, the TX FIFO is emptied."]
pub struct EMPTYTX_R(crate::FieldReader<bool, bool>);
impl EMPTYTX_R {
pub(crate) fn new(bits: bool) -> Self {
EMPTYTX_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for EMPTYTX_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `EMPTYTX` writer - Empty command for the transmit FIFO. When a 1 is written to this bit, the TX FIFO is emptied."]
pub struct EMPTYTX_W<'a> {
w: &'a mut W,
}
impl<'a> EMPTYTX_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 << 16)) | ((value as u32 & 0x01) << 16);
self.w
}
}
#[doc = "Field `EMPTYRX` reader - Empty command for the receive FIFO. When a 1 is written to this bit, the RX FIFO is emptied."]
pub struct EMPTYRX_R(crate::FieldReader<bool, bool>);
impl EMPTYRX_R {
pub(crate) fn new(bits: bool) -> Self {
EMPTYRX_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for EMPTYRX_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `EMPTYRX` writer - Empty command for the receive FIFO. When a 1 is written to this bit, the RX FIFO is emptied."]
pub struct EMPTYRX_W<'a> {
w: &'a mut W,
}
impl<'a> EMPTYRX_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 << 17)) | ((value as u32 & 0x01) << 17);
self.w
}
}
impl R {
#[doc = "Bit 0 - Enable the transmit FIFO."]
#[inline(always)]
pub fn enabletx(&self) -> ENABLETX_R {
ENABLETX_R::new((self.bits & 0x01) != 0)
}
#[doc = "Bit 1 - Enable the receive FIFO."]
#[inline(always)]
pub fn enablerx(&self) -> ENABLERX_R {
ENABLERX_R::new(((self.bits >> 1) & 0x01) != 0)
}
#[doc = "Bits 4:5 - FIFO size configuration. This is a read-only field. 0x0 = FIFO is configured as 16 entries of 8 bits. 0x1, 0x2, 0x3 = not applicable to USART."]
#[inline(always)]
pub fn size(&self) -> SIZE_R {
SIZE_R::new(((self.bits >> 4) & 0x03) as u8)
}
#[doc = "Bit 12 - DMA configuration for transmit."]
#[inline(always)]
pub fn dmatx(&self) -> DMATX_R {
DMATX_R::new(((self.bits >> 12) & 0x01) != 0)
}
#[doc = "Bit 13 - DMA configuration for receive."]
#[inline(always)]
pub fn dmarx(&self) -> DMARX_R {
DMARX_R::new(((self.bits >> 13) & 0x01) != 0)
}
#[doc = "Bit 14 - Wake-up for transmit FIFO level. This allows the device to be woken from reduced power modes (up to power-down, as long as the peripheral function works in that power mode) without enabling the TXLVL interrupt. Only DMA wakes up, processes data, and goes back to sleep. The CPU will remain stopped until woken by another cause, such as DMA completion. See Hardware Wake-up control register."]
#[inline(always)]
pub fn waketx(&self) -> WAKETX_R {
WAKETX_R::new(((self.bits >> 14) & 0x01) != 0)
}
#[doc = "Bit 15 - Wake-up for receive FIFO level. This allows the device to be woken from reduced power modes (up to power-down, as long as the peripheral function works in that power mode) without enabling the TXLVL interrupt. Only DMA wakes up, processes data, and goes back to sleep. The CPU will remain stopped until woken by another cause, such as DMA completion. See Hardware Wake-up control register."]
#[inline(always)]
pub fn wakerx(&self) -> WAKERX_R {
WAKERX_R::new(((self.bits >> 15) & 0x01) != 0)
}
#[doc = "Bit 16 - Empty command for the transmit FIFO. When a 1 is written to this bit, the TX FIFO is emptied."]
#[inline(always)]
pub fn emptytx(&self) -> EMPTYTX_R {
EMPTYTX_R::new(((self.bits >> 16) & 0x01) != 0)
}
#[doc = "Bit 17 - Empty command for the receive FIFO. When a 1 is written to this bit, the RX FIFO is emptied."]
#[inline(always)]
pub fn emptyrx(&self) -> EMPTYRX_R {
EMPTYRX_R::new(((self.bits >> 17) & 0x01) != 0)
}
}
impl W {
#[doc = "Bit 0 - Enable the transmit FIFO."]
#[inline(always)]
pub fn enabletx(&mut self) -> ENABLETX_W {
ENABLETX_W { w: self }
}
#[doc = "Bit 1 - Enable the receive FIFO."]
#[inline(always)]
pub fn enablerx(&mut self) -> ENABLERX_W {
ENABLERX_W { w: self }
}
#[doc = "Bit 12 - DMA configuration for transmit."]
#[inline(always)]
pub fn dmatx(&mut self) -> DMATX_W {
DMATX_W { w: self }
}
#[doc = "Bit 13 - DMA configuration for receive."]
#[inline(always)]
pub fn dmarx(&mut self) -> DMARX_W {
DMARX_W { w: self }
}
#[doc = "Bit 14 - Wake-up for transmit FIFO level. This allows the device to be woken from reduced power modes (up to power-down, as long as the peripheral function works in that power mode) without enabling the TXLVL interrupt. Only DMA wakes up, processes data, and goes back to sleep. The CPU will remain stopped until woken by another cause, such as DMA completion. See Hardware Wake-up control register."]
#[inline(always)]
pub fn waketx(&mut self) -> WAKETX_W {
WAKETX_W { w: self }
}
#[doc = "Bit 15 - Wake-up for receive FIFO level. This allows the device to be woken from reduced power modes (up to power-down, as long as the peripheral function works in that power mode) without enabling the TXLVL interrupt. Only DMA wakes up, processes data, and goes back to sleep. The CPU will remain stopped until woken by another cause, such as DMA completion. See Hardware Wake-up control register."]
#[inline(always)]
pub fn wakerx(&mut self) -> WAKERX_W {
WAKERX_W { w: self }
}
#[doc = "Bit 16 - Empty command for the transmit FIFO. When a 1 is written to this bit, the TX FIFO is emptied."]
#[inline(always)]
pub fn emptytx(&mut self) -> EMPTYTX_W {
EMPTYTX_W { w: self }
}
#[doc = "Bit 17 - Empty command for the receive FIFO. When a 1 is written to this bit, the RX FIFO is emptied."]
#[inline(always)]
pub fn emptyrx(&mut self) -> EMPTYRX_W {
EMPTYRX_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 = "FIFO configuration and enable register.\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 [fifocfg](index.html) module"]
pub struct FIFOCFG_SPEC;
impl crate::RegisterSpec for FIFOCFG_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [fifocfg::R](R) reader structure"]
impl crate::Readable for FIFOCFG_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [fifocfg::W](W) writer structure"]
impl crate::Writable for FIFOCFG_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets FIFOCFG to value 0"]
impl crate::Resettable for FIFOCFG_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}