#[doc = r" Value read from the register"]
pub struct R {
bits: u32,
}
#[doc = r" Value to write to the register"]
pub struct W {
bits: u32,
}
impl super::INTEN {
#[doc = r" Modifies the contents of the register"]
#[inline]
pub fn modify<F>(&self, f: F)
where
for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W,
{
let bits = self.register.get();
let r = R { bits: bits };
let mut w = W { bits: bits };
f(&r, &mut w);
self.register.set(w.bits);
}
#[doc = r" Reads the contents of the register"]
#[inline]
pub fn read(&self) -> R {
R {
bits: self.register.get(),
}
}
#[doc = r" Writes to the register"]
#[inline]
pub fn write<F>(&self, f: F)
where
F: FnOnce(&mut W) -> &mut W,
{
let mut w = W::reset_value();
f(&mut w);
self.register.set(w.bits);
}
#[doc = r" Writes the reset value to the register"]
#[inline]
pub fn reset(&self) {
self.write(|w| w)
}
}
#[doc = "Possible values of the field `RXPTRUPD`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum RXPTRUPDR {
#[doc = "Disable"]
DISABLED,
#[doc = "Enable"]
ENABLED,
}
impl RXPTRUPDR {
#[doc = r" Returns `true` if the bit is clear (0)"]
#[inline]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r" Returns `true` if the bit is set (1)"]
#[inline]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bit(&self) -> bool {
match *self {
RXPTRUPDR::DISABLED => false,
RXPTRUPDR::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _from(value: bool) -> RXPTRUPDR {
match value {
false => RXPTRUPDR::DISABLED,
true => RXPTRUPDR::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline]
pub fn is_disabled(&self) -> bool {
*self == RXPTRUPDR::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline]
pub fn is_enabled(&self) -> bool {
*self == RXPTRUPDR::ENABLED
}
}
#[doc = "Possible values of the field `STOPPED`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum STOPPEDR {
#[doc = "Disable"]
DISABLED,
#[doc = "Enable"]
ENABLED,
}
impl STOPPEDR {
#[doc = r" Returns `true` if the bit is clear (0)"]
#[inline]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r" Returns `true` if the bit is set (1)"]
#[inline]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bit(&self) -> bool {
match *self {
STOPPEDR::DISABLED => false,
STOPPEDR::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _from(value: bool) -> STOPPEDR {
match value {
false => STOPPEDR::DISABLED,
true => STOPPEDR::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline]
pub fn is_disabled(&self) -> bool {
*self == STOPPEDR::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline]
pub fn is_enabled(&self) -> bool {
*self == STOPPEDR::ENABLED
}
}
#[doc = "Possible values of the field `TXPTRUPD`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TXPTRUPDR {
#[doc = "Disable"]
DISABLED,
#[doc = "Enable"]
ENABLED,
}
impl TXPTRUPDR {
#[doc = r" Returns `true` if the bit is clear (0)"]
#[inline]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r" Returns `true` if the bit is set (1)"]
#[inline]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bit(&self) -> bool {
match *self {
TXPTRUPDR::DISABLED => false,
TXPTRUPDR::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _from(value: bool) -> TXPTRUPDR {
match value {
false => TXPTRUPDR::DISABLED,
true => TXPTRUPDR::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline]
pub fn is_disabled(&self) -> bool {
*self == TXPTRUPDR::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline]
pub fn is_enabled(&self) -> bool {
*self == TXPTRUPDR::ENABLED
}
}
#[doc = "Values that can be written to the field `RXPTRUPD`"]
pub enum RXPTRUPDW {
#[doc = "Disable"]
DISABLED,
#[doc = "Enable"]
ENABLED,
}
impl RXPTRUPDW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _bits(&self) -> bool {
match *self {
RXPTRUPDW::DISABLED => false,
RXPTRUPDW::ENABLED => true,
}
}
}
#[doc = r" Proxy"]
pub struct _RXPTRUPDW<'a> {
w: &'a mut W,
}
impl<'a> _RXPTRUPDW<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: RXPTRUPDW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Disable"]
#[inline]
pub fn disabled(self) -> &'a mut W {
self.variant(RXPTRUPDW::DISABLED)
}
#[doc = "Enable"]
#[inline]
pub fn enabled(self) -> &'a mut W {
self.variant(RXPTRUPDW::ENABLED)
}
#[doc = r" Sets the field bit"]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r" Clears the field bit"]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r" Writes raw bits to the field"]
#[inline]
pub fn bit(self, value: bool) -> &'a mut W {
const MASK: bool = true;
const OFFSET: u8 = 1;
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc = "Values that can be written to the field `STOPPED`"]
pub enum STOPPEDW {
#[doc = "Disable"]
DISABLED,
#[doc = "Enable"]
ENABLED,
}
impl STOPPEDW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _bits(&self) -> bool {
match *self {
STOPPEDW::DISABLED => false,
STOPPEDW::ENABLED => true,
}
}
}
#[doc = r" Proxy"]
pub struct _STOPPEDW<'a> {
w: &'a mut W,
}
impl<'a> _STOPPEDW<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: STOPPEDW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Disable"]
#[inline]
pub fn disabled(self) -> &'a mut W {
self.variant(STOPPEDW::DISABLED)
}
#[doc = "Enable"]
#[inline]
pub fn enabled(self) -> &'a mut W {
self.variant(STOPPEDW::ENABLED)
}
#[doc = r" Sets the field bit"]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r" Clears the field bit"]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r" Writes raw bits to the field"]
#[inline]
pub fn bit(self, value: bool) -> &'a mut W {
const MASK: bool = true;
const OFFSET: u8 = 2;
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc = "Values that can be written to the field `TXPTRUPD`"]
pub enum TXPTRUPDW {
#[doc = "Disable"]
DISABLED,
#[doc = "Enable"]
ENABLED,
}
impl TXPTRUPDW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _bits(&self) -> bool {
match *self {
TXPTRUPDW::DISABLED => false,
TXPTRUPDW::ENABLED => true,
}
}
}
#[doc = r" Proxy"]
pub struct _TXPTRUPDW<'a> {
w: &'a mut W,
}
impl<'a> _TXPTRUPDW<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: TXPTRUPDW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Disable"]
#[inline]
pub fn disabled(self) -> &'a mut W {
self.variant(TXPTRUPDW::DISABLED)
}
#[doc = "Enable"]
#[inline]
pub fn enabled(self) -> &'a mut W {
self.variant(TXPTRUPDW::ENABLED)
}
#[doc = r" Sets the field bit"]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r" Clears the field bit"]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r" Writes raw bits to the field"]
#[inline]
pub fn bit(self, value: bool) -> &'a mut W {
const MASK: bool = true;
const OFFSET: u8 = 5;
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
impl R {
#[doc = r" Value of the register as raw bits"]
#[inline]
pub fn bits(&self) -> u32 {
self.bits
}
#[doc = "Bit 1 - Enable or disable interrupt for RXPTRUPD event"]
#[inline]
pub fn rxptrupd(&self) -> RXPTRUPDR {
RXPTRUPDR::_from({
const MASK: bool = true;
const OFFSET: u8 = 1;
((self.bits >> OFFSET) & MASK as u32) != 0
})
}
#[doc = "Bit 2 - Enable or disable interrupt for STOPPED event"]
#[inline]
pub fn stopped(&self) -> STOPPEDR {
STOPPEDR::_from({
const MASK: bool = true;
const OFFSET: u8 = 2;
((self.bits >> OFFSET) & MASK as u32) != 0
})
}
#[doc = "Bit 5 - Enable or disable interrupt for TXPTRUPD event"]
#[inline]
pub fn txptrupd(&self) -> TXPTRUPDR {
TXPTRUPDR::_from({
const MASK: bool = true;
const OFFSET: u8 = 5;
((self.bits >> OFFSET) & MASK as u32) != 0
})
}
}
impl W {
#[doc = r" Reset value of the register"]
#[inline]
pub fn reset_value() -> W {
W { bits: 0 }
}
#[doc = r" Writes raw bits to the register"]
#[inline]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.bits = bits;
self
}
#[doc = "Bit 1 - Enable or disable interrupt for RXPTRUPD event"]
#[inline]
pub fn rxptrupd(&mut self) -> _RXPTRUPDW {
_RXPTRUPDW { w: self }
}
#[doc = "Bit 2 - Enable or disable interrupt for STOPPED event"]
#[inline]
pub fn stopped(&mut self) -> _STOPPEDW {
_STOPPEDW { w: self }
}
#[doc = "Bit 5 - Enable or disable interrupt for TXPTRUPD event"]
#[inline]
pub fn txptrupd(&mut self) -> _TXPTRUPDW {
_TXPTRUPDW { w: self }
}
}