#[doc = r" Value read from the register"]
pub struct R {
bits: u8,
}
#[doc = r" Value to write to the register"]
pub struct W {
bits: u8,
}
impl super::C3 {
#[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 `PEIE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum PEIER {
#[doc = "PF interrupt requests are disabled."]
_0,
#[doc = "PF interrupt requests are enabled."]
_1,
}
impl PEIER {
#[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 {
PEIER::_0 => false,
PEIER::_1 => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _from(value: bool) -> PEIER {
match value {
false => PEIER::_0,
true => PEIER::_1,
}
}
#[doc = "Checks if the value of the field is `_0`"]
#[inline]
pub fn is_0(&self) -> bool {
*self == PEIER::_0
}
#[doc = "Checks if the value of the field is `_1`"]
#[inline]
pub fn is_1(&self) -> bool {
*self == PEIER::_1
}
}
#[doc = "Possible values of the field `FEIE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum FEIER {
#[doc = "FE interrupt requests are disabled."]
_0,
#[doc = "FE interrupt requests are enabled."]
_1,
}
impl FEIER {
#[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 {
FEIER::_0 => false,
FEIER::_1 => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _from(value: bool) -> FEIER {
match value {
false => FEIER::_0,
true => FEIER::_1,
}
}
#[doc = "Checks if the value of the field is `_0`"]
#[inline]
pub fn is_0(&self) -> bool {
*self == FEIER::_0
}
#[doc = "Checks if the value of the field is `_1`"]
#[inline]
pub fn is_1(&self) -> bool {
*self == FEIER::_1
}
}
#[doc = "Possible values of the field `NEIE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum NEIER {
#[doc = "NF interrupt requests are disabled."]
_0,
#[doc = "NF interrupt requests are enabled."]
_1,
}
impl NEIER {
#[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 {
NEIER::_0 => false,
NEIER::_1 => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _from(value: bool) -> NEIER {
match value {
false => NEIER::_0,
true => NEIER::_1,
}
}
#[doc = "Checks if the value of the field is `_0`"]
#[inline]
pub fn is_0(&self) -> bool {
*self == NEIER::_0
}
#[doc = "Checks if the value of the field is `_1`"]
#[inline]
pub fn is_1(&self) -> bool {
*self == NEIER::_1
}
}
#[doc = "Possible values of the field `ORIE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ORIER {
#[doc = "OR interrupts are disabled."]
_0,
#[doc = "OR interrupt requests are enabled."]
_1,
}
impl ORIER {
#[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 {
ORIER::_0 => false,
ORIER::_1 => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _from(value: bool) -> ORIER {
match value {
false => ORIER::_0,
true => ORIER::_1,
}
}
#[doc = "Checks if the value of the field is `_0`"]
#[inline]
pub fn is_0(&self) -> bool {
*self == ORIER::_0
}
#[doc = "Checks if the value of the field is `_1`"]
#[inline]
pub fn is_1(&self) -> bool {
*self == ORIER::_1
}
}
#[doc = "Possible values of the field `TXINV`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TXINVR {
#[doc = "Transmit data is not inverted."]
_0,
#[doc = "Transmit data is inverted."]
_1,
}
impl TXINVR {
#[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 {
TXINVR::_0 => false,
TXINVR::_1 => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _from(value: bool) -> TXINVR {
match value {
false => TXINVR::_0,
true => TXINVR::_1,
}
}
#[doc = "Checks if the value of the field is `_0`"]
#[inline]
pub fn is_0(&self) -> bool {
*self == TXINVR::_0
}
#[doc = "Checks if the value of the field is `_1`"]
#[inline]
pub fn is_1(&self) -> bool {
*self == TXINVR::_1
}
}
#[doc = "Possible values of the field `TXDIR`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TXDIRR {
#[doc = "TXD pin is an input in single wire mode."]
_0,
#[doc = "TXD pin is an output in single wire mode."]
_1,
}
impl TXDIRR {
#[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 {
TXDIRR::_0 => false,
TXDIRR::_1 => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _from(value: bool) -> TXDIRR {
match value {
false => TXDIRR::_0,
true => TXDIRR::_1,
}
}
#[doc = "Checks if the value of the field is `_0`"]
#[inline]
pub fn is_0(&self) -> bool {
*self == TXDIRR::_0
}
#[doc = "Checks if the value of the field is `_1`"]
#[inline]
pub fn is_1(&self) -> bool {
*self == TXDIRR::_1
}
}
#[doc = r" Value of the field"]
pub struct T8R {
bits: bool,
}
impl T8R {
#[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 R8R {
bits: bool,
}
impl R8R {
#[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 = "Values that can be written to the field `PEIE`"]
pub enum PEIEW {
#[doc = "PF interrupt requests are disabled."]
_0,
#[doc = "PF interrupt requests are enabled."]
_1,
}
impl PEIEW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _bits(&self) -> bool {
match *self {
PEIEW::_0 => false,
PEIEW::_1 => true,
}
}
}
#[doc = r" Proxy"]
pub struct _PEIEW<'a> {
w: &'a mut W,
}
impl<'a> _PEIEW<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: PEIEW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "PF interrupt requests are disabled."]
#[inline]
pub fn _0(self) -> &'a mut W {
self.variant(PEIEW::_0)
}
#[doc = "PF interrupt requests are enabled."]
#[inline]
pub fn _1(self) -> &'a mut W {
self.variant(PEIEW::_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 = 0;
self.w.bits &= !((MASK as u8) << OFFSET);
self.w.bits |= ((value & MASK) as u8) << OFFSET;
self.w
}
}
#[doc = "Values that can be written to the field `FEIE`"]
pub enum FEIEW {
#[doc = "FE interrupt requests are disabled."]
_0,
#[doc = "FE interrupt requests are enabled."]
_1,
}
impl FEIEW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _bits(&self) -> bool {
match *self {
FEIEW::_0 => false,
FEIEW::_1 => true,
}
}
}
#[doc = r" Proxy"]
pub struct _FEIEW<'a> {
w: &'a mut W,
}
impl<'a> _FEIEW<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: FEIEW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "FE interrupt requests are disabled."]
#[inline]
pub fn _0(self) -> &'a mut W {
self.variant(FEIEW::_0)
}
#[doc = "FE interrupt requests are enabled."]
#[inline]
pub fn _1(self) -> &'a mut W {
self.variant(FEIEW::_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 = 1;
self.w.bits &= !((MASK as u8) << OFFSET);
self.w.bits |= ((value & MASK) as u8) << OFFSET;
self.w
}
}
#[doc = "Values that can be written to the field `NEIE`"]
pub enum NEIEW {
#[doc = "NF interrupt requests are disabled."]
_0,
#[doc = "NF interrupt requests are enabled."]
_1,
}
impl NEIEW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _bits(&self) -> bool {
match *self {
NEIEW::_0 => false,
NEIEW::_1 => true,
}
}
}
#[doc = r" Proxy"]
pub struct _NEIEW<'a> {
w: &'a mut W,
}
impl<'a> _NEIEW<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: NEIEW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "NF interrupt requests are disabled."]
#[inline]
pub fn _0(self) -> &'a mut W {
self.variant(NEIEW::_0)
}
#[doc = "NF interrupt requests are enabled."]
#[inline]
pub fn _1(self) -> &'a mut W {
self.variant(NEIEW::_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 = 2;
self.w.bits &= !((MASK as u8) << OFFSET);
self.w.bits |= ((value & MASK) as u8) << OFFSET;
self.w
}
}
#[doc = "Values that can be written to the field `ORIE`"]
pub enum ORIEW {
#[doc = "OR interrupts are disabled."]
_0,
#[doc = "OR interrupt requests are enabled."]
_1,
}
impl ORIEW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _bits(&self) -> bool {
match *self {
ORIEW::_0 => false,
ORIEW::_1 => true,
}
}
}
#[doc = r" Proxy"]
pub struct _ORIEW<'a> {
w: &'a mut W,
}
impl<'a> _ORIEW<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: ORIEW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "OR interrupts are disabled."]
#[inline]
pub fn _0(self) -> &'a mut W {
self.variant(ORIEW::_0)
}
#[doc = "OR interrupt requests are enabled."]
#[inline]
pub fn _1(self) -> &'a mut W {
self.variant(ORIEW::_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 = 3;
self.w.bits &= !((MASK as u8) << OFFSET);
self.w.bits |= ((value & MASK) as u8) << OFFSET;
self.w
}
}
#[doc = "Values that can be written to the field `TXINV`"]
pub enum TXINVW {
#[doc = "Transmit data is not inverted."]
_0,
#[doc = "Transmit data is inverted."]
_1,
}
impl TXINVW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _bits(&self) -> bool {
match *self {
TXINVW::_0 => false,
TXINVW::_1 => true,
}
}
}
#[doc = r" Proxy"]
pub struct _TXINVW<'a> {
w: &'a mut W,
}
impl<'a> _TXINVW<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: TXINVW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Transmit data is not inverted."]
#[inline]
pub fn _0(self) -> &'a mut W {
self.variant(TXINVW::_0)
}
#[doc = "Transmit data is inverted."]
#[inline]
pub fn _1(self) -> &'a mut W {
self.variant(TXINVW::_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 = 4;
self.w.bits &= !((MASK as u8) << OFFSET);
self.w.bits |= ((value & MASK) as u8) << OFFSET;
self.w
}
}
#[doc = "Values that can be written to the field `TXDIR`"]
pub enum TXDIRW {
#[doc = "TXD pin is an input in single wire mode."]
_0,
#[doc = "TXD pin is an output in single wire mode."]
_1,
}
impl TXDIRW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _bits(&self) -> bool {
match *self {
TXDIRW::_0 => false,
TXDIRW::_1 => true,
}
}
}
#[doc = r" Proxy"]
pub struct _TXDIRW<'a> {
w: &'a mut W,
}
impl<'a> _TXDIRW<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: TXDIRW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "TXD pin is an input in single wire mode."]
#[inline]
pub fn _0(self) -> &'a mut W {
self.variant(TXDIRW::_0)
}
#[doc = "TXD pin is an output in single wire mode."]
#[inline]
pub fn _1(self) -> &'a mut W {
self.variant(TXDIRW::_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 = 5;
self.w.bits &= !((MASK as u8) << OFFSET);
self.w.bits |= ((value & MASK) as u8) << OFFSET;
self.w
}
}
#[doc = r" Proxy"]
pub struct _T8W<'a> {
w: &'a mut W,
}
impl<'a> _T8W<'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 u8) << OFFSET);
self.w.bits |= ((value & MASK) as u8) << OFFSET;
self.w
}
}
impl R {
#[doc = r" Value of the register as raw bits"]
#[inline]
pub fn bits(&self) -> u8 {
self.bits
}
#[doc = "Bit 0 - Parity Error Interrupt Enable"]
#[inline]
pub fn peie(&self) -> PEIER {
PEIER::_from({
const MASK: bool = true;
const OFFSET: u8 = 0;
((self.bits >> OFFSET) & MASK as u8) != 0
})
}
#[doc = "Bit 1 - Framing Error Interrupt Enable"]
#[inline]
pub fn feie(&self) -> FEIER {
FEIER::_from({
const MASK: bool = true;
const OFFSET: u8 = 1;
((self.bits >> OFFSET) & MASK as u8) != 0
})
}
#[doc = "Bit 2 - Noise Error Interrupt Enable"]
#[inline]
pub fn neie(&self) -> NEIER {
NEIER::_from({
const MASK: bool = true;
const OFFSET: u8 = 2;
((self.bits >> OFFSET) & MASK as u8) != 0
})
}
#[doc = "Bit 3 - Overrun Error Interrupt Enable"]
#[inline]
pub fn orie(&self) -> ORIER {
ORIER::_from({
const MASK: bool = true;
const OFFSET: u8 = 3;
((self.bits >> OFFSET) & MASK as u8) != 0
})
}
#[doc = "Bit 4 - Transmit Data Inversion."]
#[inline]
pub fn txinv(&self) -> TXINVR {
TXINVR::_from({
const MASK: bool = true;
const OFFSET: u8 = 4;
((self.bits >> OFFSET) & MASK as u8) != 0
})
}
#[doc = "Bit 5 - Transmitter Pin Data Direction in Single-Wire mode"]
#[inline]
pub fn txdir(&self) -> TXDIRR {
TXDIRR::_from({
const MASK: bool = true;
const OFFSET: u8 = 5;
((self.bits >> OFFSET) & MASK as u8) != 0
})
}
#[doc = "Bit 6 - Transmit Bit 8"]
#[inline]
pub fn t8(&self) -> T8R {
let bits = {
const MASK: bool = true;
const OFFSET: u8 = 6;
((self.bits >> OFFSET) & MASK as u8) != 0
};
T8R { bits }
}
#[doc = "Bit 7 - Received Bit 8"]
#[inline]
pub fn r8(&self) -> R8R {
let bits = {
const MASK: bool = true;
const OFFSET: u8 = 7;
((self.bits >> OFFSET) & MASK as u8) != 0
};
R8R { 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: u8) -> &mut Self {
self.bits = bits;
self
}
#[doc = "Bit 0 - Parity Error Interrupt Enable"]
#[inline]
pub fn peie(&mut self) -> _PEIEW {
_PEIEW { w: self }
}
#[doc = "Bit 1 - Framing Error Interrupt Enable"]
#[inline]
pub fn feie(&mut self) -> _FEIEW {
_FEIEW { w: self }
}
#[doc = "Bit 2 - Noise Error Interrupt Enable"]
#[inline]
pub fn neie(&mut self) -> _NEIEW {
_NEIEW { w: self }
}
#[doc = "Bit 3 - Overrun Error Interrupt Enable"]
#[inline]
pub fn orie(&mut self) -> _ORIEW {
_ORIEW { w: self }
}
#[doc = "Bit 4 - Transmit Data Inversion."]
#[inline]
pub fn txinv(&mut self) -> _TXINVW {
_TXINVW { w: self }
}
#[doc = "Bit 5 - Transmitter Pin Data Direction in Single-Wire mode"]
#[inline]
pub fn txdir(&mut self) -> _TXDIRW {
_TXDIRW { w: self }
}
#[doc = "Bit 6 - Transmit Bit 8"]
#[inline]
pub fn t8(&mut self) -> _T8W {
_T8W { w: self }
}
}