#[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::CTRLA {
#[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 };
let mut w = W { 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 = r" Value of the field"]
pub struct ENABLER {
bits: bool,
}
impl ENABLER {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bit(&self) -> bool {
self.bits
}
#[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 = "Possible values of the field `MODE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum MODER {
#[doc = "QDEC operating mode"]
QDEC,
#[doc = "HALL operating mode"]
HALL,
#[doc = "COUNTER operating mode"]
COUNTER,
#[doc = r" Reserved"]
_Reserved(u8),
}
impl MODER {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bits(&self) -> u8 {
match *self {
MODER::QDEC => 0,
MODER::HALL => 1,
MODER::COUNTER => 2,
MODER::_Reserved(bits) => bits,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _from(value: u8) -> MODER {
match value {
0 => MODER::QDEC,
1 => MODER::HALL,
2 => MODER::COUNTER,
i => MODER::_Reserved(i),
}
}
#[doc = "Checks if the value of the field is `QDEC`"]
#[inline]
pub fn is_qdec(&self) -> bool {
*self == MODER::QDEC
}
#[doc = "Checks if the value of the field is `HALL`"]
#[inline]
pub fn is_hall(&self) -> bool {
*self == MODER::HALL
}
#[doc = "Checks if the value of the field is `COUNTER`"]
#[inline]
pub fn is_counter(&self) -> bool {
*self == MODER::COUNTER
}
}
#[doc = r" Value of the field"]
pub struct RUNSTDBYR {
bits: bool,
}
impl RUNSTDBYR {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bit(&self) -> bool {
self.bits
}
#[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 = "Possible values of the field `CONF`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CONFR {
#[doc = "Quadrature decoder direction"]
X4,
#[doc = "Secure Quadrature decoder direction"]
X4S,
#[doc = "Decoder direction"]
X2,
#[doc = "Secure decoder direction"]
X2S,
#[doc = "Auto correction mode"]
AUTOC,
#[doc = r" Reserved"]
_Reserved(u8),
}
impl CONFR {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bits(&self) -> u8 {
match *self {
CONFR::X4 => 0,
CONFR::X4S => 1,
CONFR::X2 => 2,
CONFR::X2S => 3,
CONFR::AUTOC => 4,
CONFR::_Reserved(bits) => bits,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _from(value: u8) -> CONFR {
match value {
0 => CONFR::X4,
1 => CONFR::X4S,
2 => CONFR::X2,
3 => CONFR::X2S,
4 => CONFR::AUTOC,
i => CONFR::_Reserved(i),
}
}
#[doc = "Checks if the value of the field is `X4`"]
#[inline]
pub fn is_x4(&self) -> bool {
*self == CONFR::X4
}
#[doc = "Checks if the value of the field is `X4S`"]
#[inline]
pub fn is_x4s(&self) -> bool {
*self == CONFR::X4S
}
#[doc = "Checks if the value of the field is `X2`"]
#[inline]
pub fn is_x2(&self) -> bool {
*self == CONFR::X2
}
#[doc = "Checks if the value of the field is `X2S`"]
#[inline]
pub fn is_x2s(&self) -> bool {
*self == CONFR::X2S
}
#[doc = "Checks if the value of the field is `AUTOC`"]
#[inline]
pub fn is_autoc(&self) -> bool {
*self == CONFR::AUTOC
}
}
#[doc = r" Value of the field"]
pub struct ALOCKR {
bits: bool,
}
impl ALOCKR {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bit(&self) -> bool {
self.bits
}
#[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"]
pub struct SWAPR {
bits: bool,
}
impl SWAPR {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bit(&self) -> bool {
self.bits
}
#[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"]
pub struct PERENR {
bits: bool,
}
impl PERENR {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bit(&self) -> bool {
self.bits
}
#[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"]
pub struct PINEN0R {
bits: bool,
}
impl PINEN0R {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bit(&self) -> bool {
self.bits
}
#[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"]
pub struct PINEN1R {
bits: bool,
}
impl PINEN1R {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bit(&self) -> bool {
self.bits
}
#[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"]
pub struct PINEN2R {
bits: bool,
}
impl PINEN2R {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bit(&self) -> bool {
self.bits
}
#[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"]
pub struct PINVEN0R {
bits: bool,
}
impl PINVEN0R {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bit(&self) -> bool {
self.bits
}
#[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"]
pub struct PINVEN1R {
bits: bool,
}
impl PINVEN1R {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bit(&self) -> bool {
self.bits
}
#[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"]
pub struct PINVEN2R {
bits: bool,
}
impl PINVEN2R {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bit(&self) -> bool {
self.bits
}
#[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"]
pub struct ANGULARR {
bits: u8,
}
impl ANGULARR {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bits(&self) -> u8 {
self.bits
}
}
#[doc = r" Value of the field"]
pub struct MAXCMPR {
bits: u8,
}
impl MAXCMPR {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bits(&self) -> u8 {
self.bits
}
}
#[doc = r" Proxy"]
pub struct _SWRSTW<'a> {
w: &'a mut W,
}
impl<'a> _SWRSTW<'a> {
#[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 = r" Proxy"]
pub struct _ENABLEW<'a> {
w: &'a mut W,
}
impl<'a> _ENABLEW<'a> {
#[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 `MODE`"]
pub enum MODEW {
#[doc = "QDEC operating mode"]
QDEC,
#[doc = "HALL operating mode"]
HALL,
#[doc = "COUNTER operating mode"]
COUNTER,
}
impl MODEW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _bits(&self) -> u8 {
match *self {
MODEW::QDEC => 0,
MODEW::HALL => 1,
MODEW::COUNTER => 2,
}
}
}
#[doc = r" Proxy"]
pub struct _MODEW<'a> {
w: &'a mut W,
}
impl<'a> _MODEW<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: MODEW) -> &'a mut W {
unsafe { self.bits(variant._bits()) }
}
#[doc = "QDEC operating mode"]
#[inline]
pub fn qdec(self) -> &'a mut W {
self.variant(MODEW::QDEC)
}
#[doc = "HALL operating mode"]
#[inline]
pub fn hall(self) -> &'a mut W {
self.variant(MODEW::HALL)
}
#[doc = "COUNTER operating mode"]
#[inline]
pub fn counter(self) -> &'a mut W {
self.variant(MODEW::COUNTER)
}
#[doc = r" Writes raw bits to the field"]
#[inline]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
const MASK: u8 = 3;
const OFFSET: u8 = 2;
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc = r" Proxy"]
pub struct _RUNSTDBYW<'a> {
w: &'a mut W,
}
impl<'a> _RUNSTDBYW<'a> {
#[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 = 6;
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 `CONF`"]
pub enum CONFW {
#[doc = "Quadrature decoder direction"]
X4,
#[doc = "Secure Quadrature decoder direction"]
X4S,
#[doc = "Decoder direction"]
X2,
#[doc = "Secure decoder direction"]
X2S,
#[doc = "Auto correction mode"]
AUTOC,
}
impl CONFW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _bits(&self) -> u8 {
match *self {
CONFW::X4 => 0,
CONFW::X4S => 1,
CONFW::X2 => 2,
CONFW::X2S => 3,
CONFW::AUTOC => 4,
}
}
}
#[doc = r" Proxy"]
pub struct _CONFW<'a> {
w: &'a mut W,
}
impl<'a> _CONFW<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: CONFW) -> &'a mut W {
unsafe { self.bits(variant._bits()) }
}
#[doc = "Quadrature decoder direction"]
#[inline]
pub fn x4(self) -> &'a mut W {
self.variant(CONFW::X4)
}
#[doc = "Secure Quadrature decoder direction"]
#[inline]
pub fn x4s(self) -> &'a mut W {
self.variant(CONFW::X4S)
}
#[doc = "Decoder direction"]
#[inline]
pub fn x2(self) -> &'a mut W {
self.variant(CONFW::X2)
}
#[doc = "Secure decoder direction"]
#[inline]
pub fn x2s(self) -> &'a mut W {
self.variant(CONFW::X2S)
}
#[doc = "Auto correction mode"]
#[inline]
pub fn autoc(self) -> &'a mut W {
self.variant(CONFW::AUTOC)
}
#[doc = r" Writes raw bits to the field"]
#[inline]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
const MASK: u8 = 7;
const OFFSET: u8 = 8;
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc = r" Proxy"]
pub struct _ALOCKW<'a> {
w: &'a mut W,
}
impl<'a> _ALOCKW<'a> {
#[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 = 11;
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc = r" Proxy"]
pub struct _SWAPW<'a> {
w: &'a mut W,
}
impl<'a> _SWAPW<'a> {
#[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 = 14;
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc = r" Proxy"]
pub struct _PERENW<'a> {
w: &'a mut W,
}
impl<'a> _PERENW<'a> {
#[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 = 15;
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc = r" Proxy"]
pub struct _PINEN0W<'a> {
w: &'a mut W,
}
impl<'a> _PINEN0W<'a> {
#[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 = r" Proxy"]
pub struct _PINEN1W<'a> {
w: &'a mut W,
}
impl<'a> _PINEN1W<'a> {
#[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 = r" Proxy"]
pub struct _PINEN2W<'a> {
w: &'a mut W,
}
impl<'a> _PINEN2W<'a> {
#[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 = r" Proxy"]
pub struct _PINVEN0W<'a> {
w: &'a mut W,
}
impl<'a> _PINVEN0W<'a> {
#[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 = 20;
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc = r" Proxy"]
pub struct _PINVEN1W<'a> {
w: &'a mut W,
}
impl<'a> _PINVEN1W<'a> {
#[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 = 21;
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc = r" Proxy"]
pub struct _PINVEN2W<'a> {
w: &'a mut W,
}
impl<'a> _PINVEN2W<'a> {
#[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 = 22;
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc = r" Proxy"]
pub struct _ANGULARW<'a> {
w: &'a mut W,
}
impl<'a> _ANGULARW<'a> {
#[doc = r" Writes raw bits to the field"]
#[inline]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
const MASK: u8 = 7;
const OFFSET: u8 = 24;
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc = r" Proxy"]
pub struct _MAXCMPW<'a> {
w: &'a mut W,
}
impl<'a> _MAXCMPW<'a> {
#[doc = r" Writes raw bits to the field"]
#[inline]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
const MASK: u8 = 15;
const OFFSET: u8 = 28;
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"]
#[inline]
pub fn enable(&self) -> ENABLER {
let bits = {
const MASK: bool = true;
const OFFSET: u8 = 1;
((self.bits >> OFFSET) & MASK as u32) != 0
};
ENABLER { bits }
}
#[doc = "Bits 2:3 - Operation Mode"]
#[inline]
pub fn mode(&self) -> MODER {
MODER::_from({
const MASK: u8 = 3;
const OFFSET: u8 = 2;
((self.bits >> OFFSET) & MASK as u32) as u8
})
}
#[doc = "Bit 6 - Run in Standby"]
#[inline]
pub fn runstdby(&self) -> RUNSTDBYR {
let bits = {
const MASK: bool = true;
const OFFSET: u8 = 6;
((self.bits >> OFFSET) & MASK as u32) != 0
};
RUNSTDBYR { bits }
}
#[doc = "Bits 8:10 - PDEC Configuration"]
#[inline]
pub fn conf(&self) -> CONFR {
CONFR::_from({
const MASK: u8 = 7;
const OFFSET: u8 = 8;
((self.bits >> OFFSET) & MASK as u32) as u8
})
}
#[doc = "Bit 11 - Auto Lock"]
#[inline]
pub fn alock(&self) -> ALOCKR {
let bits = {
const MASK: bool = true;
const OFFSET: u8 = 11;
((self.bits >> OFFSET) & MASK as u32) != 0
};
ALOCKR { bits }
}
#[doc = "Bit 14 - PDEC Phase A and B Swap"]
#[inline]
pub fn swap(&self) -> SWAPR {
let bits = {
const MASK: bool = true;
const OFFSET: u8 = 14;
((self.bits >> OFFSET) & MASK as u32) != 0
};
SWAPR { bits }
}
#[doc = "Bit 15 - Period Enable"]
#[inline]
pub fn peren(&self) -> PERENR {
let bits = {
const MASK: bool = true;
const OFFSET: u8 = 15;
((self.bits >> OFFSET) & MASK as u32) != 0
};
PERENR { bits }
}
#[doc = "Bit 16 - PDEC Input From Pin 0 Enable"]
#[inline]
pub fn pinen0(&self) -> PINEN0R {
let bits = {
const MASK: bool = true;
const OFFSET: u8 = 16;
((self.bits >> OFFSET) & MASK as u32) != 0
};
PINEN0R { bits }
}
#[doc = "Bit 17 - PDEC Input From Pin 1 Enable"]
#[inline]
pub fn pinen1(&self) -> PINEN1R {
let bits = {
const MASK: bool = true;
const OFFSET: u8 = 17;
((self.bits >> OFFSET) & MASK as u32) != 0
};
PINEN1R { bits }
}
#[doc = "Bit 18 - PDEC Input From Pin 2 Enable"]
#[inline]
pub fn pinen2(&self) -> PINEN2R {
let bits = {
const MASK: bool = true;
const OFFSET: u8 = 18;
((self.bits >> OFFSET) & MASK as u32) != 0
};
PINEN2R { bits }
}
#[doc = "Bit 20 - IO Pin 0 Invert Enable"]
#[inline]
pub fn pinven0(&self) -> PINVEN0R {
let bits = {
const MASK: bool = true;
const OFFSET: u8 = 20;
((self.bits >> OFFSET) & MASK as u32) != 0
};
PINVEN0R { bits }
}
#[doc = "Bit 21 - IO Pin 1 Invert Enable"]
#[inline]
pub fn pinven1(&self) -> PINVEN1R {
let bits = {
const MASK: bool = true;
const OFFSET: u8 = 21;
((self.bits >> OFFSET) & MASK as u32) != 0
};
PINVEN1R { bits }
}
#[doc = "Bit 22 - IO Pin 2 Invert Enable"]
#[inline]
pub fn pinven2(&self) -> PINVEN2R {
let bits = {
const MASK: bool = true;
const OFFSET: u8 = 22;
((self.bits >> OFFSET) & MASK as u32) != 0
};
PINVEN2R { bits }
}
#[doc = "Bits 24:26 - Angular Counter Length"]
#[inline]
pub fn angular(&self) -> ANGULARR {
let bits = {
const MASK: u8 = 7;
const OFFSET: u8 = 24;
((self.bits >> OFFSET) & MASK as u32) as u8
};
ANGULARR { bits }
}
#[doc = "Bits 28:31 - Maximum Consecutive Missing Pulses"]
#[inline]
pub fn maxcmp(&self) -> MAXCMPR {
let bits = {
const MASK: u8 = 15;
const OFFSET: u8 = 28;
((self.bits >> OFFSET) & MASK as u32) as u8
};
MAXCMPR { bits }
}
}
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 - Software Reset"]
#[inline]
pub fn swrst(&mut self) -> _SWRSTW {
_SWRSTW { w: self }
}
#[doc = "Bit 1 - Enable"]
#[inline]
pub fn enable(&mut self) -> _ENABLEW {
_ENABLEW { w: self }
}
#[doc = "Bits 2:3 - Operation Mode"]
#[inline]
pub fn mode(&mut self) -> _MODEW {
_MODEW { w: self }
}
#[doc = "Bit 6 - Run in Standby"]
#[inline]
pub fn runstdby(&mut self) -> _RUNSTDBYW {
_RUNSTDBYW { w: self }
}
#[doc = "Bits 8:10 - PDEC Configuration"]
#[inline]
pub fn conf(&mut self) -> _CONFW {
_CONFW { w: self }
}
#[doc = "Bit 11 - Auto Lock"]
#[inline]
pub fn alock(&mut self) -> _ALOCKW {
_ALOCKW { w: self }
}
#[doc = "Bit 14 - PDEC Phase A and B Swap"]
#[inline]
pub fn swap(&mut self) -> _SWAPW {
_SWAPW { w: self }
}
#[doc = "Bit 15 - Period Enable"]
#[inline]
pub fn peren(&mut self) -> _PERENW {
_PERENW { w: self }
}
#[doc = "Bit 16 - PDEC Input From Pin 0 Enable"]
#[inline]
pub fn pinen0(&mut self) -> _PINEN0W {
_PINEN0W { w: self }
}
#[doc = "Bit 17 - PDEC Input From Pin 1 Enable"]
#[inline]
pub fn pinen1(&mut self) -> _PINEN1W {
_PINEN1W { w: self }
}
#[doc = "Bit 18 - PDEC Input From Pin 2 Enable"]
#[inline]
pub fn pinen2(&mut self) -> _PINEN2W {
_PINEN2W { w: self }
}
#[doc = "Bit 20 - IO Pin 0 Invert Enable"]
#[inline]
pub fn pinven0(&mut self) -> _PINVEN0W {
_PINVEN0W { w: self }
}
#[doc = "Bit 21 - IO Pin 1 Invert Enable"]
#[inline]
pub fn pinven1(&mut self) -> _PINVEN1W {
_PINVEN1W { w: self }
}
#[doc = "Bit 22 - IO Pin 2 Invert Enable"]
#[inline]
pub fn pinven2(&mut self) -> _PINVEN2W {
_PINVEN2W { w: self }
}
#[doc = "Bits 24:26 - Angular Counter Length"]
#[inline]
pub fn angular(&mut self) -> _ANGULARW {
_ANGULARW { w: self }
}
#[doc = "Bits 28:31 - Maximum Consecutive Missing Pulses"]
#[inline]
pub fn maxcmp(&mut self) -> _MAXCMPW {
_MAXCMPW { w: self }
}
}