#[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::SHORTS {
#[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 `CTS_STARTRX`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CTS_STARTRXR {
#[doc = "Disable shortcut"]
DISABLED,
#[doc = "Enable shortcut"]
ENABLED,
}
impl CTS_STARTRXR {
#[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 {
CTS_STARTRXR::DISABLED => false,
CTS_STARTRXR::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _from(value: bool) -> CTS_STARTRXR {
match value {
false => CTS_STARTRXR::DISABLED,
true => CTS_STARTRXR::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline]
pub fn is_disabled(&self) -> bool {
*self == CTS_STARTRXR::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline]
pub fn is_enabled(&self) -> bool {
*self == CTS_STARTRXR::ENABLED
}
}
#[doc = "Possible values of the field `NCTS_STOPRX`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum NCTS_STOPRXR {
#[doc = "Disable shortcut"]
DISABLED,
#[doc = "Enable shortcut"]
ENABLED,
}
impl NCTS_STOPRXR {
#[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 {
NCTS_STOPRXR::DISABLED => false,
NCTS_STOPRXR::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _from(value: bool) -> NCTS_STOPRXR {
match value {
false => NCTS_STOPRXR::DISABLED,
true => NCTS_STOPRXR::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline]
pub fn is_disabled(&self) -> bool {
*self == NCTS_STOPRXR::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline]
pub fn is_enabled(&self) -> bool {
*self == NCTS_STOPRXR::ENABLED
}
}
#[doc = "Values that can be written to the field `CTS_STARTRX`"]
pub enum CTS_STARTRXW {
#[doc = "Disable shortcut"]
DISABLED,
#[doc = "Enable shortcut"]
ENABLED,
}
impl CTS_STARTRXW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _bits(&self) -> bool {
match *self {
CTS_STARTRXW::DISABLED => false,
CTS_STARTRXW::ENABLED => true,
}
}
}
#[doc = r" Proxy"]
pub struct _CTS_STARTRXW<'a> {
w: &'a mut W,
}
impl<'a> _CTS_STARTRXW<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: CTS_STARTRXW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Disable shortcut"]
#[inline]
pub fn disabled(self) -> &'a mut W {
self.variant(CTS_STARTRXW::DISABLED)
}
#[doc = "Enable shortcut"]
#[inline]
pub fn enabled(self) -> &'a mut W {
self.variant(CTS_STARTRXW::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 = 3;
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 `NCTS_STOPRX`"]
pub enum NCTS_STOPRXW {
#[doc = "Disable shortcut"]
DISABLED,
#[doc = "Enable shortcut"]
ENABLED,
}
impl NCTS_STOPRXW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _bits(&self) -> bool {
match *self {
NCTS_STOPRXW::DISABLED => false,
NCTS_STOPRXW::ENABLED => true,
}
}
}
#[doc = r" Proxy"]
pub struct _NCTS_STOPRXW<'a> {
w: &'a mut W,
}
impl<'a> _NCTS_STOPRXW<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: NCTS_STOPRXW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Disable shortcut"]
#[inline]
pub fn disabled(self) -> &'a mut W {
self.variant(NCTS_STOPRXW::DISABLED)
}
#[doc = "Enable shortcut"]
#[inline]
pub fn enabled(self) -> &'a mut W {
self.variant(NCTS_STOPRXW::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 = 4;
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 3 - Shortcut between CTS event and STARTRX task"]
#[inline]
pub fn cts_startrx(&self) -> CTS_STARTRXR {
CTS_STARTRXR::_from({
const MASK: bool = true;
const OFFSET: u8 = 3;
((self.bits >> OFFSET) & MASK as u32) != 0
})
}
#[doc = "Bit 4 - Shortcut between NCTS event and STOPRX task"]
#[inline]
pub fn ncts_stoprx(&self) -> NCTS_STOPRXR {
NCTS_STOPRXR::_from({
const MASK: bool = true;
const OFFSET: u8 = 4;
((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 3 - Shortcut between CTS event and STARTRX task"]
#[inline]
pub fn cts_startrx(&mut self) -> _CTS_STARTRXW {
_CTS_STARTRXW { w: self }
}
#[doc = "Bit 4 - Shortcut between NCTS event and STOPRX task"]
#[inline]
pub fn ncts_stoprx(&mut self) -> _NCTS_STOPRXW {
_NCTS_STOPRXW { w: self }
}
}