#[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::ROUTELOC2 {
#[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 `CDTI0LOC`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CDTI0LOCR {
#[doc = "Location 0"]
LOC0,
#[doc = "Location 1"]
LOC1,
#[doc = "Location 2"]
LOC2,
#[doc = "Location 3"]
LOC3,
#[doc = "Location 4"]
LOC4,
#[doc = r" Reserved"]
_Reserved(u8),
}
impl CDTI0LOCR {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bits(&self) -> u8 {
match *self {
CDTI0LOCR::LOC0 => 0,
CDTI0LOCR::LOC1 => 1,
CDTI0LOCR::LOC2 => 2,
CDTI0LOCR::LOC3 => 3,
CDTI0LOCR::LOC4 => 4,
CDTI0LOCR::_Reserved(bits) => bits,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _from(value: u8) -> CDTI0LOCR {
match value {
0 => CDTI0LOCR::LOC0,
1 => CDTI0LOCR::LOC1,
2 => CDTI0LOCR::LOC2,
3 => CDTI0LOCR::LOC3,
4 => CDTI0LOCR::LOC4,
i => CDTI0LOCR::_Reserved(i),
}
}
#[doc = "Checks if the value of the field is `LOC0`"]
#[inline]
pub fn is_loc0(&self) -> bool {
*self == CDTI0LOCR::LOC0
}
#[doc = "Checks if the value of the field is `LOC1`"]
#[inline]
pub fn is_loc1(&self) -> bool {
*self == CDTI0LOCR::LOC1
}
#[doc = "Checks if the value of the field is `LOC2`"]
#[inline]
pub fn is_loc2(&self) -> bool {
*self == CDTI0LOCR::LOC2
}
#[doc = "Checks if the value of the field is `LOC3`"]
#[inline]
pub fn is_loc3(&self) -> bool {
*self == CDTI0LOCR::LOC3
}
#[doc = "Checks if the value of the field is `LOC4`"]
#[inline]
pub fn is_loc4(&self) -> bool {
*self == CDTI0LOCR::LOC4
}
}
#[doc = "Possible values of the field `CDTI1LOC`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CDTI1LOCR {
#[doc = "Location 0"]
LOC0,
#[doc = "Location 1"]
LOC1,
#[doc = "Location 2"]
LOC2,
#[doc = "Location 3"]
LOC3,
#[doc = "Location 4"]
LOC4,
#[doc = r" Reserved"]
_Reserved(u8),
}
impl CDTI1LOCR {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bits(&self) -> u8 {
match *self {
CDTI1LOCR::LOC0 => 0,
CDTI1LOCR::LOC1 => 1,
CDTI1LOCR::LOC2 => 2,
CDTI1LOCR::LOC3 => 3,
CDTI1LOCR::LOC4 => 4,
CDTI1LOCR::_Reserved(bits) => bits,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _from(value: u8) -> CDTI1LOCR {
match value {
0 => CDTI1LOCR::LOC0,
1 => CDTI1LOCR::LOC1,
2 => CDTI1LOCR::LOC2,
3 => CDTI1LOCR::LOC3,
4 => CDTI1LOCR::LOC4,
i => CDTI1LOCR::_Reserved(i),
}
}
#[doc = "Checks if the value of the field is `LOC0`"]
#[inline]
pub fn is_loc0(&self) -> bool {
*self == CDTI1LOCR::LOC0
}
#[doc = "Checks if the value of the field is `LOC1`"]
#[inline]
pub fn is_loc1(&self) -> bool {
*self == CDTI1LOCR::LOC1
}
#[doc = "Checks if the value of the field is `LOC2`"]
#[inline]
pub fn is_loc2(&self) -> bool {
*self == CDTI1LOCR::LOC2
}
#[doc = "Checks if the value of the field is `LOC3`"]
#[inline]
pub fn is_loc3(&self) -> bool {
*self == CDTI1LOCR::LOC3
}
#[doc = "Checks if the value of the field is `LOC4`"]
#[inline]
pub fn is_loc4(&self) -> bool {
*self == CDTI1LOCR::LOC4
}
}
#[doc = "Possible values of the field `CDTI2LOC`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CDTI2LOCR {
#[doc = "Location 0"]
LOC0,
#[doc = "Location 1"]
LOC1,
#[doc = "Location 2"]
LOC2,
#[doc = "Location 3"]
LOC3,
#[doc = "Location 4"]
LOC4,
#[doc = r" Reserved"]
_Reserved(u8),
}
impl CDTI2LOCR {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bits(&self) -> u8 {
match *self {
CDTI2LOCR::LOC0 => 0,
CDTI2LOCR::LOC1 => 1,
CDTI2LOCR::LOC2 => 2,
CDTI2LOCR::LOC3 => 3,
CDTI2LOCR::LOC4 => 4,
CDTI2LOCR::_Reserved(bits) => bits,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _from(value: u8) -> CDTI2LOCR {
match value {
0 => CDTI2LOCR::LOC0,
1 => CDTI2LOCR::LOC1,
2 => CDTI2LOCR::LOC2,
3 => CDTI2LOCR::LOC3,
4 => CDTI2LOCR::LOC4,
i => CDTI2LOCR::_Reserved(i),
}
}
#[doc = "Checks if the value of the field is `LOC0`"]
#[inline]
pub fn is_loc0(&self) -> bool {
*self == CDTI2LOCR::LOC0
}
#[doc = "Checks if the value of the field is `LOC1`"]
#[inline]
pub fn is_loc1(&self) -> bool {
*self == CDTI2LOCR::LOC1
}
#[doc = "Checks if the value of the field is `LOC2`"]
#[inline]
pub fn is_loc2(&self) -> bool {
*self == CDTI2LOCR::LOC2
}
#[doc = "Checks if the value of the field is `LOC3`"]
#[inline]
pub fn is_loc3(&self) -> bool {
*self == CDTI2LOCR::LOC3
}
#[doc = "Checks if the value of the field is `LOC4`"]
#[inline]
pub fn is_loc4(&self) -> bool {
*self == CDTI2LOCR::LOC4
}
}
#[doc = "Values that can be written to the field `CDTI0LOC`"]
pub enum CDTI0LOCW {
#[doc = "Location 0"]
LOC0,
#[doc = "Location 1"]
LOC1,
#[doc = "Location 2"]
LOC2,
#[doc = "Location 3"]
LOC3,
#[doc = "Location 4"]
LOC4,
}
impl CDTI0LOCW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _bits(&self) -> u8 {
match *self {
CDTI0LOCW::LOC0 => 0,
CDTI0LOCW::LOC1 => 1,
CDTI0LOCW::LOC2 => 2,
CDTI0LOCW::LOC3 => 3,
CDTI0LOCW::LOC4 => 4,
}
}
}
#[doc = r" Proxy"]
pub struct _CDTI0LOCW<'a> {
w: &'a mut W,
}
impl<'a> _CDTI0LOCW<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: CDTI0LOCW) -> &'a mut W {
unsafe { self.bits(variant._bits()) }
}
#[doc = "Location 0"]
#[inline]
pub fn loc0(self) -> &'a mut W {
self.variant(CDTI0LOCW::LOC0)
}
#[doc = "Location 1"]
#[inline]
pub fn loc1(self) -> &'a mut W {
self.variant(CDTI0LOCW::LOC1)
}
#[doc = "Location 2"]
#[inline]
pub fn loc2(self) -> &'a mut W {
self.variant(CDTI0LOCW::LOC2)
}
#[doc = "Location 3"]
#[inline]
pub fn loc3(self) -> &'a mut W {
self.variant(CDTI0LOCW::LOC3)
}
#[doc = "Location 4"]
#[inline]
pub fn loc4(self) -> &'a mut W {
self.variant(CDTI0LOCW::LOC4)
}
#[doc = r" Writes raw bits to the field"]
#[inline]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
const MASK: u8 = 63;
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 `CDTI1LOC`"]
pub enum CDTI1LOCW {
#[doc = "Location 0"]
LOC0,
#[doc = "Location 1"]
LOC1,
#[doc = "Location 2"]
LOC2,
#[doc = "Location 3"]
LOC3,
#[doc = "Location 4"]
LOC4,
}
impl CDTI1LOCW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _bits(&self) -> u8 {
match *self {
CDTI1LOCW::LOC0 => 0,
CDTI1LOCW::LOC1 => 1,
CDTI1LOCW::LOC2 => 2,
CDTI1LOCW::LOC3 => 3,
CDTI1LOCW::LOC4 => 4,
}
}
}
#[doc = r" Proxy"]
pub struct _CDTI1LOCW<'a> {
w: &'a mut W,
}
impl<'a> _CDTI1LOCW<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: CDTI1LOCW) -> &'a mut W {
unsafe { self.bits(variant._bits()) }
}
#[doc = "Location 0"]
#[inline]
pub fn loc0(self) -> &'a mut W {
self.variant(CDTI1LOCW::LOC0)
}
#[doc = "Location 1"]
#[inline]
pub fn loc1(self) -> &'a mut W {
self.variant(CDTI1LOCW::LOC1)
}
#[doc = "Location 2"]
#[inline]
pub fn loc2(self) -> &'a mut W {
self.variant(CDTI1LOCW::LOC2)
}
#[doc = "Location 3"]
#[inline]
pub fn loc3(self) -> &'a mut W {
self.variant(CDTI1LOCW::LOC3)
}
#[doc = "Location 4"]
#[inline]
pub fn loc4(self) -> &'a mut W {
self.variant(CDTI1LOCW::LOC4)
}
#[doc = r" Writes raw bits to the field"]
#[inline]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
const MASK: u8 = 63;
const OFFSET: u8 = 8;
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 `CDTI2LOC`"]
pub enum CDTI2LOCW {
#[doc = "Location 0"]
LOC0,
#[doc = "Location 1"]
LOC1,
#[doc = "Location 2"]
LOC2,
#[doc = "Location 3"]
LOC3,
#[doc = "Location 4"]
LOC4,
}
impl CDTI2LOCW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _bits(&self) -> u8 {
match *self {
CDTI2LOCW::LOC0 => 0,
CDTI2LOCW::LOC1 => 1,
CDTI2LOCW::LOC2 => 2,
CDTI2LOCW::LOC3 => 3,
CDTI2LOCW::LOC4 => 4,
}
}
}
#[doc = r" Proxy"]
pub struct _CDTI2LOCW<'a> {
w: &'a mut W,
}
impl<'a> _CDTI2LOCW<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: CDTI2LOCW) -> &'a mut W {
unsafe { self.bits(variant._bits()) }
}
#[doc = "Location 0"]
#[inline]
pub fn loc0(self) -> &'a mut W {
self.variant(CDTI2LOCW::LOC0)
}
#[doc = "Location 1"]
#[inline]
pub fn loc1(self) -> &'a mut W {
self.variant(CDTI2LOCW::LOC1)
}
#[doc = "Location 2"]
#[inline]
pub fn loc2(self) -> &'a mut W {
self.variant(CDTI2LOCW::LOC2)
}
#[doc = "Location 3"]
#[inline]
pub fn loc3(self) -> &'a mut W {
self.variant(CDTI2LOCW::LOC3)
}
#[doc = "Location 4"]
#[inline]
pub fn loc4(self) -> &'a mut W {
self.variant(CDTI2LOCW::LOC4)
}
#[doc = r" Writes raw bits to the field"]
#[inline]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
const MASK: u8 = 63;
const OFFSET: u8 = 16;
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 = "Bits 0:5 - I/O Location"]
#[inline]
pub fn cdti0loc(&self) -> CDTI0LOCR {
CDTI0LOCR::_from({
const MASK: u8 = 63;
const OFFSET: u8 = 0;
((self.bits >> OFFSET) & MASK as u32) as u8
})
}
#[doc = "Bits 8:13 - I/O Location"]
#[inline]
pub fn cdti1loc(&self) -> CDTI1LOCR {
CDTI1LOCR::_from({
const MASK: u8 = 63;
const OFFSET: u8 = 8;
((self.bits >> OFFSET) & MASK as u32) as u8
})
}
#[doc = "Bits 16:21 - I/O Location"]
#[inline]
pub fn cdti2loc(&self) -> CDTI2LOCR {
CDTI2LOCR::_from({
const MASK: u8 = 63;
const OFFSET: u8 = 16;
((self.bits >> OFFSET) & MASK as u32) as u8
})
}
}
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 = "Bits 0:5 - I/O Location"]
#[inline]
pub fn cdti0loc(&mut self) -> _CDTI0LOCW {
_CDTI0LOCW { w: self }
}
#[doc = "Bits 8:13 - I/O Location"]
#[inline]
pub fn cdti1loc(&mut self) -> _CDTI1LOCW {
_CDTI1LOCW { w: self }
}
#[doc = "Bits 16:21 - I/O Location"]
#[inline]
pub fn cdti2loc(&mut self) -> _CDTI2LOCW {
_CDTI2LOCW { w: self }
}
}