#[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::ROUTELOC0 {
#[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 `OUT0LOC`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum OUT0LOCR {
#[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 = "Location 7"]
LOC7,
#[doc = r" Reserved"]
_Reserved(u8),
}
impl OUT0LOCR {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bits(&self) -> u8 {
match *self {
OUT0LOCR::LOC0 => 0,
OUT0LOCR::LOC1 => 1,
OUT0LOCR::LOC2 => 2,
OUT0LOCR::LOC3 => 3,
OUT0LOCR::LOC4 => 4,
OUT0LOCR::LOC5 => 5,
OUT0LOCR::LOC6 => 6,
OUT0LOCR::LOC7 => 7,
OUT0LOCR::_Reserved(bits) => bits,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _from(value: u8) -> OUT0LOCR {
match value {
0 => OUT0LOCR::LOC0,
1 => OUT0LOCR::LOC1,
2 => OUT0LOCR::LOC2,
3 => OUT0LOCR::LOC3,
4 => OUT0LOCR::LOC4,
5 => OUT0LOCR::LOC5,
6 => OUT0LOCR::LOC6,
7 => OUT0LOCR::LOC7,
i => OUT0LOCR::_Reserved(i),
}
}
#[doc = "Checks if the value of the field is `LOC0`"]
#[inline]
pub fn is_loc0(&self) -> bool {
*self == OUT0LOCR::LOC0
}
#[doc = "Checks if the value of the field is `LOC1`"]
#[inline]
pub fn is_loc1(&self) -> bool {
*self == OUT0LOCR::LOC1
}
#[doc = "Checks if the value of the field is `LOC2`"]
#[inline]
pub fn is_loc2(&self) -> bool {
*self == OUT0LOCR::LOC2
}
#[doc = "Checks if the value of the field is `LOC3`"]
#[inline]
pub fn is_loc3(&self) -> bool {
*self == OUT0LOCR::LOC3
}
#[doc = "Checks if the value of the field is `LOC4`"]
#[inline]
pub fn is_loc4(&self) -> bool {
*self == OUT0LOCR::LOC4
}
#[doc = "Checks if the value of the field is `LOC5`"]
#[inline]
pub fn is_loc5(&self) -> bool {
*self == OUT0LOCR::LOC5
}
#[doc = "Checks if the value of the field is `LOC6`"]
#[inline]
pub fn is_loc6(&self) -> bool {
*self == OUT0LOCR::LOC6
}
#[doc = "Checks if the value of the field is `LOC7`"]
#[inline]
pub fn is_loc7(&self) -> bool {
*self == OUT0LOCR::LOC7
}
}
#[doc = "Possible values of the field `OUT1LOC`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum OUT1LOCR {
#[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 = "Location 7"]
LOC7,
#[doc = r" Reserved"]
_Reserved(u8),
}
impl OUT1LOCR {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bits(&self) -> u8 {
match *self {
OUT1LOCR::LOC0 => 0,
OUT1LOCR::LOC1 => 1,
OUT1LOCR::LOC2 => 2,
OUT1LOCR::LOC3 => 3,
OUT1LOCR::LOC4 => 4,
OUT1LOCR::LOC5 => 5,
OUT1LOCR::LOC6 => 6,
OUT1LOCR::LOC7 => 7,
OUT1LOCR::_Reserved(bits) => bits,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _from(value: u8) -> OUT1LOCR {
match value {
0 => OUT1LOCR::LOC0,
1 => OUT1LOCR::LOC1,
2 => OUT1LOCR::LOC2,
3 => OUT1LOCR::LOC3,
4 => OUT1LOCR::LOC4,
5 => OUT1LOCR::LOC5,
6 => OUT1LOCR::LOC6,
7 => OUT1LOCR::LOC7,
i => OUT1LOCR::_Reserved(i),
}
}
#[doc = "Checks if the value of the field is `LOC0`"]
#[inline]
pub fn is_loc0(&self) -> bool {
*self == OUT1LOCR::LOC0
}
#[doc = "Checks if the value of the field is `LOC1`"]
#[inline]
pub fn is_loc1(&self) -> bool {
*self == OUT1LOCR::LOC1
}
#[doc = "Checks if the value of the field is `LOC2`"]
#[inline]
pub fn is_loc2(&self) -> bool {
*self == OUT1LOCR::LOC2
}
#[doc = "Checks if the value of the field is `LOC3`"]
#[inline]
pub fn is_loc3(&self) -> bool {
*self == OUT1LOCR::LOC3
}
#[doc = "Checks if the value of the field is `LOC4`"]
#[inline]
pub fn is_loc4(&self) -> bool {
*self == OUT1LOCR::LOC4
}
#[doc = "Checks if the value of the field is `LOC5`"]
#[inline]
pub fn is_loc5(&self) -> bool {
*self == OUT1LOCR::LOC5
}
#[doc = "Checks if the value of the field is `LOC6`"]
#[inline]
pub fn is_loc6(&self) -> bool {
*self == OUT1LOCR::LOC6
}
#[doc = "Checks if the value of the field is `LOC7`"]
#[inline]
pub fn is_loc7(&self) -> bool {
*self == OUT1LOCR::LOC7
}
}
#[doc = "Values that can be written to the field `OUT0LOC`"]
pub enum OUT0LOCW {
#[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 = "Location 7"]
LOC7,
}
impl OUT0LOCW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _bits(&self) -> u8 {
match *self {
OUT0LOCW::LOC0 => 0,
OUT0LOCW::LOC1 => 1,
OUT0LOCW::LOC2 => 2,
OUT0LOCW::LOC3 => 3,
OUT0LOCW::LOC4 => 4,
OUT0LOCW::LOC5 => 5,
OUT0LOCW::LOC6 => 6,
OUT0LOCW::LOC7 => 7,
}
}
}
#[doc = r" Proxy"]
pub struct _OUT0LOCW<'a> {
w: &'a mut W,
}
impl<'a> _OUT0LOCW<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: OUT0LOCW) -> &'a mut W {
unsafe { self.bits(variant._bits()) }
}
#[doc = "Location 0"]
#[inline]
pub fn loc0(self) -> &'a mut W {
self.variant(OUT0LOCW::LOC0)
}
#[doc = "Location 1"]
#[inline]
pub fn loc1(self) -> &'a mut W {
self.variant(OUT0LOCW::LOC1)
}
#[doc = "Location 2"]
#[inline]
pub fn loc2(self) -> &'a mut W {
self.variant(OUT0LOCW::LOC2)
}
#[doc = "Location 3"]
#[inline]
pub fn loc3(self) -> &'a mut W {
self.variant(OUT0LOCW::LOC3)
}
#[doc = "Location 4"]
#[inline]
pub fn loc4(self) -> &'a mut W {
self.variant(OUT0LOCW::LOC4)
}
#[doc = "Location 5"]
#[inline]
pub fn loc5(self) -> &'a mut W {
self.variant(OUT0LOCW::LOC5)
}
#[doc = "Location 6"]
#[inline]
pub fn loc6(self) -> &'a mut W {
self.variant(OUT0LOCW::LOC6)
}
#[doc = "Location 7"]
#[inline]
pub fn loc7(self) -> &'a mut W {
self.variant(OUT0LOCW::LOC7)
}
#[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 `OUT1LOC`"]
pub enum OUT1LOCW {
#[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 = "Location 7"]
LOC7,
}
impl OUT1LOCW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _bits(&self) -> u8 {
match *self {
OUT1LOCW::LOC0 => 0,
OUT1LOCW::LOC1 => 1,
OUT1LOCW::LOC2 => 2,
OUT1LOCW::LOC3 => 3,
OUT1LOCW::LOC4 => 4,
OUT1LOCW::LOC5 => 5,
OUT1LOCW::LOC6 => 6,
OUT1LOCW::LOC7 => 7,
}
}
}
#[doc = r" Proxy"]
pub struct _OUT1LOCW<'a> {
w: &'a mut W,
}
impl<'a> _OUT1LOCW<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: OUT1LOCW) -> &'a mut W {
unsafe { self.bits(variant._bits()) }
}
#[doc = "Location 0"]
#[inline]
pub fn loc0(self) -> &'a mut W {
self.variant(OUT1LOCW::LOC0)
}
#[doc = "Location 1"]
#[inline]
pub fn loc1(self) -> &'a mut W {
self.variant(OUT1LOCW::LOC1)
}
#[doc = "Location 2"]
#[inline]
pub fn loc2(self) -> &'a mut W {
self.variant(OUT1LOCW::LOC2)
}
#[doc = "Location 3"]
#[inline]
pub fn loc3(self) -> &'a mut W {
self.variant(OUT1LOCW::LOC3)
}
#[doc = "Location 4"]
#[inline]
pub fn loc4(self) -> &'a mut W {
self.variant(OUT1LOCW::LOC4)
}
#[doc = "Location 5"]
#[inline]
pub fn loc5(self) -> &'a mut W {
self.variant(OUT1LOCW::LOC5)
}
#[doc = "Location 6"]
#[inline]
pub fn loc6(self) -> &'a mut W {
self.variant(OUT1LOCW::LOC6)
}
#[doc = "Location 7"]
#[inline]
pub fn loc7(self) -> &'a mut W {
self.variant(OUT1LOCW::LOC7)
}
#[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 out0loc(&self) -> OUT0LOCR {
OUT0LOCR::_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 out1loc(&self) -> OUT1LOCR {
OUT1LOCR::_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 out0loc(&mut self) -> _OUT0LOCW {
_OUT0LOCW { w: self }
}
#[doc = "Bits 8:13 - I/O Location"]
#[inline]
pub fn out1loc(&mut self) -> _OUT1LOCW {
_OUT1LOCW { w: self }
}
}