#[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::EVTEN {
#[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 `TICK`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TICKR {
#[doc = "Disable"]
DISABLED,
#[doc = "Disable"]
ENABLED,
}
impl TICKR {
#[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 {
TICKR::DISABLED => false,
TICKR::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _from(value: bool) -> TICKR {
match value {
false => TICKR::DISABLED,
true => TICKR::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline]
pub fn is_disabled(&self) -> bool {
*self == TICKR::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline]
pub fn is_enabled(&self) -> bool {
*self == TICKR::ENABLED
}
}
#[doc = "Possible values of the field `OVRFLW`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum OVRFLWR {
#[doc = "Disable"]
DISABLED,
#[doc = "Disable"]
ENABLED,
}
impl OVRFLWR {
#[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 {
OVRFLWR::DISABLED => false,
OVRFLWR::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _from(value: bool) -> OVRFLWR {
match value {
false => OVRFLWR::DISABLED,
true => OVRFLWR::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline]
pub fn is_disabled(&self) -> bool {
*self == OVRFLWR::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline]
pub fn is_enabled(&self) -> bool {
*self == OVRFLWR::ENABLED
}
}
#[doc = "Possible values of the field `COMPARE0`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum COMPARE0R {
#[doc = "Disable"]
DISABLED,
#[doc = "Disable"]
ENABLED,
}
impl COMPARE0R {
#[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 {
COMPARE0R::DISABLED => false,
COMPARE0R::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _from(value: bool) -> COMPARE0R {
match value {
false => COMPARE0R::DISABLED,
true => COMPARE0R::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline]
pub fn is_disabled(&self) -> bool {
*self == COMPARE0R::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline]
pub fn is_enabled(&self) -> bool {
*self == COMPARE0R::ENABLED
}
}
#[doc = "Possible values of the field `COMPARE1`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum COMPARE1R {
#[doc = "Disable"]
DISABLED,
#[doc = "Disable"]
ENABLED,
}
impl COMPARE1R {
#[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 {
COMPARE1R::DISABLED => false,
COMPARE1R::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _from(value: bool) -> COMPARE1R {
match value {
false => COMPARE1R::DISABLED,
true => COMPARE1R::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline]
pub fn is_disabled(&self) -> bool {
*self == COMPARE1R::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline]
pub fn is_enabled(&self) -> bool {
*self == COMPARE1R::ENABLED
}
}
#[doc = "Possible values of the field `COMPARE2`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum COMPARE2R {
#[doc = "Disable"]
DISABLED,
#[doc = "Disable"]
ENABLED,
}
impl COMPARE2R {
#[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 {
COMPARE2R::DISABLED => false,
COMPARE2R::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _from(value: bool) -> COMPARE2R {
match value {
false => COMPARE2R::DISABLED,
true => COMPARE2R::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline]
pub fn is_disabled(&self) -> bool {
*self == COMPARE2R::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline]
pub fn is_enabled(&self) -> bool {
*self == COMPARE2R::ENABLED
}
}
#[doc = "Possible values of the field `COMPARE3`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum COMPARE3R {
#[doc = "Disable"]
DISABLED,
#[doc = "Disable"]
ENABLED,
}
impl COMPARE3R {
#[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 {
COMPARE3R::DISABLED => false,
COMPARE3R::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _from(value: bool) -> COMPARE3R {
match value {
false => COMPARE3R::DISABLED,
true => COMPARE3R::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline]
pub fn is_disabled(&self) -> bool {
*self == COMPARE3R::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline]
pub fn is_enabled(&self) -> bool {
*self == COMPARE3R::ENABLED
}
}
#[doc = "Values that can be written to the field `TICK`"]
pub enum TICKW {
#[doc = "Disable"]
DISABLED,
#[doc = "Disable"]
ENABLED,
}
impl TICKW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _bits(&self) -> bool {
match *self {
TICKW::DISABLED => false,
TICKW::ENABLED => true,
}
}
}
#[doc = r" Proxy"]
pub struct _TICKW<'a> {
w: &'a mut W,
}
impl<'a> _TICKW<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: TICKW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Disable"]
#[inline]
pub fn disabled(self) -> &'a mut W {
self.variant(TICKW::DISABLED)
}
#[doc = "Disable"]
#[inline]
pub fn enabled(self) -> &'a mut W {
self.variant(TICKW::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 = 0;
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 `OVRFLW`"]
pub enum OVRFLWW {
#[doc = "Disable"]
DISABLED,
#[doc = "Disable"]
ENABLED,
}
impl OVRFLWW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _bits(&self) -> bool {
match *self {
OVRFLWW::DISABLED => false,
OVRFLWW::ENABLED => true,
}
}
}
#[doc = r" Proxy"]
pub struct _OVRFLWW<'a> {
w: &'a mut W,
}
impl<'a> _OVRFLWW<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: OVRFLWW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Disable"]
#[inline]
pub fn disabled(self) -> &'a mut W {
self.variant(OVRFLWW::DISABLED)
}
#[doc = "Disable"]
#[inline]
pub fn enabled(self) -> &'a mut W {
self.variant(OVRFLWW::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 `COMPARE0`"]
pub enum COMPARE0W {
#[doc = "Disable"]
DISABLED,
#[doc = "Disable"]
ENABLED,
}
impl COMPARE0W {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _bits(&self) -> bool {
match *self {
COMPARE0W::DISABLED => false,
COMPARE0W::ENABLED => true,
}
}
}
#[doc = r" Proxy"]
pub struct _COMPARE0W<'a> {
w: &'a mut W,
}
impl<'a> _COMPARE0W<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: COMPARE0W) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Disable"]
#[inline]
pub fn disabled(self) -> &'a mut W {
self.variant(COMPARE0W::DISABLED)
}
#[doc = "Disable"]
#[inline]
pub fn enabled(self) -> &'a mut W {
self.variant(COMPARE0W::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 = 16;
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 `COMPARE1`"]
pub enum COMPARE1W {
#[doc = "Disable"]
DISABLED,
#[doc = "Disable"]
ENABLED,
}
impl COMPARE1W {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _bits(&self) -> bool {
match *self {
COMPARE1W::DISABLED => false,
COMPARE1W::ENABLED => true,
}
}
}
#[doc = r" Proxy"]
pub struct _COMPARE1W<'a> {
w: &'a mut W,
}
impl<'a> _COMPARE1W<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: COMPARE1W) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Disable"]
#[inline]
pub fn disabled(self) -> &'a mut W {
self.variant(COMPARE1W::DISABLED)
}
#[doc = "Disable"]
#[inline]
pub fn enabled(self) -> &'a mut W {
self.variant(COMPARE1W::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 = 17;
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 `COMPARE2`"]
pub enum COMPARE2W {
#[doc = "Disable"]
DISABLED,
#[doc = "Disable"]
ENABLED,
}
impl COMPARE2W {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _bits(&self) -> bool {
match *self {
COMPARE2W::DISABLED => false,
COMPARE2W::ENABLED => true,
}
}
}
#[doc = r" Proxy"]
pub struct _COMPARE2W<'a> {
w: &'a mut W,
}
impl<'a> _COMPARE2W<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: COMPARE2W) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Disable"]
#[inline]
pub fn disabled(self) -> &'a mut W {
self.variant(COMPARE2W::DISABLED)
}
#[doc = "Disable"]
#[inline]
pub fn enabled(self) -> &'a mut W {
self.variant(COMPARE2W::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 = 18;
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 `COMPARE3`"]
pub enum COMPARE3W {
#[doc = "Disable"]
DISABLED,
#[doc = "Disable"]
ENABLED,
}
impl COMPARE3W {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _bits(&self) -> bool {
match *self {
COMPARE3W::DISABLED => false,
COMPARE3W::ENABLED => true,
}
}
}
#[doc = r" Proxy"]
pub struct _COMPARE3W<'a> {
w: &'a mut W,
}
impl<'a> _COMPARE3W<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: COMPARE3W) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Disable"]
#[inline]
pub fn disabled(self) -> &'a mut W {
self.variant(COMPARE3W::DISABLED)
}
#[doc = "Disable"]
#[inline]
pub fn enabled(self) -> &'a mut W {
self.variant(COMPARE3W::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 = 19;
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 0 - Enable or disable event routing for event TICK"]
#[inline]
pub fn tick(&self) -> TICKR {
TICKR::_from({
const MASK: bool = true;
const OFFSET: u8 = 0;
((self.bits >> OFFSET) & MASK as u32) != 0
})
}
#[doc = "Bit 1 - Enable or disable event routing for event OVRFLW"]
#[inline]
pub fn ovrflw(&self) -> OVRFLWR {
OVRFLWR::_from({
const MASK: bool = true;
const OFFSET: u8 = 1;
((self.bits >> OFFSET) & MASK as u32) != 0
})
}
#[doc = "Bit 16 - Enable or disable event routing for event COMPARE\\[0\\]"]
#[inline]
pub fn compare0(&self) -> COMPARE0R {
COMPARE0R::_from({
const MASK: bool = true;
const OFFSET: u8 = 16;
((self.bits >> OFFSET) & MASK as u32) != 0
})
}
#[doc = "Bit 17 - Enable or disable event routing for event COMPARE\\[1\\]"]
#[inline]
pub fn compare1(&self) -> COMPARE1R {
COMPARE1R::_from({
const MASK: bool = true;
const OFFSET: u8 = 17;
((self.bits >> OFFSET) & MASK as u32) != 0
})
}
#[doc = "Bit 18 - Enable or disable event routing for event COMPARE\\[2\\]"]
#[inline]
pub fn compare2(&self) -> COMPARE2R {
COMPARE2R::_from({
const MASK: bool = true;
const OFFSET: u8 = 18;
((self.bits >> OFFSET) & MASK as u32) != 0
})
}
#[doc = "Bit 19 - Enable or disable event routing for event COMPARE\\[3\\]"]
#[inline]
pub fn compare3(&self) -> COMPARE3R {
COMPARE3R::_from({
const MASK: bool = true;
const OFFSET: u8 = 19;
((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 0 - Enable or disable event routing for event TICK"]
#[inline]
pub fn tick(&mut self) -> _TICKW {
_TICKW { w: self }
}
#[doc = "Bit 1 - Enable or disable event routing for event OVRFLW"]
#[inline]
pub fn ovrflw(&mut self) -> _OVRFLWW {
_OVRFLWW { w: self }
}
#[doc = "Bit 16 - Enable or disable event routing for event COMPARE\\[0\\]"]
#[inline]
pub fn compare0(&mut self) -> _COMPARE0W {
_COMPARE0W { w: self }
}
#[doc = "Bit 17 - Enable or disable event routing for event COMPARE\\[1\\]"]
#[inline]
pub fn compare1(&mut self) -> _COMPARE1W {
_COMPARE1W { w: self }
}
#[doc = "Bit 18 - Enable or disable event routing for event COMPARE\\[2\\]"]
#[inline]
pub fn compare2(&mut self) -> _COMPARE2W {
_COMPARE2W { w: self }
}
#[doc = "Bit 19 - Enable or disable event routing for event COMPARE\\[3\\]"]
#[inline]
pub fn compare3(&mut self) -> _COMPARE3W {
_COMPARE3W { w: self }
}
}