#[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::ROUTELOC1 {
#[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 `CTSLOC`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CTSLOCR {
#[doc = "Location 0"]
LOC0,
#[doc = "Location 1"]
LOC1,
#[doc = "Location 2"]
LOC2,
#[doc = "Location 3"]
LOC3,
#[doc = "Location 4"]
LOC4,
#[doc = "Location 5"]
LOC5,
#[doc = "Location 6"]
LOC6,
#[doc = r" Reserved"]
_Reserved(u8),
}
impl CTSLOCR {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bits(&self) -> u8 {
match *self {
CTSLOCR::LOC0 => 0,
CTSLOCR::LOC1 => 1,
CTSLOCR::LOC2 => 2,
CTSLOCR::LOC3 => 3,
CTSLOCR::LOC4 => 4,
CTSLOCR::LOC5 => 5,
CTSLOCR::LOC6 => 6,
CTSLOCR::_Reserved(bits) => bits,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _from(value: u8) -> CTSLOCR {
match value {
0 => CTSLOCR::LOC0,
1 => CTSLOCR::LOC1,
2 => CTSLOCR::LOC2,
3 => CTSLOCR::LOC3,
4 => CTSLOCR::LOC4,
5 => CTSLOCR::LOC5,
6 => CTSLOCR::LOC6,
i => CTSLOCR::_Reserved(i),
}
}
#[doc = "Checks if the value of the field is `LOC0`"]
#[inline]
pub fn is_loc0(&self) -> bool {
*self == CTSLOCR::LOC0
}
#[doc = "Checks if the value of the field is `LOC1`"]
#[inline]
pub fn is_loc1(&self) -> bool {
*self == CTSLOCR::LOC1
}
#[doc = "Checks if the value of the field is `LOC2`"]
#[inline]
pub fn is_loc2(&self) -> bool {
*self == CTSLOCR::LOC2
}
#[doc = "Checks if the value of the field is `LOC3`"]
#[inline]
pub fn is_loc3(&self) -> bool {
*self == CTSLOCR::LOC3
}
#[doc = "Checks if the value of the field is `LOC4`"]
#[inline]
pub fn is_loc4(&self) -> bool {
*self == CTSLOCR::LOC4
}
#[doc = "Checks if the value of the field is `LOC5`"]
#[inline]
pub fn is_loc5(&self) -> bool {
*self == CTSLOCR::LOC5
}
#[doc = "Checks if the value of the field is `LOC6`"]
#[inline]
pub fn is_loc6(&self) -> bool {
*self == CTSLOCR::LOC6
}
}
#[doc = "Possible values of the field `RTSLOC`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum RTSLOCR {
#[doc = "Location 0"]
LOC0,
#[doc = "Location 1"]
LOC1,
#[doc = "Location 2"]
LOC2,
#[doc = "Location 3"]
LOC3,
#[doc = "Location 4"]
LOC4,
#[doc = "Location 5"]
LOC5,
#[doc = "Location 6"]
LOC6,
#[doc = r" Reserved"]
_Reserved(u8),
}
impl RTSLOCR {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bits(&self) -> u8 {
match *self {
RTSLOCR::LOC0 => 0,
RTSLOCR::LOC1 => 1,
RTSLOCR::LOC2 => 2,
RTSLOCR::LOC3 => 3,
RTSLOCR::LOC4 => 4,
RTSLOCR::LOC5 => 5,
RTSLOCR::LOC6 => 6,
RTSLOCR::_Reserved(bits) => bits,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _from(value: u8) -> RTSLOCR {
match value {
0 => RTSLOCR::LOC0,
1 => RTSLOCR::LOC1,
2 => RTSLOCR::LOC2,
3 => RTSLOCR::LOC3,
4 => RTSLOCR::LOC4,
5 => RTSLOCR::LOC5,
6 => RTSLOCR::LOC6,
i => RTSLOCR::_Reserved(i),
}
}
#[doc = "Checks if the value of the field is `LOC0`"]
#[inline]
pub fn is_loc0(&self) -> bool {
*self == RTSLOCR::LOC0
}
#[doc = "Checks if the value of the field is `LOC1`"]
#[inline]
pub fn is_loc1(&self) -> bool {
*self == RTSLOCR::LOC1
}
#[doc = "Checks if the value of the field is `LOC2`"]
#[inline]
pub fn is_loc2(&self) -> bool {
*self == RTSLOCR::LOC2
}
#[doc = "Checks if the value of the field is `LOC3`"]
#[inline]
pub fn is_loc3(&self) -> bool {
*self == RTSLOCR::LOC3
}
#[doc = "Checks if the value of the field is `LOC4`"]
#[inline]
pub fn is_loc4(&self) -> bool {
*self == RTSLOCR::LOC4
}
#[doc = "Checks if the value of the field is `LOC5`"]
#[inline]
pub fn is_loc5(&self) -> bool {
*self == RTSLOCR::LOC5
}
#[doc = "Checks if the value of the field is `LOC6`"]
#[inline]
pub fn is_loc6(&self) -> bool {
*self == RTSLOCR::LOC6
}
}
#[doc = "Values that can be written to the field `CTSLOC`"]
pub enum CTSLOCW {
#[doc = "Location 0"]
LOC0,
#[doc = "Location 1"]
LOC1,
#[doc = "Location 2"]
LOC2,
#[doc = "Location 3"]
LOC3,
#[doc = "Location 4"]
LOC4,
#[doc = "Location 5"]
LOC5,
#[doc = "Location 6"]
LOC6,
}
impl CTSLOCW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _bits(&self) -> u8 {
match *self {
CTSLOCW::LOC0 => 0,
CTSLOCW::LOC1 => 1,
CTSLOCW::LOC2 => 2,
CTSLOCW::LOC3 => 3,
CTSLOCW::LOC4 => 4,
CTSLOCW::LOC5 => 5,
CTSLOCW::LOC6 => 6,
}
}
}
#[doc = r" Proxy"]
pub struct _CTSLOCW<'a> {
w: &'a mut W,
}
impl<'a> _CTSLOCW<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: CTSLOCW) -> &'a mut W {
unsafe { self.bits(variant._bits()) }
}
#[doc = "Location 0"]
#[inline]
pub fn loc0(self) -> &'a mut W {
self.variant(CTSLOCW::LOC0)
}
#[doc = "Location 1"]
#[inline]
pub fn loc1(self) -> &'a mut W {
self.variant(CTSLOCW::LOC1)
}
#[doc = "Location 2"]
#[inline]
pub fn loc2(self) -> &'a mut W {
self.variant(CTSLOCW::LOC2)
}
#[doc = "Location 3"]
#[inline]
pub fn loc3(self) -> &'a mut W {
self.variant(CTSLOCW::LOC3)
}
#[doc = "Location 4"]
#[inline]
pub fn loc4(self) -> &'a mut W {
self.variant(CTSLOCW::LOC4)
}
#[doc = "Location 5"]
#[inline]
pub fn loc5(self) -> &'a mut W {
self.variant(CTSLOCW::LOC5)
}
#[doc = "Location 6"]
#[inline]
pub fn loc6(self) -> &'a mut W {
self.variant(CTSLOCW::LOC6)
}
#[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 `RTSLOC`"]
pub enum RTSLOCW {
#[doc = "Location 0"]
LOC0,
#[doc = "Location 1"]
LOC1,
#[doc = "Location 2"]
LOC2,
#[doc = "Location 3"]
LOC3,
#[doc = "Location 4"]
LOC4,
#[doc = "Location 5"]
LOC5,
#[doc = "Location 6"]
LOC6,
}
impl RTSLOCW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _bits(&self) -> u8 {
match *self {
RTSLOCW::LOC0 => 0,
RTSLOCW::LOC1 => 1,
RTSLOCW::LOC2 => 2,
RTSLOCW::LOC3 => 3,
RTSLOCW::LOC4 => 4,
RTSLOCW::LOC5 => 5,
RTSLOCW::LOC6 => 6,
}
}
}
#[doc = r" Proxy"]
pub struct _RTSLOCW<'a> {
w: &'a mut W,
}
impl<'a> _RTSLOCW<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: RTSLOCW) -> &'a mut W {
unsafe { self.bits(variant._bits()) }
}
#[doc = "Location 0"]
#[inline]
pub fn loc0(self) -> &'a mut W {
self.variant(RTSLOCW::LOC0)
}
#[doc = "Location 1"]
#[inline]
pub fn loc1(self) -> &'a mut W {
self.variant(RTSLOCW::LOC1)
}
#[doc = "Location 2"]
#[inline]
pub fn loc2(self) -> &'a mut W {
self.variant(RTSLOCW::LOC2)
}
#[doc = "Location 3"]
#[inline]
pub fn loc3(self) -> &'a mut W {
self.variant(RTSLOCW::LOC3)
}
#[doc = "Location 4"]
#[inline]
pub fn loc4(self) -> &'a mut W {
self.variant(RTSLOCW::LOC4)
}
#[doc = "Location 5"]
#[inline]
pub fn loc5(self) -> &'a mut W {
self.variant(RTSLOCW::LOC5)
}
#[doc = "Location 6"]
#[inline]
pub fn loc6(self) -> &'a mut W {
self.variant(RTSLOCW::LOC6)
}
#[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
}
}
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 ctsloc(&self) -> CTSLOCR {
CTSLOCR::_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 rtsloc(&self) -> RTSLOCR {
RTSLOCR::_from({
const MASK: u8 = 63;
const OFFSET: u8 = 8;
((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 ctsloc(&mut self) -> _CTSLOCW {
_CTSLOCW { w: self }
}
#[doc = "Bits 8:13 - I/O Location"]
#[inline]
pub fn rtsloc(&mut self) -> _RTSLOCW {
_RTSLOCW { w: self }
}
}