#[doc = "Reader of register CR1"]
pub type R = crate::R<u32, super::CR1>;
#[doc = "Writer for register CR1"]
pub type W = crate::W<u32, super::CR1>;
#[doc = "Register CR1 `reset()`'s with value 0"]
impl crate::ResetValue for super::CR1 {
type Type = u32;
#[inline(always)]
fn reset_value() -> Self::Type {
0
}
}
#[doc = "Word length\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum M1_A {
#[doc = "0: Use M0 to set the data bits"]
M0,
#[doc = "1: 1 start bit, 7 data bits, n stop bits"]
BIT7,
}
impl From<M1_A> for bool {
#[inline(always)]
fn from(variant: M1_A) -> Self {
match variant {
M1_A::M0 => false,
M1_A::BIT7 => true,
}
}
}
#[doc = "Reader of field `M1`"]
pub type M1_R = crate::R<bool, M1_A>;
impl M1_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> M1_A {
match self.bits {
false => M1_A::M0,
true => M1_A::BIT7,
}
}
#[doc = "Checks if the value of the field is `M0`"]
#[inline(always)]
pub fn is_m0(&self) -> bool {
*self == M1_A::M0
}
#[doc = "Checks if the value of the field is `BIT7`"]
#[inline(always)]
pub fn is_bit7(&self) -> bool {
*self == M1_A::BIT7
}
}
#[doc = "Write proxy for field `M1`"]
pub struct M1_W<'a> {
w: &'a mut W,
}
impl<'a> M1_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: M1_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "Use M0 to set the data bits"]
#[inline(always)]
pub fn m0(self) -> &'a mut W {
self.variant(M1_A::M0)
}
#[doc = "1 start bit, 7 data bits, n stop bits"]
#[inline(always)]
pub fn bit7(self) -> &'a mut W {
self.variant(M1_A::BIT7)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28);
self.w
}
}
#[doc = "End of Block interrupt enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum EOBIE_A {
#[doc = "0: Interrupt is inhibited"]
DISABLED,
#[doc = "1: A USART interrupt is generated when the EOBF flag is set in the ISR register"]
ENABLED,
}
impl From<EOBIE_A> for bool {
#[inline(always)]
fn from(variant: EOBIE_A) -> Self {
match variant {
EOBIE_A::DISABLED => false,
EOBIE_A::ENABLED => true,
}
}
}
#[doc = "Reader of field `EOBIE`"]
pub type EOBIE_R = crate::R<bool, EOBIE_A>;
impl EOBIE_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> EOBIE_A {
match self.bits {
false => EOBIE_A::DISABLED,
true => EOBIE_A::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == EOBIE_A::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == EOBIE_A::ENABLED
}
}
#[doc = "Write proxy for field `EOBIE`"]
pub struct EOBIE_W<'a> {
w: &'a mut W,
}
impl<'a> EOBIE_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: EOBIE_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "Interrupt is inhibited"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(EOBIE_A::DISABLED)
}
#[doc = "A USART interrupt is generated when the EOBF flag is set in the ISR register"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(EOBIE_A::ENABLED)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 27)) | (((value as u32) & 0x01) << 27);
self.w
}
}
#[doc = "Receiver timeout interrupt enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum RTOIE_A {
#[doc = "0: Interrupt is inhibited"]
DISABLED,
#[doc = "1: An USART interrupt is generated when the RTOF bit is set in the ISR register"]
ENABLED,
}
impl From<RTOIE_A> for bool {
#[inline(always)]
fn from(variant: RTOIE_A) -> Self {
match variant {
RTOIE_A::DISABLED => false,
RTOIE_A::ENABLED => true,
}
}
}
#[doc = "Reader of field `RTOIE`"]
pub type RTOIE_R = crate::R<bool, RTOIE_A>;
impl RTOIE_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> RTOIE_A {
match self.bits {
false => RTOIE_A::DISABLED,
true => RTOIE_A::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == RTOIE_A::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == RTOIE_A::ENABLED
}
}
#[doc = "Write proxy for field `RTOIE`"]
pub struct RTOIE_W<'a> {
w: &'a mut W,
}
impl<'a> RTOIE_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: RTOIE_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "Interrupt is inhibited"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(RTOIE_A::DISABLED)
}
#[doc = "An USART interrupt is generated when the RTOF bit is set in the ISR register"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(RTOIE_A::ENABLED)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 26)) | (((value as u32) & 0x01) << 26);
self.w
}
}
#[doc = "Oversampling mode\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum OVER8_A {
#[doc = "0: Oversampling by 16"]
OVERSAMPLING16,
#[doc = "1: Oversampling by 8"]
OVERSAMPLING8,
}
impl From<OVER8_A> for bool {
#[inline(always)]
fn from(variant: OVER8_A) -> Self {
match variant {
OVER8_A::OVERSAMPLING16 => false,
OVER8_A::OVERSAMPLING8 => true,
}
}
}
#[doc = "Reader of field `OVER8`"]
pub type OVER8_R = crate::R<bool, OVER8_A>;
impl OVER8_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> OVER8_A {
match self.bits {
false => OVER8_A::OVERSAMPLING16,
true => OVER8_A::OVERSAMPLING8,
}
}
#[doc = "Checks if the value of the field is `OVERSAMPLING16`"]
#[inline(always)]
pub fn is_oversampling16(&self) -> bool {
*self == OVER8_A::OVERSAMPLING16
}
#[doc = "Checks if the value of the field is `OVERSAMPLING8`"]
#[inline(always)]
pub fn is_oversampling8(&self) -> bool {
*self == OVER8_A::OVERSAMPLING8
}
}
#[doc = "Write proxy for field `OVER8`"]
pub struct OVER8_W<'a> {
w: &'a mut W,
}
impl<'a> OVER8_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: OVER8_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "Oversampling by 16"]
#[inline(always)]
pub fn oversampling16(self) -> &'a mut W {
self.variant(OVER8_A::OVERSAMPLING16)
}
#[doc = "Oversampling by 8"]
#[inline(always)]
pub fn oversampling8(self) -> &'a mut W {
self.variant(OVER8_A::OVERSAMPLING8)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15);
self.w
}
}
#[doc = "Character match interrupt enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CMIE_A {
#[doc = "0: Interrupt is disabled"]
DISABLED,
#[doc = "1: Interrupt is generated when the CMF bit is set in the ISR register"]
ENABLED,
}
impl From<CMIE_A> for bool {
#[inline(always)]
fn from(variant: CMIE_A) -> Self {
match variant {
CMIE_A::DISABLED => false,
CMIE_A::ENABLED => true,
}
}
}
#[doc = "Reader of field `CMIE`"]
pub type CMIE_R = crate::R<bool, CMIE_A>;
impl CMIE_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> CMIE_A {
match self.bits {
false => CMIE_A::DISABLED,
true => CMIE_A::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == CMIE_A::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == CMIE_A::ENABLED
}
}
#[doc = "Write proxy for field `CMIE`"]
pub struct CMIE_W<'a> {
w: &'a mut W,
}
impl<'a> CMIE_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: CMIE_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "Interrupt is disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(CMIE_A::DISABLED)
}
#[doc = "Interrupt is generated when the CMF bit is set in the ISR register"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(CMIE_A::ENABLED)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14);
self.w
}
}
#[doc = "Mute mode enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum MME_A {
#[doc = "0: Receiver in active mode permanently"]
DISABLED,
#[doc = "1: Receiver can switch between mute mode and active mode"]
ENABLED,
}
impl From<MME_A> for bool {
#[inline(always)]
fn from(variant: MME_A) -> Self {
match variant {
MME_A::DISABLED => false,
MME_A::ENABLED => true,
}
}
}
#[doc = "Reader of field `MME`"]
pub type MME_R = crate::R<bool, MME_A>;
impl MME_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> MME_A {
match self.bits {
false => MME_A::DISABLED,
true => MME_A::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == MME_A::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == MME_A::ENABLED
}
}
#[doc = "Write proxy for field `MME`"]
pub struct MME_W<'a> {
w: &'a mut W,
}
impl<'a> MME_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: MME_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "Receiver in active mode permanently"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(MME_A::DISABLED)
}
#[doc = "Receiver can switch between mute mode and active mode"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(MME_A::ENABLED)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13);
self.w
}
}
#[doc = "Word length\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum M0_A {
#[doc = "0: 1 start bit, 8 data bits, n stop bits"]
BIT8,
#[doc = "1: 1 start bit, 9 data bits, n stop bits"]
BIT9,
}
impl From<M0_A> for bool {
#[inline(always)]
fn from(variant: M0_A) -> Self {
match variant {
M0_A::BIT8 => false,
M0_A::BIT9 => true,
}
}
}
#[doc = "Reader of field `M0`"]
pub type M0_R = crate::R<bool, M0_A>;
impl M0_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> M0_A {
match self.bits {
false => M0_A::BIT8,
true => M0_A::BIT9,
}
}
#[doc = "Checks if the value of the field is `BIT8`"]
#[inline(always)]
pub fn is_bit8(&self) -> bool {
*self == M0_A::BIT8
}
#[doc = "Checks if the value of the field is `BIT9`"]
#[inline(always)]
pub fn is_bit9(&self) -> bool {
*self == M0_A::BIT9
}
}
#[doc = "Write proxy for field `M0`"]
pub struct M0_W<'a> {
w: &'a mut W,
}
impl<'a> M0_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: M0_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "1 start bit, 8 data bits, n stop bits"]
#[inline(always)]
pub fn bit8(self) -> &'a mut W {
self.variant(M0_A::BIT8)
}
#[doc = "1 start bit, 9 data bits, n stop bits"]
#[inline(always)]
pub fn bit9(self) -> &'a mut W {
self.variant(M0_A::BIT9)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12);
self.w
}
}
#[doc = "Receiver wakeup method\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum WAKE_A {
#[doc = "0: Idle line"]
IDLE,
#[doc = "1: Address mask"]
ADDRESS,
}
impl From<WAKE_A> for bool {
#[inline(always)]
fn from(variant: WAKE_A) -> Self {
match variant {
WAKE_A::IDLE => false,
WAKE_A::ADDRESS => true,
}
}
}
#[doc = "Reader of field `WAKE`"]
pub type WAKE_R = crate::R<bool, WAKE_A>;
impl WAKE_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> WAKE_A {
match self.bits {
false => WAKE_A::IDLE,
true => WAKE_A::ADDRESS,
}
}
#[doc = "Checks if the value of the field is `IDLE`"]
#[inline(always)]
pub fn is_idle(&self) -> bool {
*self == WAKE_A::IDLE
}
#[doc = "Checks if the value of the field is `ADDRESS`"]
#[inline(always)]
pub fn is_address(&self) -> bool {
*self == WAKE_A::ADDRESS
}
}
#[doc = "Write proxy for field `WAKE`"]
pub struct WAKE_W<'a> {
w: &'a mut W,
}
impl<'a> WAKE_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: WAKE_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "Idle line"]
#[inline(always)]
pub fn idle(self) -> &'a mut W {
self.variant(WAKE_A::IDLE)
}
#[doc = "Address mask"]
#[inline(always)]
pub fn address(self) -> &'a mut W {
self.variant(WAKE_A::ADDRESS)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11);
self.w
}
}
#[doc = "Parity control enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum PCE_A {
#[doc = "0: Parity control disabled"]
DISABLED,
#[doc = "1: Parity control enabled"]
ENABLED,
}
impl From<PCE_A> for bool {
#[inline(always)]
fn from(variant: PCE_A) -> Self {
match variant {
PCE_A::DISABLED => false,
PCE_A::ENABLED => true,
}
}
}
#[doc = "Reader of field `PCE`"]
pub type PCE_R = crate::R<bool, PCE_A>;
impl PCE_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> PCE_A {
match self.bits {
false => PCE_A::DISABLED,
true => PCE_A::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == PCE_A::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == PCE_A::ENABLED
}
}
#[doc = "Write proxy for field `PCE`"]
pub struct PCE_W<'a> {
w: &'a mut W,
}
impl<'a> PCE_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: PCE_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "Parity control disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(PCE_A::DISABLED)
}
#[doc = "Parity control enabled"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(PCE_A::ENABLED)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10);
self.w
}
}
#[doc = "Parity selection\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum PS_A {
#[doc = "0: Even parity"]
EVEN,
#[doc = "1: Odd parity"]
ODD,
}
impl From<PS_A> for bool {
#[inline(always)]
fn from(variant: PS_A) -> Self {
match variant {
PS_A::EVEN => false,
PS_A::ODD => true,
}
}
}
#[doc = "Reader of field `PS`"]
pub type PS_R = crate::R<bool, PS_A>;
impl PS_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> PS_A {
match self.bits {
false => PS_A::EVEN,
true => PS_A::ODD,
}
}
#[doc = "Checks if the value of the field is `EVEN`"]
#[inline(always)]
pub fn is_even(&self) -> bool {
*self == PS_A::EVEN
}
#[doc = "Checks if the value of the field is `ODD`"]
#[inline(always)]
pub fn is_odd(&self) -> bool {
*self == PS_A::ODD
}
}
#[doc = "Write proxy for field `PS`"]
pub struct PS_W<'a> {
w: &'a mut W,
}
impl<'a> PS_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: PS_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "Even parity"]
#[inline(always)]
pub fn even(self) -> &'a mut W {
self.variant(PS_A::EVEN)
}
#[doc = "Odd parity"]
#[inline(always)]
pub fn odd(self) -> &'a mut W {
self.variant(PS_A::ODD)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9);
self.w
}
}
#[doc = "PE interrupt enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum PEIE_A {
#[doc = "0: Interrupt is disabled"]
DISABLED,
#[doc = "1: Interrupt is generated whenever PE=1 in the ISR register"]
ENABLED,
}
impl From<PEIE_A> for bool {
#[inline(always)]
fn from(variant: PEIE_A) -> Self {
match variant {
PEIE_A::DISABLED => false,
PEIE_A::ENABLED => true,
}
}
}
#[doc = "Reader of field `PEIE`"]
pub type PEIE_R = crate::R<bool, PEIE_A>;
impl PEIE_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> PEIE_A {
match self.bits {
false => PEIE_A::DISABLED,
true => PEIE_A::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == PEIE_A::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == PEIE_A::ENABLED
}
}
#[doc = "Write proxy for field `PEIE`"]
pub struct PEIE_W<'a> {
w: &'a mut W,
}
impl<'a> PEIE_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: PEIE_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "Interrupt is disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(PEIE_A::DISABLED)
}
#[doc = "Interrupt is generated whenever PE=1 in the ISR register"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(PEIE_A::ENABLED)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8);
self.w
}
}
#[doc = "interrupt enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TXEIE_A {
#[doc = "0: Interrupt is disabled"]
DISABLED,
#[doc = "1: Interrupt is generated whenever TXE=1 in the ISR register"]
ENABLED,
}
impl From<TXEIE_A> for bool {
#[inline(always)]
fn from(variant: TXEIE_A) -> Self {
match variant {
TXEIE_A::DISABLED => false,
TXEIE_A::ENABLED => true,
}
}
}
#[doc = "Reader of field `TXEIE`"]
pub type TXEIE_R = crate::R<bool, TXEIE_A>;
impl TXEIE_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> TXEIE_A {
match self.bits {
false => TXEIE_A::DISABLED,
true => TXEIE_A::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == TXEIE_A::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == TXEIE_A::ENABLED
}
}
#[doc = "Write proxy for field `TXEIE`"]
pub struct TXEIE_W<'a> {
w: &'a mut W,
}
impl<'a> TXEIE_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: TXEIE_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "Interrupt is disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(TXEIE_A::DISABLED)
}
#[doc = "Interrupt is generated whenever TXE=1 in the ISR register"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(TXEIE_A::ENABLED)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7);
self.w
}
}
#[doc = "Transmission complete interrupt enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TCIE_A {
#[doc = "0: Interrupt is disabled"]
DISABLED,
#[doc = "1: Interrupt is generated whenever TC=1 in the ISR register"]
ENABLED,
}
impl From<TCIE_A> for bool {
#[inline(always)]
fn from(variant: TCIE_A) -> Self {
match variant {
TCIE_A::DISABLED => false,
TCIE_A::ENABLED => true,
}
}
}
#[doc = "Reader of field `TCIE`"]
pub type TCIE_R = crate::R<bool, TCIE_A>;
impl TCIE_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> TCIE_A {
match self.bits {
false => TCIE_A::DISABLED,
true => TCIE_A::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == TCIE_A::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == TCIE_A::ENABLED
}
}
#[doc = "Write proxy for field `TCIE`"]
pub struct TCIE_W<'a> {
w: &'a mut W,
}
impl<'a> TCIE_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: TCIE_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "Interrupt is disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(TCIE_A::DISABLED)
}
#[doc = "Interrupt is generated whenever TC=1 in the ISR register"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(TCIE_A::ENABLED)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6);
self.w
}
}
#[doc = "RXNE interrupt enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum RXNEIE_A {
#[doc = "0: Interrupt is disabled"]
DISABLED,
#[doc = "1: Interrupt is generated whenever ORE=1 or RXNE=1 in the ISR register"]
ENABLED,
}
impl From<RXNEIE_A> for bool {
#[inline(always)]
fn from(variant: RXNEIE_A) -> Self {
match variant {
RXNEIE_A::DISABLED => false,
RXNEIE_A::ENABLED => true,
}
}
}
#[doc = "Reader of field `RXNEIE`"]
pub type RXNEIE_R = crate::R<bool, RXNEIE_A>;
impl RXNEIE_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> RXNEIE_A {
match self.bits {
false => RXNEIE_A::DISABLED,
true => RXNEIE_A::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == RXNEIE_A::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == RXNEIE_A::ENABLED
}
}
#[doc = "Write proxy for field `RXNEIE`"]
pub struct RXNEIE_W<'a> {
w: &'a mut W,
}
impl<'a> RXNEIE_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: RXNEIE_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "Interrupt is disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(RXNEIE_A::DISABLED)
}
#[doc = "Interrupt is generated whenever ORE=1 or RXNE=1 in the ISR register"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(RXNEIE_A::ENABLED)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5);
self.w
}
}
#[doc = "IDLE interrupt enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum IDLEIE_A {
#[doc = "0: Interrupt is disabled"]
DISABLED,
#[doc = "1: Interrupt is generated whenever IDLE=1 in the ISR register"]
ENABLED,
}
impl From<IDLEIE_A> for bool {
#[inline(always)]
fn from(variant: IDLEIE_A) -> Self {
match variant {
IDLEIE_A::DISABLED => false,
IDLEIE_A::ENABLED => true,
}
}
}
#[doc = "Reader of field `IDLEIE`"]
pub type IDLEIE_R = crate::R<bool, IDLEIE_A>;
impl IDLEIE_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> IDLEIE_A {
match self.bits {
false => IDLEIE_A::DISABLED,
true => IDLEIE_A::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == IDLEIE_A::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == IDLEIE_A::ENABLED
}
}
#[doc = "Write proxy for field `IDLEIE`"]
pub struct IDLEIE_W<'a> {
w: &'a mut W,
}
impl<'a> IDLEIE_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: IDLEIE_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "Interrupt is disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(IDLEIE_A::DISABLED)
}
#[doc = "Interrupt is generated whenever IDLE=1 in the ISR register"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(IDLEIE_A::ENABLED)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4);
self.w
}
}
#[doc = "Transmitter enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TE_A {
#[doc = "0: Transmitter is disabled"]
DISABLED,
#[doc = "1: Transmitter is enabled"]
ENABLED,
}
impl From<TE_A> for bool {
#[inline(always)]
fn from(variant: TE_A) -> Self {
match variant {
TE_A::DISABLED => false,
TE_A::ENABLED => true,
}
}
}
#[doc = "Reader of field `TE`"]
pub type TE_R = crate::R<bool, TE_A>;
impl TE_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> TE_A {
match self.bits {
false => TE_A::DISABLED,
true => TE_A::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == TE_A::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == TE_A::ENABLED
}
}
#[doc = "Write proxy for field `TE`"]
pub struct TE_W<'a> {
w: &'a mut W,
}
impl<'a> TE_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: TE_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "Transmitter is disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(TE_A::DISABLED)
}
#[doc = "Transmitter is enabled"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(TE_A::ENABLED)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3);
self.w
}
}
#[doc = "Receiver enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum RE_A {
#[doc = "0: Receiver is disabled"]
DISABLED,
#[doc = "1: Receiver is enabled"]
ENABLED,
}
impl From<RE_A> for bool {
#[inline(always)]
fn from(variant: RE_A) -> Self {
match variant {
RE_A::DISABLED => false,
RE_A::ENABLED => true,
}
}
}
#[doc = "Reader of field `RE`"]
pub type RE_R = crate::R<bool, RE_A>;
impl RE_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> RE_A {
match self.bits {
false => RE_A::DISABLED,
true => RE_A::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == RE_A::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == RE_A::ENABLED
}
}
#[doc = "Write proxy for field `RE`"]
pub struct RE_W<'a> {
w: &'a mut W,
}
impl<'a> RE_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: RE_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "Receiver is disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(RE_A::DISABLED)
}
#[doc = "Receiver is enabled"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(RE_A::ENABLED)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2);
self.w
}
}
#[doc = "USART enable in Stop mode\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum UESM_A {
#[doc = "0: USART not able to wake up the MCU from Stop mode"]
DISABLED,
#[doc = "1: USART able to wake up the MCU from Stop mode"]
ENABLED,
}
impl From<UESM_A> for bool {
#[inline(always)]
fn from(variant: UESM_A) -> Self {
match variant {
UESM_A::DISABLED => false,
UESM_A::ENABLED => true,
}
}
}
#[doc = "Reader of field `UESM`"]
pub type UESM_R = crate::R<bool, UESM_A>;
impl UESM_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> UESM_A {
match self.bits {
false => UESM_A::DISABLED,
true => UESM_A::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == UESM_A::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == UESM_A::ENABLED
}
}
#[doc = "Write proxy for field `UESM`"]
pub struct UESM_W<'a> {
w: &'a mut W,
}
impl<'a> UESM_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: UESM_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "USART not able to wake up the MCU from Stop mode"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(UESM_A::DISABLED)
}
#[doc = "USART able to wake up the MCU from Stop mode"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(UESM_A::ENABLED)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1);
self.w
}
}
#[doc = "USART enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum UE_A {
#[doc = "0: UART is disabled"]
DISABLED,
#[doc = "1: UART is enabled"]
ENABLED,
}
impl From<UE_A> for bool {
#[inline(always)]
fn from(variant: UE_A) -> Self {
match variant {
UE_A::DISABLED => false,
UE_A::ENABLED => true,
}
}
}
#[doc = "Reader of field `UE`"]
pub type UE_R = crate::R<bool, UE_A>;
impl UE_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> UE_A {
match self.bits {
false => UE_A::DISABLED,
true => UE_A::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == UE_A::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == UE_A::ENABLED
}
}
#[doc = "Write proxy for field `UE`"]
pub struct UE_W<'a> {
w: &'a mut W,
}
impl<'a> UE_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: UE_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "UART is disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(UE_A::DISABLED)
}
#[doc = "UART is enabled"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(UE_A::ENABLED)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01);
self.w
}
}
#[doc = "Reader of field `DEAT`"]
pub type DEAT_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `DEAT`"]
pub struct DEAT_W<'a> {
w: &'a mut W,
}
impl<'a> DEAT_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x1f << 21)) | (((value as u32) & 0x1f) << 21);
self.w
}
}
#[doc = "Reader of field `DEDT`"]
pub type DEDT_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `DEDT`"]
pub struct DEDT_W<'a> {
w: &'a mut W,
}
impl<'a> DEDT_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x1f << 16)) | (((value as u32) & 0x1f) << 16);
self.w
}
}
impl R {
#[doc = "Bit 28 - Word length"]
#[inline(always)]
pub fn m1(&self) -> M1_R {
M1_R::new(((self.bits >> 28) & 0x01) != 0)
}
#[doc = "Bit 27 - End of Block interrupt enable"]
#[inline(always)]
pub fn eobie(&self) -> EOBIE_R {
EOBIE_R::new(((self.bits >> 27) & 0x01) != 0)
}
#[doc = "Bit 26 - Receiver timeout interrupt enable"]
#[inline(always)]
pub fn rtoie(&self) -> RTOIE_R {
RTOIE_R::new(((self.bits >> 26) & 0x01) != 0)
}
#[doc = "Bit 15 - Oversampling mode"]
#[inline(always)]
pub fn over8(&self) -> OVER8_R {
OVER8_R::new(((self.bits >> 15) & 0x01) != 0)
}
#[doc = "Bit 14 - Character match interrupt enable"]
#[inline(always)]
pub fn cmie(&self) -> CMIE_R {
CMIE_R::new(((self.bits >> 14) & 0x01) != 0)
}
#[doc = "Bit 13 - Mute mode enable"]
#[inline(always)]
pub fn mme(&self) -> MME_R {
MME_R::new(((self.bits >> 13) & 0x01) != 0)
}
#[doc = "Bit 12 - Word length"]
#[inline(always)]
pub fn m0(&self) -> M0_R {
M0_R::new(((self.bits >> 12) & 0x01) != 0)
}
#[doc = "Bit 11 - Receiver wakeup method"]
#[inline(always)]
pub fn wake(&self) -> WAKE_R {
WAKE_R::new(((self.bits >> 11) & 0x01) != 0)
}
#[doc = "Bit 10 - Parity control enable"]
#[inline(always)]
pub fn pce(&self) -> PCE_R {
PCE_R::new(((self.bits >> 10) & 0x01) != 0)
}
#[doc = "Bit 9 - Parity selection"]
#[inline(always)]
pub fn ps(&self) -> PS_R {
PS_R::new(((self.bits >> 9) & 0x01) != 0)
}
#[doc = "Bit 8 - PE interrupt enable"]
#[inline(always)]
pub fn peie(&self) -> PEIE_R {
PEIE_R::new(((self.bits >> 8) & 0x01) != 0)
}
#[doc = "Bit 7 - interrupt enable"]
#[inline(always)]
pub fn txeie(&self) -> TXEIE_R {
TXEIE_R::new(((self.bits >> 7) & 0x01) != 0)
}
#[doc = "Bit 6 - Transmission complete interrupt enable"]
#[inline(always)]
pub fn tcie(&self) -> TCIE_R {
TCIE_R::new(((self.bits >> 6) & 0x01) != 0)
}
#[doc = "Bit 5 - RXNE interrupt enable"]
#[inline(always)]
pub fn rxneie(&self) -> RXNEIE_R {
RXNEIE_R::new(((self.bits >> 5) & 0x01) != 0)
}
#[doc = "Bit 4 - IDLE interrupt enable"]
#[inline(always)]
pub fn idleie(&self) -> IDLEIE_R {
IDLEIE_R::new(((self.bits >> 4) & 0x01) != 0)
}
#[doc = "Bit 3 - Transmitter enable"]
#[inline(always)]
pub fn te(&self) -> TE_R {
TE_R::new(((self.bits >> 3) & 0x01) != 0)
}
#[doc = "Bit 2 - Receiver enable"]
#[inline(always)]
pub fn re(&self) -> RE_R {
RE_R::new(((self.bits >> 2) & 0x01) != 0)
}
#[doc = "Bit 1 - USART enable in Stop mode"]
#[inline(always)]
pub fn uesm(&self) -> UESM_R {
UESM_R::new(((self.bits >> 1) & 0x01) != 0)
}
#[doc = "Bit 0 - USART enable"]
#[inline(always)]
pub fn ue(&self) -> UE_R {
UE_R::new((self.bits & 0x01) != 0)
}
#[doc = "Bits 21:25 - Driver Enable assertion time"]
#[inline(always)]
pub fn deat(&self) -> DEAT_R {
DEAT_R::new(((self.bits >> 21) & 0x1f) as u8)
}
#[doc = "Bits 16:20 - Driver Enable de-assertion time"]
#[inline(always)]
pub fn dedt(&self) -> DEDT_R {
DEDT_R::new(((self.bits >> 16) & 0x1f) as u8)
}
}
impl W {
#[doc = "Bit 28 - Word length"]
#[inline(always)]
pub fn m1(&mut self) -> M1_W {
M1_W { w: self }
}
#[doc = "Bit 27 - End of Block interrupt enable"]
#[inline(always)]
pub fn eobie(&mut self) -> EOBIE_W {
EOBIE_W { w: self }
}
#[doc = "Bit 26 - Receiver timeout interrupt enable"]
#[inline(always)]
pub fn rtoie(&mut self) -> RTOIE_W {
RTOIE_W { w: self }
}
#[doc = "Bit 15 - Oversampling mode"]
#[inline(always)]
pub fn over8(&mut self) -> OVER8_W {
OVER8_W { w: self }
}
#[doc = "Bit 14 - Character match interrupt enable"]
#[inline(always)]
pub fn cmie(&mut self) -> CMIE_W {
CMIE_W { w: self }
}
#[doc = "Bit 13 - Mute mode enable"]
#[inline(always)]
pub fn mme(&mut self) -> MME_W {
MME_W { w: self }
}
#[doc = "Bit 12 - Word length"]
#[inline(always)]
pub fn m0(&mut self) -> M0_W {
M0_W { w: self }
}
#[doc = "Bit 11 - Receiver wakeup method"]
#[inline(always)]
pub fn wake(&mut self) -> WAKE_W {
WAKE_W { w: self }
}
#[doc = "Bit 10 - Parity control enable"]
#[inline(always)]
pub fn pce(&mut self) -> PCE_W {
PCE_W { w: self }
}
#[doc = "Bit 9 - Parity selection"]
#[inline(always)]
pub fn ps(&mut self) -> PS_W {
PS_W { w: self }
}
#[doc = "Bit 8 - PE interrupt enable"]
#[inline(always)]
pub fn peie(&mut self) -> PEIE_W {
PEIE_W { w: self }
}
#[doc = "Bit 7 - interrupt enable"]
#[inline(always)]
pub fn txeie(&mut self) -> TXEIE_W {
TXEIE_W { w: self }
}
#[doc = "Bit 6 - Transmission complete interrupt enable"]
#[inline(always)]
pub fn tcie(&mut self) -> TCIE_W {
TCIE_W { w: self }
}
#[doc = "Bit 5 - RXNE interrupt enable"]
#[inline(always)]
pub fn rxneie(&mut self) -> RXNEIE_W {
RXNEIE_W { w: self }
}
#[doc = "Bit 4 - IDLE interrupt enable"]
#[inline(always)]
pub fn idleie(&mut self) -> IDLEIE_W {
IDLEIE_W { w: self }
}
#[doc = "Bit 3 - Transmitter enable"]
#[inline(always)]
pub fn te(&mut self) -> TE_W {
TE_W { w: self }
}
#[doc = "Bit 2 - Receiver enable"]
#[inline(always)]
pub fn re(&mut self) -> RE_W {
RE_W { w: self }
}
#[doc = "Bit 1 - USART enable in Stop mode"]
#[inline(always)]
pub fn uesm(&mut self) -> UESM_W {
UESM_W { w: self }
}
#[doc = "Bit 0 - USART enable"]
#[inline(always)]
pub fn ue(&mut self) -> UE_W {
UE_W { w: self }
}
#[doc = "Bits 21:25 - Driver Enable assertion time"]
#[inline(always)]
pub fn deat(&mut self) -> DEAT_W {
DEAT_W { w: self }
}
#[doc = "Bits 16:20 - Driver Enable de-assertion time"]
#[inline(always)]
pub fn dedt(&mut self) -> DEDT_W {
DEDT_W { w: self }
}
}