784 lines
23 KiB
Rust
784 lines
23 KiB
Rust
#[doc = r" Value read from the register"]
|
|
pub struct R {
|
|
bits: u16,
|
|
}
|
|
#[doc = r" Value to write to the register"]
|
|
pub struct W {
|
|
bits: u16,
|
|
}
|
|
impl super::CAPTIOXCTL {
|
|
#[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 `CAPTIOPISELx`"]
|
|
#[derive(Clone, Copy, Debug, PartialEq)]
|
|
pub enum CAPTIOPISELXR {
|
|
#[doc = "Px.0"]
|
|
CAPTIOPISELX_0,
|
|
#[doc = "Px.1"]
|
|
CAPTIOPISELX_1,
|
|
#[doc = "Px.2"]
|
|
CAPTIOPISELX_2,
|
|
#[doc = "Px.3"]
|
|
CAPTIOPISELX_3,
|
|
#[doc = "Px.4"]
|
|
CAPTIOPISELX_4,
|
|
#[doc = "Px.5"]
|
|
CAPTIOPISELX_5,
|
|
#[doc = "Px.6"]
|
|
CAPTIOPISELX_6,
|
|
#[doc = "Px.7"]
|
|
CAPTIOPISELX_7,
|
|
}
|
|
impl CAPTIOPISELXR {
|
|
#[doc = r" Value of the field as raw bits"]
|
|
#[inline]
|
|
pub fn bits(&self) -> u8 {
|
|
match *self {
|
|
CAPTIOPISELXR::CAPTIOPISELX_0 => 0,
|
|
CAPTIOPISELXR::CAPTIOPISELX_1 => 1,
|
|
CAPTIOPISELXR::CAPTIOPISELX_2 => 2,
|
|
CAPTIOPISELXR::CAPTIOPISELX_3 => 3,
|
|
CAPTIOPISELXR::CAPTIOPISELX_4 => 4,
|
|
CAPTIOPISELXR::CAPTIOPISELX_5 => 5,
|
|
CAPTIOPISELXR::CAPTIOPISELX_6 => 6,
|
|
CAPTIOPISELXR::CAPTIOPISELX_7 => 7,
|
|
}
|
|
}
|
|
#[allow(missing_docs)]
|
|
#[doc(hidden)]
|
|
#[inline]
|
|
pub fn _from(value: u8) -> CAPTIOPISELXR {
|
|
match value {
|
|
0 => CAPTIOPISELXR::CAPTIOPISELX_0,
|
|
1 => CAPTIOPISELXR::CAPTIOPISELX_1,
|
|
2 => CAPTIOPISELXR::CAPTIOPISELX_2,
|
|
3 => CAPTIOPISELXR::CAPTIOPISELX_3,
|
|
4 => CAPTIOPISELXR::CAPTIOPISELX_4,
|
|
5 => CAPTIOPISELXR::CAPTIOPISELX_5,
|
|
6 => CAPTIOPISELXR::CAPTIOPISELX_6,
|
|
7 => CAPTIOPISELXR::CAPTIOPISELX_7,
|
|
_ => unreachable!(),
|
|
}
|
|
}
|
|
#[doc = "Checks if the value of the field is `CAPTIOPISELX_0`"]
|
|
#[inline]
|
|
pub fn is_captiopiselx_0(&self) -> bool {
|
|
*self == CAPTIOPISELXR::CAPTIOPISELX_0
|
|
}
|
|
#[doc = "Checks if the value of the field is `CAPTIOPISELX_1`"]
|
|
#[inline]
|
|
pub fn is_captiopiselx_1(&self) -> bool {
|
|
*self == CAPTIOPISELXR::CAPTIOPISELX_1
|
|
}
|
|
#[doc = "Checks if the value of the field is `CAPTIOPISELX_2`"]
|
|
#[inline]
|
|
pub fn is_captiopiselx_2(&self) -> bool {
|
|
*self == CAPTIOPISELXR::CAPTIOPISELX_2
|
|
}
|
|
#[doc = "Checks if the value of the field is `CAPTIOPISELX_3`"]
|
|
#[inline]
|
|
pub fn is_captiopiselx_3(&self) -> bool {
|
|
*self == CAPTIOPISELXR::CAPTIOPISELX_3
|
|
}
|
|
#[doc = "Checks if the value of the field is `CAPTIOPISELX_4`"]
|
|
#[inline]
|
|
pub fn is_captiopiselx_4(&self) -> bool {
|
|
*self == CAPTIOPISELXR::CAPTIOPISELX_4
|
|
}
|
|
#[doc = "Checks if the value of the field is `CAPTIOPISELX_5`"]
|
|
#[inline]
|
|
pub fn is_captiopiselx_5(&self) -> bool {
|
|
*self == CAPTIOPISELXR::CAPTIOPISELX_5
|
|
}
|
|
#[doc = "Checks if the value of the field is `CAPTIOPISELX_6`"]
|
|
#[inline]
|
|
pub fn is_captiopiselx_6(&self) -> bool {
|
|
*self == CAPTIOPISELXR::CAPTIOPISELX_6
|
|
}
|
|
#[doc = "Checks if the value of the field is `CAPTIOPISELX_7`"]
|
|
#[inline]
|
|
pub fn is_captiopiselx_7(&self) -> bool {
|
|
*self == CAPTIOPISELXR::CAPTIOPISELX_7
|
|
}
|
|
}
|
|
#[doc = "Possible values of the field `CAPTIOPOSELx`"]
|
|
#[derive(Clone, Copy, Debug, PartialEq)]
|
|
pub enum CAPTIOPOSELXR {
|
|
#[doc = "Px = PJ"]
|
|
CAPTIOPOSELX_0,
|
|
#[doc = "Px = P1"]
|
|
CAPTIOPOSELX_1,
|
|
#[doc = "Px = P2"]
|
|
CAPTIOPOSELX_2,
|
|
#[doc = "Px = P3"]
|
|
CAPTIOPOSELX_3,
|
|
#[doc = "Px = P4"]
|
|
CAPTIOPOSELX_4,
|
|
#[doc = "Px = P5"]
|
|
CAPTIOPOSELX_5,
|
|
#[doc = "Px = P6"]
|
|
CAPTIOPOSELX_6,
|
|
#[doc = "Px = P7"]
|
|
CAPTIOPOSELX_7,
|
|
#[doc = "Px = P8"]
|
|
CAPTIOPOSELX_8,
|
|
#[doc = "Px = P9"]
|
|
CAPTIOPOSELX_9,
|
|
#[doc = "Px = P10"]
|
|
CAPTIOPOSELX_10,
|
|
#[doc = "Px = P11"]
|
|
CAPTIOPOSELX_11,
|
|
#[doc = "Px = P12"]
|
|
CAPTIOPOSELX_12,
|
|
#[doc = "Px = P13"]
|
|
CAPTIOPOSELX_13,
|
|
#[doc = "Px = P14"]
|
|
CAPTIOPOSELX_14,
|
|
#[doc = "Px = P15"]
|
|
CAPTIOPOSELX_15,
|
|
}
|
|
impl CAPTIOPOSELXR {
|
|
#[doc = r" Value of the field as raw bits"]
|
|
#[inline]
|
|
pub fn bits(&self) -> u8 {
|
|
match *self {
|
|
CAPTIOPOSELXR::CAPTIOPOSELX_0 => 0,
|
|
CAPTIOPOSELXR::CAPTIOPOSELX_1 => 1,
|
|
CAPTIOPOSELXR::CAPTIOPOSELX_2 => 2,
|
|
CAPTIOPOSELXR::CAPTIOPOSELX_3 => 3,
|
|
CAPTIOPOSELXR::CAPTIOPOSELX_4 => 4,
|
|
CAPTIOPOSELXR::CAPTIOPOSELX_5 => 5,
|
|
CAPTIOPOSELXR::CAPTIOPOSELX_6 => 6,
|
|
CAPTIOPOSELXR::CAPTIOPOSELX_7 => 7,
|
|
CAPTIOPOSELXR::CAPTIOPOSELX_8 => 8,
|
|
CAPTIOPOSELXR::CAPTIOPOSELX_9 => 9,
|
|
CAPTIOPOSELXR::CAPTIOPOSELX_10 => 10,
|
|
CAPTIOPOSELXR::CAPTIOPOSELX_11 => 11,
|
|
CAPTIOPOSELXR::CAPTIOPOSELX_12 => 12,
|
|
CAPTIOPOSELXR::CAPTIOPOSELX_13 => 13,
|
|
CAPTIOPOSELXR::CAPTIOPOSELX_14 => 14,
|
|
CAPTIOPOSELXR::CAPTIOPOSELX_15 => 15,
|
|
}
|
|
}
|
|
#[allow(missing_docs)]
|
|
#[doc(hidden)]
|
|
#[inline]
|
|
pub fn _from(value: u8) -> CAPTIOPOSELXR {
|
|
match value {
|
|
0 => CAPTIOPOSELXR::CAPTIOPOSELX_0,
|
|
1 => CAPTIOPOSELXR::CAPTIOPOSELX_1,
|
|
2 => CAPTIOPOSELXR::CAPTIOPOSELX_2,
|
|
3 => CAPTIOPOSELXR::CAPTIOPOSELX_3,
|
|
4 => CAPTIOPOSELXR::CAPTIOPOSELX_4,
|
|
5 => CAPTIOPOSELXR::CAPTIOPOSELX_5,
|
|
6 => CAPTIOPOSELXR::CAPTIOPOSELX_6,
|
|
7 => CAPTIOPOSELXR::CAPTIOPOSELX_7,
|
|
8 => CAPTIOPOSELXR::CAPTIOPOSELX_8,
|
|
9 => CAPTIOPOSELXR::CAPTIOPOSELX_9,
|
|
10 => CAPTIOPOSELXR::CAPTIOPOSELX_10,
|
|
11 => CAPTIOPOSELXR::CAPTIOPOSELX_11,
|
|
12 => CAPTIOPOSELXR::CAPTIOPOSELX_12,
|
|
13 => CAPTIOPOSELXR::CAPTIOPOSELX_13,
|
|
14 => CAPTIOPOSELXR::CAPTIOPOSELX_14,
|
|
15 => CAPTIOPOSELXR::CAPTIOPOSELX_15,
|
|
_ => unreachable!(),
|
|
}
|
|
}
|
|
#[doc = "Checks if the value of the field is `CAPTIOPOSELX_0`"]
|
|
#[inline]
|
|
pub fn is_captioposelx_0(&self) -> bool {
|
|
*self == CAPTIOPOSELXR::CAPTIOPOSELX_0
|
|
}
|
|
#[doc = "Checks if the value of the field is `CAPTIOPOSELX_1`"]
|
|
#[inline]
|
|
pub fn is_captioposelx_1(&self) -> bool {
|
|
*self == CAPTIOPOSELXR::CAPTIOPOSELX_1
|
|
}
|
|
#[doc = "Checks if the value of the field is `CAPTIOPOSELX_2`"]
|
|
#[inline]
|
|
pub fn is_captioposelx_2(&self) -> bool {
|
|
*self == CAPTIOPOSELXR::CAPTIOPOSELX_2
|
|
}
|
|
#[doc = "Checks if the value of the field is `CAPTIOPOSELX_3`"]
|
|
#[inline]
|
|
pub fn is_captioposelx_3(&self) -> bool {
|
|
*self == CAPTIOPOSELXR::CAPTIOPOSELX_3
|
|
}
|
|
#[doc = "Checks if the value of the field is `CAPTIOPOSELX_4`"]
|
|
#[inline]
|
|
pub fn is_captioposelx_4(&self) -> bool {
|
|
*self == CAPTIOPOSELXR::CAPTIOPOSELX_4
|
|
}
|
|
#[doc = "Checks if the value of the field is `CAPTIOPOSELX_5`"]
|
|
#[inline]
|
|
pub fn is_captioposelx_5(&self) -> bool {
|
|
*self == CAPTIOPOSELXR::CAPTIOPOSELX_5
|
|
}
|
|
#[doc = "Checks if the value of the field is `CAPTIOPOSELX_6`"]
|
|
#[inline]
|
|
pub fn is_captioposelx_6(&self) -> bool {
|
|
*self == CAPTIOPOSELXR::CAPTIOPOSELX_6
|
|
}
|
|
#[doc = "Checks if the value of the field is `CAPTIOPOSELX_7`"]
|
|
#[inline]
|
|
pub fn is_captioposelx_7(&self) -> bool {
|
|
*self == CAPTIOPOSELXR::CAPTIOPOSELX_7
|
|
}
|
|
#[doc = "Checks if the value of the field is `CAPTIOPOSELX_8`"]
|
|
#[inline]
|
|
pub fn is_captioposelx_8(&self) -> bool {
|
|
*self == CAPTIOPOSELXR::CAPTIOPOSELX_8
|
|
}
|
|
#[doc = "Checks if the value of the field is `CAPTIOPOSELX_9`"]
|
|
#[inline]
|
|
pub fn is_captioposelx_9(&self) -> bool {
|
|
*self == CAPTIOPOSELXR::CAPTIOPOSELX_9
|
|
}
|
|
#[doc = "Checks if the value of the field is `CAPTIOPOSELX_10`"]
|
|
#[inline]
|
|
pub fn is_captioposelx_10(&self) -> bool {
|
|
*self == CAPTIOPOSELXR::CAPTIOPOSELX_10
|
|
}
|
|
#[doc = "Checks if the value of the field is `CAPTIOPOSELX_11`"]
|
|
#[inline]
|
|
pub fn is_captioposelx_11(&self) -> bool {
|
|
*self == CAPTIOPOSELXR::CAPTIOPOSELX_11
|
|
}
|
|
#[doc = "Checks if the value of the field is `CAPTIOPOSELX_12`"]
|
|
#[inline]
|
|
pub fn is_captioposelx_12(&self) -> bool {
|
|
*self == CAPTIOPOSELXR::CAPTIOPOSELX_12
|
|
}
|
|
#[doc = "Checks if the value of the field is `CAPTIOPOSELX_13`"]
|
|
#[inline]
|
|
pub fn is_captioposelx_13(&self) -> bool {
|
|
*self == CAPTIOPOSELXR::CAPTIOPOSELX_13
|
|
}
|
|
#[doc = "Checks if the value of the field is `CAPTIOPOSELX_14`"]
|
|
#[inline]
|
|
pub fn is_captioposelx_14(&self) -> bool {
|
|
*self == CAPTIOPOSELXR::CAPTIOPOSELX_14
|
|
}
|
|
#[doc = "Checks if the value of the field is `CAPTIOPOSELX_15`"]
|
|
#[inline]
|
|
pub fn is_captioposelx_15(&self) -> bool {
|
|
*self == CAPTIOPOSELXR::CAPTIOPOSELX_15
|
|
}
|
|
}
|
|
#[doc = "Possible values of the field `CAPTIOEN`"]
|
|
#[derive(Clone, Copy, Debug, PartialEq)]
|
|
pub enum CAPTIOENR {
|
|
#[doc = "All Capacitive Touch IOs are disabled. Signal towards timers is 0."]
|
|
CAPTIOEN_0,
|
|
#[doc = "Selected Capacitive Touch IO is enabled"]
|
|
CAPTIOEN_1,
|
|
}
|
|
impl CAPTIOENR {
|
|
#[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 {
|
|
CAPTIOENR::CAPTIOEN_0 => false,
|
|
CAPTIOENR::CAPTIOEN_1 => true,
|
|
}
|
|
}
|
|
#[allow(missing_docs)]
|
|
#[doc(hidden)]
|
|
#[inline]
|
|
pub fn _from(value: bool) -> CAPTIOENR {
|
|
match value {
|
|
false => CAPTIOENR::CAPTIOEN_0,
|
|
true => CAPTIOENR::CAPTIOEN_1,
|
|
}
|
|
}
|
|
#[doc = "Checks if the value of the field is `CAPTIOEN_0`"]
|
|
#[inline]
|
|
pub fn is_captioen_0(&self) -> bool {
|
|
*self == CAPTIOENR::CAPTIOEN_0
|
|
}
|
|
#[doc = "Checks if the value of the field is `CAPTIOEN_1`"]
|
|
#[inline]
|
|
pub fn is_captioen_1(&self) -> bool {
|
|
*self == CAPTIOENR::CAPTIOEN_1
|
|
}
|
|
}
|
|
#[doc = "Possible values of the field `CAPTIOSTATE`"]
|
|
#[derive(Clone, Copy, Debug, PartialEq)]
|
|
pub enum CAPTIOSTATER {
|
|
#[doc = "Curent state 0 or Capacitive Touch IO is disabled"]
|
|
CAPTIOSTATE_0,
|
|
#[doc = "Current state 1"]
|
|
CAPTIOSTATE_1,
|
|
}
|
|
impl CAPTIOSTATER {
|
|
#[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 {
|
|
CAPTIOSTATER::CAPTIOSTATE_0 => false,
|
|
CAPTIOSTATER::CAPTIOSTATE_1 => true,
|
|
}
|
|
}
|
|
#[allow(missing_docs)]
|
|
#[doc(hidden)]
|
|
#[inline]
|
|
pub fn _from(value: bool) -> CAPTIOSTATER {
|
|
match value {
|
|
false => CAPTIOSTATER::CAPTIOSTATE_0,
|
|
true => CAPTIOSTATER::CAPTIOSTATE_1,
|
|
}
|
|
}
|
|
#[doc = "Checks if the value of the field is `CAPTIOSTATE_0`"]
|
|
#[inline]
|
|
pub fn is_captiostate_0(&self) -> bool {
|
|
*self == CAPTIOSTATER::CAPTIOSTATE_0
|
|
}
|
|
#[doc = "Checks if the value of the field is `CAPTIOSTATE_1`"]
|
|
#[inline]
|
|
pub fn is_captiostate_1(&self) -> bool {
|
|
*self == CAPTIOSTATER::CAPTIOSTATE_1
|
|
}
|
|
}
|
|
#[doc = "Values that can be written to the field `CAPTIOPISELx`"]
|
|
pub enum CAPTIOPISELXW {
|
|
#[doc = "Px.0"]
|
|
CAPTIOPISELX_0,
|
|
#[doc = "Px.1"]
|
|
CAPTIOPISELX_1,
|
|
#[doc = "Px.2"]
|
|
CAPTIOPISELX_2,
|
|
#[doc = "Px.3"]
|
|
CAPTIOPISELX_3,
|
|
#[doc = "Px.4"]
|
|
CAPTIOPISELX_4,
|
|
#[doc = "Px.5"]
|
|
CAPTIOPISELX_5,
|
|
#[doc = "Px.6"]
|
|
CAPTIOPISELX_6,
|
|
#[doc = "Px.7"]
|
|
CAPTIOPISELX_7,
|
|
}
|
|
impl CAPTIOPISELXW {
|
|
#[allow(missing_docs)]
|
|
#[doc(hidden)]
|
|
#[inline]
|
|
pub fn _bits(&self) -> u8 {
|
|
match *self {
|
|
CAPTIOPISELXW::CAPTIOPISELX_0 => 0,
|
|
CAPTIOPISELXW::CAPTIOPISELX_1 => 1,
|
|
CAPTIOPISELXW::CAPTIOPISELX_2 => 2,
|
|
CAPTIOPISELXW::CAPTIOPISELX_3 => 3,
|
|
CAPTIOPISELXW::CAPTIOPISELX_4 => 4,
|
|
CAPTIOPISELXW::CAPTIOPISELX_5 => 5,
|
|
CAPTIOPISELXW::CAPTIOPISELX_6 => 6,
|
|
CAPTIOPISELXW::CAPTIOPISELX_7 => 7,
|
|
}
|
|
}
|
|
}
|
|
#[doc = r" Proxy"]
|
|
pub struct _CAPTIOPISELXW<'a> {
|
|
w: &'a mut W,
|
|
}
|
|
impl<'a> _CAPTIOPISELXW<'a> {
|
|
#[doc = r" Writes `variant` to the field"]
|
|
#[inline]
|
|
pub fn variant(self, variant: CAPTIOPISELXW) -> &'a mut W {
|
|
{
|
|
self.bits(variant._bits())
|
|
}
|
|
}
|
|
#[doc = "Px.0"]
|
|
#[inline]
|
|
pub fn captiopiselx_0(self) -> &'a mut W {
|
|
self.variant(CAPTIOPISELXW::CAPTIOPISELX_0)
|
|
}
|
|
#[doc = "Px.1"]
|
|
#[inline]
|
|
pub fn captiopiselx_1(self) -> &'a mut W {
|
|
self.variant(CAPTIOPISELXW::CAPTIOPISELX_1)
|
|
}
|
|
#[doc = "Px.2"]
|
|
#[inline]
|
|
pub fn captiopiselx_2(self) -> &'a mut W {
|
|
self.variant(CAPTIOPISELXW::CAPTIOPISELX_2)
|
|
}
|
|
#[doc = "Px.3"]
|
|
#[inline]
|
|
pub fn captiopiselx_3(self) -> &'a mut W {
|
|
self.variant(CAPTIOPISELXW::CAPTIOPISELX_3)
|
|
}
|
|
#[doc = "Px.4"]
|
|
#[inline]
|
|
pub fn captiopiselx_4(self) -> &'a mut W {
|
|
self.variant(CAPTIOPISELXW::CAPTIOPISELX_4)
|
|
}
|
|
#[doc = "Px.5"]
|
|
#[inline]
|
|
pub fn captiopiselx_5(self) -> &'a mut W {
|
|
self.variant(CAPTIOPISELXW::CAPTIOPISELX_5)
|
|
}
|
|
#[doc = "Px.6"]
|
|
#[inline]
|
|
pub fn captiopiselx_6(self) -> &'a mut W {
|
|
self.variant(CAPTIOPISELXW::CAPTIOPISELX_6)
|
|
}
|
|
#[doc = "Px.7"]
|
|
#[inline]
|
|
pub fn captiopiselx_7(self) -> &'a mut W {
|
|
self.variant(CAPTIOPISELXW::CAPTIOPISELX_7)
|
|
}
|
|
#[doc = r" Writes raw bits to the field"]
|
|
#[inline]
|
|
pub fn bits(self, value: u8) -> &'a mut W {
|
|
const MASK: u8 = 7;
|
|
const OFFSET: u8 = 1;
|
|
self.w.bits &= !((MASK as u16) << OFFSET);
|
|
self.w.bits |= ((value & MASK) as u16) << OFFSET;
|
|
self.w
|
|
}
|
|
}
|
|
#[doc = "Values that can be written to the field `CAPTIOPOSELx`"]
|
|
pub enum CAPTIOPOSELXW {
|
|
#[doc = "Px = PJ"]
|
|
CAPTIOPOSELX_0,
|
|
#[doc = "Px = P1"]
|
|
CAPTIOPOSELX_1,
|
|
#[doc = "Px = P2"]
|
|
CAPTIOPOSELX_2,
|
|
#[doc = "Px = P3"]
|
|
CAPTIOPOSELX_3,
|
|
#[doc = "Px = P4"]
|
|
CAPTIOPOSELX_4,
|
|
#[doc = "Px = P5"]
|
|
CAPTIOPOSELX_5,
|
|
#[doc = "Px = P6"]
|
|
CAPTIOPOSELX_6,
|
|
#[doc = "Px = P7"]
|
|
CAPTIOPOSELX_7,
|
|
#[doc = "Px = P8"]
|
|
CAPTIOPOSELX_8,
|
|
#[doc = "Px = P9"]
|
|
CAPTIOPOSELX_9,
|
|
#[doc = "Px = P10"]
|
|
CAPTIOPOSELX_10,
|
|
#[doc = "Px = P11"]
|
|
CAPTIOPOSELX_11,
|
|
#[doc = "Px = P12"]
|
|
CAPTIOPOSELX_12,
|
|
#[doc = "Px = P13"]
|
|
CAPTIOPOSELX_13,
|
|
#[doc = "Px = P14"]
|
|
CAPTIOPOSELX_14,
|
|
#[doc = "Px = P15"]
|
|
CAPTIOPOSELX_15,
|
|
}
|
|
impl CAPTIOPOSELXW {
|
|
#[allow(missing_docs)]
|
|
#[doc(hidden)]
|
|
#[inline]
|
|
pub fn _bits(&self) -> u8 {
|
|
match *self {
|
|
CAPTIOPOSELXW::CAPTIOPOSELX_0 => 0,
|
|
CAPTIOPOSELXW::CAPTIOPOSELX_1 => 1,
|
|
CAPTIOPOSELXW::CAPTIOPOSELX_2 => 2,
|
|
CAPTIOPOSELXW::CAPTIOPOSELX_3 => 3,
|
|
CAPTIOPOSELXW::CAPTIOPOSELX_4 => 4,
|
|
CAPTIOPOSELXW::CAPTIOPOSELX_5 => 5,
|
|
CAPTIOPOSELXW::CAPTIOPOSELX_6 => 6,
|
|
CAPTIOPOSELXW::CAPTIOPOSELX_7 => 7,
|
|
CAPTIOPOSELXW::CAPTIOPOSELX_8 => 8,
|
|
CAPTIOPOSELXW::CAPTIOPOSELX_9 => 9,
|
|
CAPTIOPOSELXW::CAPTIOPOSELX_10 => 10,
|
|
CAPTIOPOSELXW::CAPTIOPOSELX_11 => 11,
|
|
CAPTIOPOSELXW::CAPTIOPOSELX_12 => 12,
|
|
CAPTIOPOSELXW::CAPTIOPOSELX_13 => 13,
|
|
CAPTIOPOSELXW::CAPTIOPOSELX_14 => 14,
|
|
CAPTIOPOSELXW::CAPTIOPOSELX_15 => 15,
|
|
}
|
|
}
|
|
}
|
|
#[doc = r" Proxy"]
|
|
pub struct _CAPTIOPOSELXW<'a> {
|
|
w: &'a mut W,
|
|
}
|
|
impl<'a> _CAPTIOPOSELXW<'a> {
|
|
#[doc = r" Writes `variant` to the field"]
|
|
#[inline]
|
|
pub fn variant(self, variant: CAPTIOPOSELXW) -> &'a mut W {
|
|
{
|
|
self.bits(variant._bits())
|
|
}
|
|
}
|
|
#[doc = "Px = PJ"]
|
|
#[inline]
|
|
pub fn captioposelx_0(self) -> &'a mut W {
|
|
self.variant(CAPTIOPOSELXW::CAPTIOPOSELX_0)
|
|
}
|
|
#[doc = "Px = P1"]
|
|
#[inline]
|
|
pub fn captioposelx_1(self) -> &'a mut W {
|
|
self.variant(CAPTIOPOSELXW::CAPTIOPOSELX_1)
|
|
}
|
|
#[doc = "Px = P2"]
|
|
#[inline]
|
|
pub fn captioposelx_2(self) -> &'a mut W {
|
|
self.variant(CAPTIOPOSELXW::CAPTIOPOSELX_2)
|
|
}
|
|
#[doc = "Px = P3"]
|
|
#[inline]
|
|
pub fn captioposelx_3(self) -> &'a mut W {
|
|
self.variant(CAPTIOPOSELXW::CAPTIOPOSELX_3)
|
|
}
|
|
#[doc = "Px = P4"]
|
|
#[inline]
|
|
pub fn captioposelx_4(self) -> &'a mut W {
|
|
self.variant(CAPTIOPOSELXW::CAPTIOPOSELX_4)
|
|
}
|
|
#[doc = "Px = P5"]
|
|
#[inline]
|
|
pub fn captioposelx_5(self) -> &'a mut W {
|
|
self.variant(CAPTIOPOSELXW::CAPTIOPOSELX_5)
|
|
}
|
|
#[doc = "Px = P6"]
|
|
#[inline]
|
|
pub fn captioposelx_6(self) -> &'a mut W {
|
|
self.variant(CAPTIOPOSELXW::CAPTIOPOSELX_6)
|
|
}
|
|
#[doc = "Px = P7"]
|
|
#[inline]
|
|
pub fn captioposelx_7(self) -> &'a mut W {
|
|
self.variant(CAPTIOPOSELXW::CAPTIOPOSELX_7)
|
|
}
|
|
#[doc = "Px = P8"]
|
|
#[inline]
|
|
pub fn captioposelx_8(self) -> &'a mut W {
|
|
self.variant(CAPTIOPOSELXW::CAPTIOPOSELX_8)
|
|
}
|
|
#[doc = "Px = P9"]
|
|
#[inline]
|
|
pub fn captioposelx_9(self) -> &'a mut W {
|
|
self.variant(CAPTIOPOSELXW::CAPTIOPOSELX_9)
|
|
}
|
|
#[doc = "Px = P10"]
|
|
#[inline]
|
|
pub fn captioposelx_10(self) -> &'a mut W {
|
|
self.variant(CAPTIOPOSELXW::CAPTIOPOSELX_10)
|
|
}
|
|
#[doc = "Px = P11"]
|
|
#[inline]
|
|
pub fn captioposelx_11(self) -> &'a mut W {
|
|
self.variant(CAPTIOPOSELXW::CAPTIOPOSELX_11)
|
|
}
|
|
#[doc = "Px = P12"]
|
|
#[inline]
|
|
pub fn captioposelx_12(self) -> &'a mut W {
|
|
self.variant(CAPTIOPOSELXW::CAPTIOPOSELX_12)
|
|
}
|
|
#[doc = "Px = P13"]
|
|
#[inline]
|
|
pub fn captioposelx_13(self) -> &'a mut W {
|
|
self.variant(CAPTIOPOSELXW::CAPTIOPOSELX_13)
|
|
}
|
|
#[doc = "Px = P14"]
|
|
#[inline]
|
|
pub fn captioposelx_14(self) -> &'a mut W {
|
|
self.variant(CAPTIOPOSELXW::CAPTIOPOSELX_14)
|
|
}
|
|
#[doc = "Px = P15"]
|
|
#[inline]
|
|
pub fn captioposelx_15(self) -> &'a mut W {
|
|
self.variant(CAPTIOPOSELXW::CAPTIOPOSELX_15)
|
|
}
|
|
#[doc = r" Writes raw bits to the field"]
|
|
#[inline]
|
|
pub fn bits(self, value: u8) -> &'a mut W {
|
|
const MASK: u8 = 15;
|
|
const OFFSET: u8 = 4;
|
|
self.w.bits &= !((MASK as u16) << OFFSET);
|
|
self.w.bits |= ((value & MASK) as u16) << OFFSET;
|
|
self.w
|
|
}
|
|
}
|
|
#[doc = "Values that can be written to the field `CAPTIOEN`"]
|
|
pub enum CAPTIOENW {
|
|
#[doc = "All Capacitive Touch IOs are disabled. Signal towards timers is 0."]
|
|
CAPTIOEN_0,
|
|
#[doc = "Selected Capacitive Touch IO is enabled"]
|
|
CAPTIOEN_1,
|
|
}
|
|
impl CAPTIOENW {
|
|
#[allow(missing_docs)]
|
|
#[doc(hidden)]
|
|
#[inline]
|
|
pub fn _bits(&self) -> bool {
|
|
match *self {
|
|
CAPTIOENW::CAPTIOEN_0 => false,
|
|
CAPTIOENW::CAPTIOEN_1 => true,
|
|
}
|
|
}
|
|
}
|
|
#[doc = r" Proxy"]
|
|
pub struct _CAPTIOENW<'a> {
|
|
w: &'a mut W,
|
|
}
|
|
impl<'a> _CAPTIOENW<'a> {
|
|
#[doc = r" Writes `variant` to the field"]
|
|
#[inline]
|
|
pub fn variant(self, variant: CAPTIOENW) -> &'a mut W {
|
|
{
|
|
self.bit(variant._bits())
|
|
}
|
|
}
|
|
#[doc = "All Capacitive Touch IOs are disabled. Signal towards timers is 0."]
|
|
#[inline]
|
|
pub fn captioen_0(self) -> &'a mut W {
|
|
self.variant(CAPTIOENW::CAPTIOEN_0)
|
|
}
|
|
#[doc = "Selected Capacitive Touch IO is enabled"]
|
|
#[inline]
|
|
pub fn captioen_1(self) -> &'a mut W {
|
|
self.variant(CAPTIOENW::CAPTIOEN_1)
|
|
}
|
|
#[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 = 8;
|
|
self.w.bits &= !((MASK as u16) << OFFSET);
|
|
self.w.bits |= ((value & MASK) as u16) << OFFSET;
|
|
self.w
|
|
}
|
|
}
|
|
impl R {
|
|
#[doc = r" Value of the register as raw bits"]
|
|
#[inline]
|
|
pub fn bits(&self) -> u16 {
|
|
self.bits
|
|
}
|
|
#[doc = "Bits 1:3 - Capacitive Touch IO pin select"]
|
|
#[inline]
|
|
pub fn captiopiselx(&self) -> CAPTIOPISELXR {
|
|
CAPTIOPISELXR::_from({
|
|
const MASK: u8 = 7;
|
|
const OFFSET: u8 = 1;
|
|
((self.bits >> OFFSET) & MASK as u16) as u8
|
|
})
|
|
}
|
|
#[doc = "Bits 4:7 - Capacitive Touch IO port select"]
|
|
#[inline]
|
|
pub fn captioposelx(&self) -> CAPTIOPOSELXR {
|
|
CAPTIOPOSELXR::_from({
|
|
const MASK: u8 = 15;
|
|
const OFFSET: u8 = 4;
|
|
((self.bits >> OFFSET) & MASK as u16) as u8
|
|
})
|
|
}
|
|
#[doc = "Bit 8 - Capacitive Touch IO enable"]
|
|
#[inline]
|
|
pub fn captioen(&self) -> CAPTIOENR {
|
|
CAPTIOENR::_from({
|
|
const MASK: bool = true;
|
|
const OFFSET: u8 = 8;
|
|
((self.bits >> OFFSET) & MASK as u16) != 0
|
|
})
|
|
}
|
|
#[doc = "Bit 9 - Capacitive Touch IO state"]
|
|
#[inline]
|
|
pub fn captiostate(&self) -> CAPTIOSTATER {
|
|
CAPTIOSTATER::_from({
|
|
const MASK: bool = true;
|
|
const OFFSET: u8 = 9;
|
|
((self.bits >> OFFSET) & MASK as u16) != 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: u16) -> &mut Self {
|
|
self.bits = bits;
|
|
self
|
|
}
|
|
#[doc = "Bits 1:3 - Capacitive Touch IO pin select"]
|
|
#[inline]
|
|
pub fn captiopiselx(&mut self) -> _CAPTIOPISELXW {
|
|
_CAPTIOPISELXW { w: self }
|
|
}
|
|
#[doc = "Bits 4:7 - Capacitive Touch IO port select"]
|
|
#[inline]
|
|
pub fn captioposelx(&mut self) -> _CAPTIOPOSELXW {
|
|
_CAPTIOPOSELXW { w: self }
|
|
}
|
|
#[doc = "Bit 8 - Capacitive Touch IO enable"]
|
|
#[inline]
|
|
pub fn captioen(&mut self) -> _CAPTIOENW {
|
|
_CAPTIOENW { w: self }
|
|
}
|
|
}
|