#[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::RQR {
#[doc = r"Modifies the contents of the register"]
#[inline(always)]
pub fn modify<F>(&self, f: F)
where
for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W,
{
let bits = self.register.get();
self.register.set(f(&R { bits }, &mut W { bits }).bits);
}
#[doc = r"Reads the contents of the register"]
#[inline(always)]
pub fn read(&self) -> R {
R {
bits: self.register.get(),
}
}
#[doc = r"Writes to the register"]
#[inline(always)]
pub fn write<F>(&self, f: F)
where
F: FnOnce(&mut W) -> &mut W,
{
self.register.set(
f(&mut W {
bits: Self::reset_value(),
})
.bits,
);
}
#[doc = r"Reset value of the register"]
#[inline(always)]
pub const fn reset_value() -> u32 {
0
}
#[doc = r"Writes the reset value to the register"]
#[inline(always)]
pub fn reset(&self) {
self.register.set(Self::reset_value())
}
}
#[doc = "Possible values of the field `TXFRQ`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TXFRQR {
#[doc = "Set the TXE flags. This allows to discard the transmit data"]
DISCARD,
#[doc = r"Reserved"]
_Reserved(bool),
}
impl TXFRQR {
#[doc = r"Returns `true` if the bit is clear (0)"]
#[inline(always)]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r"Returns `true` if the bit is set (1)"]
#[inline(always)]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
match *self {
TXFRQR::DISCARD => true,
TXFRQR::_Reserved(bits) => bits,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> TXFRQR {
match value {
true => TXFRQR::DISCARD,
i => TXFRQR::_Reserved(i),
}
}
#[doc = "Checks if the value of the field is `DISCARD`"]
#[inline(always)]
pub fn is_discard(&self) -> bool {
*self == TXFRQR::DISCARD
}
}
#[doc = "Values that can be written to the field `TXFRQ`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TXFRQW {
#[doc = "Set the TXE flags. This allows to discard the transmit data"]
DISCARD,
}
impl TXFRQW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
TXFRQW::DISCARD => true,
}
}
}
#[doc = r"Proxy"]
pub struct _TXFRQW<'a> {
w: &'a mut W,
}
impl<'a> _TXFRQW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: TXFRQW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Set the TXE flags. This allows to discard the transmit data"]
#[inline(always)]
pub fn discard(self) -> &'a mut W {
self.variant(TXFRQW::DISCARD)
}
#[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 &= !(0x01 << 4);
self.w.bits |= ((value as u32) & 0x01) << 4;
self.w
}
}
#[doc = "Possible values of the field `RXFRQ`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum RXFRQR {
#[doc = "clears the RXNE flag. This allows to discard the received data without reading it, and avoid an overrun condition"]
DISCARD,
#[doc = r"Reserved"]
_Reserved(bool),
}
impl RXFRQR {
#[doc = r"Returns `true` if the bit is clear (0)"]
#[inline(always)]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r"Returns `true` if the bit is set (1)"]
#[inline(always)]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
match *self {
RXFRQR::DISCARD => true,
RXFRQR::_Reserved(bits) => bits,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> RXFRQR {
match value {
true => RXFRQR::DISCARD,
i => RXFRQR::_Reserved(i),
}
}
#[doc = "Checks if the value of the field is `DISCARD`"]
#[inline(always)]
pub fn is_discard(&self) -> bool {
*self == RXFRQR::DISCARD
}
}
#[doc = "Values that can be written to the field `RXFRQ`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum RXFRQW {
#[doc = "clears the RXNE flag. This allows to discard the received data without reading it, and avoid an overrun condition"]
DISCARD,
}
impl RXFRQW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
RXFRQW::DISCARD => true,
}
}
}
#[doc = r"Proxy"]
pub struct _RXFRQW<'a> {
w: &'a mut W,
}
impl<'a> _RXFRQW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: RXFRQW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "clears the RXNE flag. This allows to discard the received data without reading it, and avoid an overrun condition"]
#[inline(always)]
pub fn discard(self) -> &'a mut W {
self.variant(RXFRQW::DISCARD)
}
#[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 &= !(0x01 << 3);
self.w.bits |= ((value as u32) & 0x01) << 3;
self.w
}
}
#[doc = "Possible values of the field `MMRQ`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum MMRQR {
#[doc = "Puts the USART in mute mode and sets the RWU flag"]
MUTE,
#[doc = r"Reserved"]
_Reserved(bool),
}
impl MMRQR {
#[doc = r"Returns `true` if the bit is clear (0)"]
#[inline(always)]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r"Returns `true` if the bit is set (1)"]
#[inline(always)]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
match *self {
MMRQR::MUTE => true,
MMRQR::_Reserved(bits) => bits,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> MMRQR {
match value {
true => MMRQR::MUTE,
i => MMRQR::_Reserved(i),
}
}
#[doc = "Checks if the value of the field is `MUTE`"]
#[inline(always)]
pub fn is_mute(&self) -> bool {
*self == MMRQR::MUTE
}
}
#[doc = "Values that can be written to the field `MMRQ`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum MMRQW {
#[doc = "Puts the USART in mute mode and sets the RWU flag"]
MUTE,
}
impl MMRQW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
MMRQW::MUTE => true,
}
}
}
#[doc = r"Proxy"]
pub struct _MMRQW<'a> {
w: &'a mut W,
}
impl<'a> _MMRQW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: MMRQW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Puts the USART in mute mode and sets the RWU flag"]
#[inline(always)]
pub fn mute(self) -> &'a mut W {
self.variant(MMRQW::MUTE)
}
#[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 &= !(0x01 << 2);
self.w.bits |= ((value as u32) & 0x01) << 2;
self.w
}
}
#[doc = "Possible values of the field `SBKRQ`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum SBKRQR {
#[doc = "sets the SBKF flag and request to send a BREAK on the line, as soon as the transmit machine is available"]
BREAK,
#[doc = r"Reserved"]
_Reserved(bool),
}
impl SBKRQR {
#[doc = r"Returns `true` if the bit is clear (0)"]
#[inline(always)]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r"Returns `true` if the bit is set (1)"]
#[inline(always)]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
match *self {
SBKRQR::BREAK => true,
SBKRQR::_Reserved(bits) => bits,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> SBKRQR {
match value {
true => SBKRQR::BREAK,
i => SBKRQR::_Reserved(i),
}
}
#[doc = "Checks if the value of the field is `BREAK`"]
#[inline(always)]
pub fn is_break_(&self) -> bool {
*self == SBKRQR::BREAK
}
}
#[doc = "Values that can be written to the field `SBKRQ`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum SBKRQW {
#[doc = "sets the SBKF flag and request to send a BREAK on the line, as soon as the transmit machine is available"]
BREAK,
}
impl SBKRQW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
SBKRQW::BREAK => true,
}
}
}
#[doc = r"Proxy"]
pub struct _SBKRQW<'a> {
w: &'a mut W,
}
impl<'a> _SBKRQW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: SBKRQW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "sets the SBKF flag and request to send a BREAK on the line, as soon as the transmit machine is available"]
#[inline(always)]
pub fn break_(self) -> &'a mut W {
self.variant(SBKRQW::BREAK)
}
#[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 &= !(0x01 << 1);
self.w.bits |= ((value as u32) & 0x01) << 1;
self.w
}
}
#[doc = "Possible values of the field `ABRRQ`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ABRRQR {
#[doc = "resets the ABRF flag in the USART_ISR and request an automatic baud rate measurement on the next received data frame"]
REQUEST,
#[doc = r"Reserved"]
_Reserved(bool),
}
impl ABRRQR {
#[doc = r"Returns `true` if the bit is clear (0)"]
#[inline(always)]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r"Returns `true` if the bit is set (1)"]
#[inline(always)]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
match *self {
ABRRQR::REQUEST => true,
ABRRQR::_Reserved(bits) => bits,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> ABRRQR {
match value {
true => ABRRQR::REQUEST,
i => ABRRQR::_Reserved(i),
}
}
#[doc = "Checks if the value of the field is `REQUEST`"]
#[inline(always)]
pub fn is_request(&self) -> bool {
*self == ABRRQR::REQUEST
}
}
#[doc = "Values that can be written to the field `ABRRQ`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ABRRQW {
#[doc = "resets the ABRF flag in the USART_ISR and request an automatic baud rate measurement on the next received data frame"]
REQUEST,
}
impl ABRRQW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
ABRRQW::REQUEST => true,
}
}
}
#[doc = r"Proxy"]
pub struct _ABRRQW<'a> {
w: &'a mut W,
}
impl<'a> _ABRRQW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: ABRRQW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "resets the ABRF flag in the USART_ISR and request an automatic baud rate measurement on the next received data frame"]
#[inline(always)]
pub fn request(self) -> &'a mut W {
self.variant(ABRRQW::REQUEST)
}
#[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 &= !(0x01 << 0);
self.w.bits |= ((value as u32) & 0x01) << 0;
self.w
}
}
impl R {
#[doc = r"Value of the register as raw bits"]
#[inline(always)]
pub fn bits(&self) -> u32 {
self.bits
}
#[doc = "Bit 4 - Transmit data flush request"]
#[inline(always)]
pub fn txfrq(&self) -> TXFRQR {
TXFRQR::_from(((self.bits >> 4) & 0x01) != 0)
}
#[doc = "Bit 3 - Receive data flush request"]
#[inline(always)]
pub fn rxfrq(&self) -> RXFRQR {
RXFRQR::_from(((self.bits >> 3) & 0x01) != 0)
}
#[doc = "Bit 2 - Mute mode request"]
#[inline(always)]
pub fn mmrq(&self) -> MMRQR {
MMRQR::_from(((self.bits >> 2) & 0x01) != 0)
}
#[doc = "Bit 1 - Send break request"]
#[inline(always)]
pub fn sbkrq(&self) -> SBKRQR {
SBKRQR::_from(((self.bits >> 1) & 0x01) != 0)
}
#[doc = "Bit 0 - Auto baud rate request"]
#[inline(always)]
pub fn abrrq(&self) -> ABRRQR {
ABRRQR::_from(((self.bits >> 0) & 0x01) != 0)
}
}
impl W {
#[doc = r"Writes raw bits to the register"]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.bits = bits;
self
}
#[doc = "Bit 4 - Transmit data flush request"]
#[inline(always)]
pub fn txfrq(&mut self) -> _TXFRQW {
_TXFRQW { w: self }
}
#[doc = "Bit 3 - Receive data flush request"]
#[inline(always)]
pub fn rxfrq(&mut self) -> _RXFRQW {
_RXFRQW { w: self }
}
#[doc = "Bit 2 - Mute mode request"]
#[inline(always)]
pub fn mmrq(&mut self) -> _MMRQW {
_MMRQW { w: self }
}
#[doc = "Bit 1 - Send break request"]
#[inline(always)]
pub fn sbkrq(&mut self) -> _SBKRQW {
_SBKRQW { w: self }
}
#[doc = "Bit 0 - Auto baud rate request"]
#[inline(always)]
pub fn abrrq(&mut self) -> _ABRRQW {
_ABRRQW { w: self }
}
}