#[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::CR1 {
#[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 `PE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum PER {
#[doc = "Peripheral disabled"]
DISABLED,
#[doc = "Peripheral enabled"]
ENABLED,
}
impl PER {
#[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 {
PER::DISABLED => false,
PER::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> PER {
match value {
false => PER::DISABLED,
true => PER::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == PER::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == PER::ENABLED
}
}
#[doc = "Values that can be written to the field `PE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum PEW {
#[doc = "Peripheral disabled"]
DISABLED,
#[doc = "Peripheral enabled"]
ENABLED,
}
impl PEW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
PEW::DISABLED => false,
PEW::ENABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _PEW<'a> {
w: &'a mut W,
}
impl<'a> _PEW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: PEW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Peripheral disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(PEW::DISABLED)
}
#[doc = "Peripheral enabled"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(PEW::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 &= !(0x01 << 0);
self.w.bits |= ((value as u32) & 0x01) << 0;
self.w
}
}
#[doc = "Possible values of the field `TXIE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TXIER {
#[doc = "Transmit (TXIS) interrupt disabled"]
DISABLED,
#[doc = "Transmit (TXIS) interrupt enabled"]
ENABLED,
}
impl TXIER {
#[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 {
TXIER::DISABLED => false,
TXIER::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> TXIER {
match value {
false => TXIER::DISABLED,
true => TXIER::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == TXIER::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == TXIER::ENABLED
}
}
#[doc = "Values that can be written to the field `TXIE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TXIEW {
#[doc = "Transmit (TXIS) interrupt disabled"]
DISABLED,
#[doc = "Transmit (TXIS) interrupt enabled"]
ENABLED,
}
impl TXIEW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
TXIEW::DISABLED => false,
TXIEW::ENABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _TXIEW<'a> {
w: &'a mut W,
}
impl<'a> _TXIEW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: TXIEW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Transmit (TXIS) interrupt disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(TXIEW::DISABLED)
}
#[doc = "Transmit (TXIS) interrupt enabled"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(TXIEW::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 &= !(0x01 << 1);
self.w.bits |= ((value as u32) & 0x01) << 1;
self.w
}
}
#[doc = "Possible values of the field `RXIE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum RXIER {
#[doc = "Receive (RXNE) interrupt disabled"]
DISABLED,
#[doc = "Receive (RXNE) interrupt enabled"]
ENABLED,
}
impl RXIER {
#[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 {
RXIER::DISABLED => false,
RXIER::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> RXIER {
match value {
false => RXIER::DISABLED,
true => RXIER::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == RXIER::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == RXIER::ENABLED
}
}
#[doc = "Values that can be written to the field `RXIE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum RXIEW {
#[doc = "Receive (RXNE) interrupt disabled"]
DISABLED,
#[doc = "Receive (RXNE) interrupt enabled"]
ENABLED,
}
impl RXIEW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
RXIEW::DISABLED => false,
RXIEW::ENABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _RXIEW<'a> {
w: &'a mut W,
}
impl<'a> _RXIEW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: RXIEW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Receive (RXNE) interrupt disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(RXIEW::DISABLED)
}
#[doc = "Receive (RXNE) interrupt enabled"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(RXIEW::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 &= !(0x01 << 2);
self.w.bits |= ((value as u32) & 0x01) << 2;
self.w
}
}
#[doc = "Possible values of the field `ADDRIE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ADDRIER {
#[doc = "Address match (ADDR) interrupts disabled"]
DISABLED,
#[doc = "Address match (ADDR) interrupts enabled"]
ENABLED,
}
impl ADDRIER {
#[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 {
ADDRIER::DISABLED => false,
ADDRIER::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> ADDRIER {
match value {
false => ADDRIER::DISABLED,
true => ADDRIER::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == ADDRIER::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == ADDRIER::ENABLED
}
}
#[doc = "Values that can be written to the field `ADDRIE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ADDRIEW {
#[doc = "Address match (ADDR) interrupts disabled"]
DISABLED,
#[doc = "Address match (ADDR) interrupts enabled"]
ENABLED,
}
impl ADDRIEW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
ADDRIEW::DISABLED => false,
ADDRIEW::ENABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _ADDRIEW<'a> {
w: &'a mut W,
}
impl<'a> _ADDRIEW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: ADDRIEW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Address match (ADDR) interrupts disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(ADDRIEW::DISABLED)
}
#[doc = "Address match (ADDR) interrupts enabled"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(ADDRIEW::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 &= !(0x01 << 3);
self.w.bits |= ((value as u32) & 0x01) << 3;
self.w
}
}
#[doc = "Possible values of the field `NACKIE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum NACKIER {
#[doc = "Not acknowledge (NACKF) received interrupts disabled"]
DISABLED,
#[doc = "Not acknowledge (NACKF) received interrupts enabled"]
ENABLED,
}
impl NACKIER {
#[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 {
NACKIER::DISABLED => false,
NACKIER::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> NACKIER {
match value {
false => NACKIER::DISABLED,
true => NACKIER::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == NACKIER::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == NACKIER::ENABLED
}
}
#[doc = "Values that can be written to the field `NACKIE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum NACKIEW {
#[doc = "Not acknowledge (NACKF) received interrupts disabled"]
DISABLED,
#[doc = "Not acknowledge (NACKF) received interrupts enabled"]
ENABLED,
}
impl NACKIEW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
NACKIEW::DISABLED => false,
NACKIEW::ENABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _NACKIEW<'a> {
w: &'a mut W,
}
impl<'a> _NACKIEW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: NACKIEW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Not acknowledge (NACKF) received interrupts disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(NACKIEW::DISABLED)
}
#[doc = "Not acknowledge (NACKF) received interrupts enabled"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(NACKIEW::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 &= !(0x01 << 4);
self.w.bits |= ((value as u32) & 0x01) << 4;
self.w
}
}
#[doc = "Possible values of the field `STOPIE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum STOPIER {
#[doc = "Stop detection (STOPF) interrupt disabled"]
DISABLED,
#[doc = "Stop detection (STOPF) interrupt enabled"]
ENABLED,
}
impl STOPIER {
#[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 {
STOPIER::DISABLED => false,
STOPIER::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> STOPIER {
match value {
false => STOPIER::DISABLED,
true => STOPIER::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == STOPIER::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == STOPIER::ENABLED
}
}
#[doc = "Values that can be written to the field `STOPIE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum STOPIEW {
#[doc = "Stop detection (STOPF) interrupt disabled"]
DISABLED,
#[doc = "Stop detection (STOPF) interrupt enabled"]
ENABLED,
}
impl STOPIEW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
STOPIEW::DISABLED => false,
STOPIEW::ENABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _STOPIEW<'a> {
w: &'a mut W,
}
impl<'a> _STOPIEW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: STOPIEW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Stop detection (STOPF) interrupt disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(STOPIEW::DISABLED)
}
#[doc = "Stop detection (STOPF) interrupt enabled"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(STOPIEW::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 &= !(0x01 << 5);
self.w.bits |= ((value as u32) & 0x01) << 5;
self.w
}
}
#[doc = "Possible values of the field `TCIE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TCIER {
#[doc = "Transfer Complete interrupt disabled"]
DISABLED,
#[doc = "Transfer Complete interrupt enabled"]
ENABLED,
}
impl TCIER {
#[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 {
TCIER::DISABLED => false,
TCIER::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> TCIER {
match value {
false => TCIER::DISABLED,
true => TCIER::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == TCIER::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == TCIER::ENABLED
}
}
#[doc = "Values that can be written to the field `TCIE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TCIEW {
#[doc = "Transfer Complete interrupt disabled"]
DISABLED,
#[doc = "Transfer Complete interrupt enabled"]
ENABLED,
}
impl TCIEW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
TCIEW::DISABLED => false,
TCIEW::ENABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _TCIEW<'a> {
w: &'a mut W,
}
impl<'a> _TCIEW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: TCIEW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Transfer Complete interrupt disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(TCIEW::DISABLED)
}
#[doc = "Transfer Complete interrupt enabled"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(TCIEW::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 &= !(0x01 << 6);
self.w.bits |= ((value as u32) & 0x01) << 6;
self.w
}
}
#[doc = "Possible values of the field `ERRIE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ERRIER {
#[doc = "Error detection interrupts disabled"]
DISABLED,
#[doc = "Error detection interrupts enabled"]
ENABLED,
}
impl ERRIER {
#[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 {
ERRIER::DISABLED => false,
ERRIER::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> ERRIER {
match value {
false => ERRIER::DISABLED,
true => ERRIER::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == ERRIER::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == ERRIER::ENABLED
}
}
#[doc = "Values that can be written to the field `ERRIE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ERRIEW {
#[doc = "Error detection interrupts disabled"]
DISABLED,
#[doc = "Error detection interrupts enabled"]
ENABLED,
}
impl ERRIEW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
ERRIEW::DISABLED => false,
ERRIEW::ENABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _ERRIEW<'a> {
w: &'a mut W,
}
impl<'a> _ERRIEW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: ERRIEW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Error detection interrupts disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(ERRIEW::DISABLED)
}
#[doc = "Error detection interrupts enabled"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(ERRIEW::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 &= !(0x01 << 7);
self.w.bits |= ((value as u32) & 0x01) << 7;
self.w
}
}
#[doc = "Possible values of the field `DNF`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum DNFR {
#[doc = "Digital filter disabled"]
NOFILTER,
#[doc = "Digital filter enabled and filtering capability up to 1 tI2CCLK"]
FILTER1,
#[doc = "Digital filter enabled and filtering capability up to 2 tI2CCLK"]
FILTER2,
#[doc = "Digital filter enabled and filtering capability up to 3 tI2CCLK"]
FILTER3,
#[doc = "Digital filter enabled and filtering capability up to 4 tI2CCLK"]
FILTER4,
#[doc = "Digital filter enabled and filtering capability up to 5 tI2CCLK"]
FILTER5,
#[doc = "Digital filter enabled and filtering capability up to 6 tI2CCLK"]
FILTER6,
#[doc = "Digital filter enabled and filtering capability up to 7 tI2CCLK"]
FILTER7,
#[doc = "Digital filter enabled and filtering capability up to 8 tI2CCLK"]
FILTER8,
#[doc = "Digital filter enabled and filtering capability up to 9 tI2CCLK"]
FILTER9,
#[doc = "Digital filter enabled and filtering capability up to 10 tI2CCLK"]
FILTER10,
#[doc = "Digital filter enabled and filtering capability up to 11 tI2CCLK"]
FILTER11,
#[doc = "Digital filter enabled and filtering capability up to 12 tI2CCLK"]
FILTER12,
#[doc = "Digital filter enabled and filtering capability up to 13 tI2CCLK"]
FILTER13,
#[doc = "Digital filter enabled and filtering capability up to 14 tI2CCLK"]
FILTER14,
#[doc = "Digital filter enabled and filtering capability up to 15 tI2CCLK"]
FILTER15,
}
impl DNFR {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bits(&self) -> u8 {
match *self {
DNFR::NOFILTER => 0,
DNFR::FILTER1 => 0x01,
DNFR::FILTER2 => 0x02,
DNFR::FILTER3 => 0x03,
DNFR::FILTER4 => 0x04,
DNFR::FILTER5 => 0x05,
DNFR::FILTER6 => 0x06,
DNFR::FILTER7 => 0x07,
DNFR::FILTER8 => 0x08,
DNFR::FILTER9 => 0x09,
DNFR::FILTER10 => 0x0a,
DNFR::FILTER11 => 0x0b,
DNFR::FILTER12 => 0x0c,
DNFR::FILTER13 => 0x0d,
DNFR::FILTER14 => 0x0e,
DNFR::FILTER15 => 0x0f,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: u8) -> DNFR {
match value {
0 => DNFR::NOFILTER,
1 => DNFR::FILTER1,
2 => DNFR::FILTER2,
3 => DNFR::FILTER3,
4 => DNFR::FILTER4,
5 => DNFR::FILTER5,
6 => DNFR::FILTER6,
7 => DNFR::FILTER7,
8 => DNFR::FILTER8,
9 => DNFR::FILTER9,
10 => DNFR::FILTER10,
11 => DNFR::FILTER11,
12 => DNFR::FILTER12,
13 => DNFR::FILTER13,
14 => DNFR::FILTER14,
15 => DNFR::FILTER15,
_ => unreachable!(),
}
}
#[doc = "Checks if the value of the field is `NOFILTER`"]
#[inline(always)]
pub fn is_no_filter(&self) -> bool {
*self == DNFR::NOFILTER
}
#[doc = "Checks if the value of the field is `FILTER1`"]
#[inline(always)]
pub fn is_filter1(&self) -> bool {
*self == DNFR::FILTER1
}
#[doc = "Checks if the value of the field is `FILTER2`"]
#[inline(always)]
pub fn is_filter2(&self) -> bool {
*self == DNFR::FILTER2
}
#[doc = "Checks if the value of the field is `FILTER3`"]
#[inline(always)]
pub fn is_filter3(&self) -> bool {
*self == DNFR::FILTER3
}
#[doc = "Checks if the value of the field is `FILTER4`"]
#[inline(always)]
pub fn is_filter4(&self) -> bool {
*self == DNFR::FILTER4
}
#[doc = "Checks if the value of the field is `FILTER5`"]
#[inline(always)]
pub fn is_filter5(&self) -> bool {
*self == DNFR::FILTER5
}
#[doc = "Checks if the value of the field is `FILTER6`"]
#[inline(always)]
pub fn is_filter6(&self) -> bool {
*self == DNFR::FILTER6
}
#[doc = "Checks if the value of the field is `FILTER7`"]
#[inline(always)]
pub fn is_filter7(&self) -> bool {
*self == DNFR::FILTER7
}
#[doc = "Checks if the value of the field is `FILTER8`"]
#[inline(always)]
pub fn is_filter8(&self) -> bool {
*self == DNFR::FILTER8
}
#[doc = "Checks if the value of the field is `FILTER9`"]
#[inline(always)]
pub fn is_filter9(&self) -> bool {
*self == DNFR::FILTER9
}
#[doc = "Checks if the value of the field is `FILTER10`"]
#[inline(always)]
pub fn is_filter10(&self) -> bool {
*self == DNFR::FILTER10
}
#[doc = "Checks if the value of the field is `FILTER11`"]
#[inline(always)]
pub fn is_filter11(&self) -> bool {
*self == DNFR::FILTER11
}
#[doc = "Checks if the value of the field is `FILTER12`"]
#[inline(always)]
pub fn is_filter12(&self) -> bool {
*self == DNFR::FILTER12
}
#[doc = "Checks if the value of the field is `FILTER13`"]
#[inline(always)]
pub fn is_filter13(&self) -> bool {
*self == DNFR::FILTER13
}
#[doc = "Checks if the value of the field is `FILTER14`"]
#[inline(always)]
pub fn is_filter14(&self) -> bool {
*self == DNFR::FILTER14
}
#[doc = "Checks if the value of the field is `FILTER15`"]
#[inline(always)]
pub fn is_filter15(&self) -> bool {
*self == DNFR::FILTER15
}
}
#[doc = "Values that can be written to the field `DNF`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum DNFW {
#[doc = "Digital filter disabled"]
NOFILTER,
#[doc = "Digital filter enabled and filtering capability up to 1 tI2CCLK"]
FILTER1,
#[doc = "Digital filter enabled and filtering capability up to 2 tI2CCLK"]
FILTER2,
#[doc = "Digital filter enabled and filtering capability up to 3 tI2CCLK"]
FILTER3,
#[doc = "Digital filter enabled and filtering capability up to 4 tI2CCLK"]
FILTER4,
#[doc = "Digital filter enabled and filtering capability up to 5 tI2CCLK"]
FILTER5,
#[doc = "Digital filter enabled and filtering capability up to 6 tI2CCLK"]
FILTER6,
#[doc = "Digital filter enabled and filtering capability up to 7 tI2CCLK"]
FILTER7,
#[doc = "Digital filter enabled and filtering capability up to 8 tI2CCLK"]
FILTER8,
#[doc = "Digital filter enabled and filtering capability up to 9 tI2CCLK"]
FILTER9,
#[doc = "Digital filter enabled and filtering capability up to 10 tI2CCLK"]
FILTER10,
#[doc = "Digital filter enabled and filtering capability up to 11 tI2CCLK"]
FILTER11,
#[doc = "Digital filter enabled and filtering capability up to 12 tI2CCLK"]
FILTER12,
#[doc = "Digital filter enabled and filtering capability up to 13 tI2CCLK"]
FILTER13,
#[doc = "Digital filter enabled and filtering capability up to 14 tI2CCLK"]
FILTER14,
#[doc = "Digital filter enabled and filtering capability up to 15 tI2CCLK"]
FILTER15,
}
impl DNFW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> u8 {
match *self {
DNFW::NOFILTER => 0,
DNFW::FILTER1 => 1,
DNFW::FILTER2 => 2,
DNFW::FILTER3 => 3,
DNFW::FILTER4 => 4,
DNFW::FILTER5 => 5,
DNFW::FILTER6 => 6,
DNFW::FILTER7 => 7,
DNFW::FILTER8 => 8,
DNFW::FILTER9 => 9,
DNFW::FILTER10 => 10,
DNFW::FILTER11 => 11,
DNFW::FILTER12 => 12,
DNFW::FILTER13 => 13,
DNFW::FILTER14 => 14,
DNFW::FILTER15 => 15,
}
}
}
#[doc = r"Proxy"]
pub struct _DNFW<'a> {
w: &'a mut W,
}
impl<'a> _DNFW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: DNFW) -> &'a mut W {
{
self.bits(variant._bits())
}
}
#[doc = "Digital filter disabled"]
#[inline(always)]
pub fn no_filter(self) -> &'a mut W {
self.variant(DNFW::NOFILTER)
}
#[doc = "Digital filter enabled and filtering capability up to 1 tI2CCLK"]
#[inline(always)]
pub fn filter1(self) -> &'a mut W {
self.variant(DNFW::FILTER1)
}
#[doc = "Digital filter enabled and filtering capability up to 2 tI2CCLK"]
#[inline(always)]
pub fn filter2(self) -> &'a mut W {
self.variant(DNFW::FILTER2)
}
#[doc = "Digital filter enabled and filtering capability up to 3 tI2CCLK"]
#[inline(always)]
pub fn filter3(self) -> &'a mut W {
self.variant(DNFW::FILTER3)
}
#[doc = "Digital filter enabled and filtering capability up to 4 tI2CCLK"]
#[inline(always)]
pub fn filter4(self) -> &'a mut W {
self.variant(DNFW::FILTER4)
}
#[doc = "Digital filter enabled and filtering capability up to 5 tI2CCLK"]
#[inline(always)]
pub fn filter5(self) -> &'a mut W {
self.variant(DNFW::FILTER5)
}
#[doc = "Digital filter enabled and filtering capability up to 6 tI2CCLK"]
#[inline(always)]
pub fn filter6(self) -> &'a mut W {
self.variant(DNFW::FILTER6)
}
#[doc = "Digital filter enabled and filtering capability up to 7 tI2CCLK"]
#[inline(always)]
pub fn filter7(self) -> &'a mut W {
self.variant(DNFW::FILTER7)
}
#[doc = "Digital filter enabled and filtering capability up to 8 tI2CCLK"]
#[inline(always)]
pub fn filter8(self) -> &'a mut W {
self.variant(DNFW::FILTER8)
}
#[doc = "Digital filter enabled and filtering capability up to 9 tI2CCLK"]
#[inline(always)]
pub fn filter9(self) -> &'a mut W {
self.variant(DNFW::FILTER9)
}
#[doc = "Digital filter enabled and filtering capability up to 10 tI2CCLK"]
#[inline(always)]
pub fn filter10(self) -> &'a mut W {
self.variant(DNFW::FILTER10)
}
#[doc = "Digital filter enabled and filtering capability up to 11 tI2CCLK"]
#[inline(always)]
pub fn filter11(self) -> &'a mut W {
self.variant(DNFW::FILTER11)
}
#[doc = "Digital filter enabled and filtering capability up to 12 tI2CCLK"]
#[inline(always)]
pub fn filter12(self) -> &'a mut W {
self.variant(DNFW::FILTER12)
}
#[doc = "Digital filter enabled and filtering capability up to 13 tI2CCLK"]
#[inline(always)]
pub fn filter13(self) -> &'a mut W {
self.variant(DNFW::FILTER13)
}
#[doc = "Digital filter enabled and filtering capability up to 14 tI2CCLK"]
#[inline(always)]
pub fn filter14(self) -> &'a mut W {
self.variant(DNFW::FILTER14)
}
#[doc = "Digital filter enabled and filtering capability up to 15 tI2CCLK"]
#[inline(always)]
pub fn filter15(self) -> &'a mut W {
self.variant(DNFW::FILTER15)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bits(self, value: u8) -> &'a mut W {
self.w.bits &= !(0x0f << 8);
self.w.bits |= ((value as u32) & 0x0f) << 8;
self.w
}
}
#[doc = "Possible values of the field `ANFOFF`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ANFOFFR {
#[doc = "Analog noise filter enabled"]
ENABLED,
#[doc = "Analog noise filter disabled"]
DISABLED,
}
impl ANFOFFR {
#[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 {
ANFOFFR::ENABLED => false,
ANFOFFR::DISABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> ANFOFFR {
match value {
false => ANFOFFR::ENABLED,
true => ANFOFFR::DISABLED,
}
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == ANFOFFR::ENABLED
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == ANFOFFR::DISABLED
}
}
#[doc = "Values that can be written to the field `ANFOFF`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ANFOFFW {
#[doc = "Analog noise filter enabled"]
ENABLED,
#[doc = "Analog noise filter disabled"]
DISABLED,
}
impl ANFOFFW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
ANFOFFW::ENABLED => false,
ANFOFFW::DISABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _ANFOFFW<'a> {
w: &'a mut W,
}
impl<'a> _ANFOFFW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: ANFOFFW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Analog noise filter enabled"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(ANFOFFW::ENABLED)
}
#[doc = "Analog noise filter disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(ANFOFFW::DISABLED)
}
#[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 << 12);
self.w.bits |= ((value as u32) & 0x01) << 12;
self.w
}
}
#[doc = "Possible values of the field `TXDMAEN`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TXDMAENR {
#[doc = "DMA mode disabled for transmission"]
DISABLED,
#[doc = "DMA mode enabled for transmission"]
ENABLED,
}
impl TXDMAENR {
#[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 {
TXDMAENR::DISABLED => false,
TXDMAENR::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> TXDMAENR {
match value {
false => TXDMAENR::DISABLED,
true => TXDMAENR::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == TXDMAENR::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == TXDMAENR::ENABLED
}
}
#[doc = "Values that can be written to the field `TXDMAEN`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TXDMAENW {
#[doc = "DMA mode disabled for transmission"]
DISABLED,
#[doc = "DMA mode enabled for transmission"]
ENABLED,
}
impl TXDMAENW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
TXDMAENW::DISABLED => false,
TXDMAENW::ENABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _TXDMAENW<'a> {
w: &'a mut W,
}
impl<'a> _TXDMAENW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: TXDMAENW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "DMA mode disabled for transmission"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(TXDMAENW::DISABLED)
}
#[doc = "DMA mode enabled for transmission"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(TXDMAENW::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 &= !(0x01 << 14);
self.w.bits |= ((value as u32) & 0x01) << 14;
self.w
}
}
#[doc = "Possible values of the field `RXDMAEN`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum RXDMAENR {
#[doc = "DMA mode disabled for reception"]
DISABLED,
#[doc = "DMA mode enabled for reception"]
ENABLED,
}
impl RXDMAENR {
#[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 {
RXDMAENR::DISABLED => false,
RXDMAENR::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> RXDMAENR {
match value {
false => RXDMAENR::DISABLED,
true => RXDMAENR::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == RXDMAENR::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == RXDMAENR::ENABLED
}
}
#[doc = "Values that can be written to the field `RXDMAEN`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum RXDMAENW {
#[doc = "DMA mode disabled for reception"]
DISABLED,
#[doc = "DMA mode enabled for reception"]
ENABLED,
}
impl RXDMAENW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
RXDMAENW::DISABLED => false,
RXDMAENW::ENABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _RXDMAENW<'a> {
w: &'a mut W,
}
impl<'a> _RXDMAENW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: RXDMAENW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "DMA mode disabled for reception"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(RXDMAENW::DISABLED)
}
#[doc = "DMA mode enabled for reception"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(RXDMAENW::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 &= !(0x01 << 15);
self.w.bits |= ((value as u32) & 0x01) << 15;
self.w
}
}
#[doc = "Possible values of the field `SBC`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum SBCR {
#[doc = "Slave byte control disabled"]
DISABLED,
#[doc = "Slave byte control enabled"]
ENABLED,
}
impl SBCR {
#[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 {
SBCR::DISABLED => false,
SBCR::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> SBCR {
match value {
false => SBCR::DISABLED,
true => SBCR::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == SBCR::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == SBCR::ENABLED
}
}
#[doc = "Values that can be written to the field `SBC`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum SBCW {
#[doc = "Slave byte control disabled"]
DISABLED,
#[doc = "Slave byte control enabled"]
ENABLED,
}
impl SBCW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
SBCW::DISABLED => false,
SBCW::ENABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _SBCW<'a> {
w: &'a mut W,
}
impl<'a> _SBCW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: SBCW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Slave byte control disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(SBCW::DISABLED)
}
#[doc = "Slave byte control enabled"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(SBCW::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 &= !(0x01 << 16);
self.w.bits |= ((value as u32) & 0x01) << 16;
self.w
}
}
#[doc = "Possible values of the field `NOSTRETCH`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum NOSTRETCHR {
#[doc = "Clock stretching enabled"]
ENABLED,
#[doc = "Clock stretching disabled"]
DISABLED,
}
impl NOSTRETCHR {
#[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 {
NOSTRETCHR::ENABLED => false,
NOSTRETCHR::DISABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> NOSTRETCHR {
match value {
false => NOSTRETCHR::ENABLED,
true => NOSTRETCHR::DISABLED,
}
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == NOSTRETCHR::ENABLED
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == NOSTRETCHR::DISABLED
}
}
#[doc = "Values that can be written to the field `NOSTRETCH`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum NOSTRETCHW {
#[doc = "Clock stretching enabled"]
ENABLED,
#[doc = "Clock stretching disabled"]
DISABLED,
}
impl NOSTRETCHW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
NOSTRETCHW::ENABLED => false,
NOSTRETCHW::DISABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _NOSTRETCHW<'a> {
w: &'a mut W,
}
impl<'a> _NOSTRETCHW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: NOSTRETCHW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Clock stretching enabled"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(NOSTRETCHW::ENABLED)
}
#[doc = "Clock stretching disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(NOSTRETCHW::DISABLED)
}
#[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 << 17);
self.w.bits |= ((value as u32) & 0x01) << 17;
self.w
}
}
#[doc = "Possible values of the field `WUPEN`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum WUPENR {
#[doc = "Wakeup from Stop mode disabled"]
DISABLED,
#[doc = "Wakeup from Stop mode enabled"]
ENABLED,
}
impl WUPENR {
#[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 {
WUPENR::DISABLED => false,
WUPENR::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> WUPENR {
match value {
false => WUPENR::DISABLED,
true => WUPENR::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == WUPENR::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == WUPENR::ENABLED
}
}
#[doc = "Values that can be written to the field `WUPEN`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum WUPENW {
#[doc = "Wakeup from Stop mode disabled"]
DISABLED,
#[doc = "Wakeup from Stop mode enabled"]
ENABLED,
}
impl WUPENW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
WUPENW::DISABLED => false,
WUPENW::ENABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _WUPENW<'a> {
w: &'a mut W,
}
impl<'a> _WUPENW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: WUPENW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Wakeup from Stop mode disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(WUPENW::DISABLED)
}
#[doc = "Wakeup from Stop mode enabled"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(WUPENW::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 &= !(0x01 << 18);
self.w.bits |= ((value as u32) & 0x01) << 18;
self.w
}
}
#[doc = "Possible values of the field `GCEN`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum GCENR {
#[doc = "General call disabled. Address 0b00000000 is NACKed"]
DISABLED,
#[doc = "General call enabled. Address 0b00000000 is ACKed"]
ENABLED,
}
impl GCENR {
#[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 {
GCENR::DISABLED => false,
GCENR::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> GCENR {
match value {
false => GCENR::DISABLED,
true => GCENR::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == GCENR::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == GCENR::ENABLED
}
}
#[doc = "Values that can be written to the field `GCEN`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum GCENW {
#[doc = "General call disabled. Address 0b00000000 is NACKed"]
DISABLED,
#[doc = "General call enabled. Address 0b00000000 is ACKed"]
ENABLED,
}
impl GCENW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
GCENW::DISABLED => false,
GCENW::ENABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _GCENW<'a> {
w: &'a mut W,
}
impl<'a> _GCENW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: GCENW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "General call disabled. Address 0b00000000 is NACKed"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(GCENW::DISABLED)
}
#[doc = "General call enabled. Address 0b00000000 is ACKed"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(GCENW::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 &= !(0x01 << 19);
self.w.bits |= ((value as u32) & 0x01) << 19;
self.w
}
}
#[doc = "Possible values of the field `SMBHEN`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum SMBHENR {
#[doc = "Host address disabled. Address 0b0001000x is NACKed"]
DISABLED,
#[doc = "Host address enabled. Address 0b0001000x is ACKed"]
ENABLED,
}
impl SMBHENR {
#[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 {
SMBHENR::DISABLED => false,
SMBHENR::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> SMBHENR {
match value {
false => SMBHENR::DISABLED,
true => SMBHENR::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == SMBHENR::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == SMBHENR::ENABLED
}
}
#[doc = "Values that can be written to the field `SMBHEN`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum SMBHENW {
#[doc = "Host address disabled. Address 0b0001000x is NACKed"]
DISABLED,
#[doc = "Host address enabled. Address 0b0001000x is ACKed"]
ENABLED,
}
impl SMBHENW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
SMBHENW::DISABLED => false,
SMBHENW::ENABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _SMBHENW<'a> {
w: &'a mut W,
}
impl<'a> _SMBHENW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: SMBHENW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Host address disabled. Address 0b0001000x is NACKed"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(SMBHENW::DISABLED)
}
#[doc = "Host address enabled. Address 0b0001000x is ACKed"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(SMBHENW::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 &= !(0x01 << 20);
self.w.bits |= ((value as u32) & 0x01) << 20;
self.w
}
}
#[doc = "Possible values of the field `SMBDEN`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum SMBDENR {
#[doc = "Device default address disabled. Address 0b1100001x is NACKed"]
DISABLED,
#[doc = "Device default address enabled. Address 0b1100001x is ACKed"]
ENABLED,
}
impl SMBDENR {
#[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 {
SMBDENR::DISABLED => false,
SMBDENR::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> SMBDENR {
match value {
false => SMBDENR::DISABLED,
true => SMBDENR::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == SMBDENR::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == SMBDENR::ENABLED
}
}
#[doc = "Values that can be written to the field `SMBDEN`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum SMBDENW {
#[doc = "Device default address disabled. Address 0b1100001x is NACKed"]
DISABLED,
#[doc = "Device default address enabled. Address 0b1100001x is ACKed"]
ENABLED,
}
impl SMBDENW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
SMBDENW::DISABLED => false,
SMBDENW::ENABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _SMBDENW<'a> {
w: &'a mut W,
}
impl<'a> _SMBDENW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: SMBDENW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Device default address disabled. Address 0b1100001x is NACKed"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(SMBDENW::DISABLED)
}
#[doc = "Device default address enabled. Address 0b1100001x is ACKed"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(SMBDENW::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 &= !(0x01 << 21);
self.w.bits |= ((value as u32) & 0x01) << 21;
self.w
}
}
#[doc = "Possible values of the field `ALERTEN`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ALERTENR {
#[doc = "In device mode (SMBHEN=Disabled) Releases SMBA pin high and Alert Response Address Header disabled (0001100x) followed by NACK. In host mode (SMBHEN=Enabled) SMBus Alert pin (SMBA) not supported"]
DISABLED,
#[doc = "In device mode (SMBHEN=Disabled) Drives SMBA pin low and Alert Response Address Header enabled (0001100x) followed by ACK.In host mode (SMBHEN=Enabled) SMBus Alert pin (SMBA) supported"]
ENABLED,
}
impl ALERTENR {
#[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 {
ALERTENR::DISABLED => false,
ALERTENR::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> ALERTENR {
match value {
false => ALERTENR::DISABLED,
true => ALERTENR::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == ALERTENR::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == ALERTENR::ENABLED
}
}
#[doc = "Values that can be written to the field `ALERTEN`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ALERTENW {
#[doc = "In device mode (SMBHEN=Disabled) Releases SMBA pin high and Alert Response Address Header disabled (0001100x) followed by NACK. In host mode (SMBHEN=Enabled) SMBus Alert pin (SMBA) not supported"]
DISABLED,
#[doc = "In device mode (SMBHEN=Disabled) Drives SMBA pin low and Alert Response Address Header enabled (0001100x) followed by ACK.In host mode (SMBHEN=Enabled) SMBus Alert pin (SMBA) supported"]
ENABLED,
}
impl ALERTENW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
ALERTENW::DISABLED => false,
ALERTENW::ENABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _ALERTENW<'a> {
w: &'a mut W,
}
impl<'a> _ALERTENW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: ALERTENW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "In device mode (SMBHEN=Disabled) Releases SMBA pin high and Alert Response Address Header disabled (0001100x) followed by NACK. In host mode (SMBHEN=Enabled) SMBus Alert pin (SMBA) not supported"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(ALERTENW::DISABLED)
}
#[doc = "In device mode (SMBHEN=Disabled) Drives SMBA pin low and Alert Response Address Header enabled (0001100x) followed by ACK.In host mode (SMBHEN=Enabled) SMBus Alert pin (SMBA) supported"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(ALERTENW::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 &= !(0x01 << 22);
self.w.bits |= ((value as u32) & 0x01) << 22;
self.w
}
}
#[doc = "Possible values of the field `PECEN`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum PECENR {
#[doc = "PEC calculation disabled"]
DISABLED,
#[doc = "PEC calculation enabled"]
ENABLED,
}
impl PECENR {
#[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 {
PECENR::DISABLED => false,
PECENR::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> PECENR {
match value {
false => PECENR::DISABLED,
true => PECENR::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == PECENR::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == PECENR::ENABLED
}
}
#[doc = "Values that can be written to the field `PECEN`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum PECENW {
#[doc = "PEC calculation disabled"]
DISABLED,
#[doc = "PEC calculation enabled"]
ENABLED,
}
impl PECENW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
PECENW::DISABLED => false,
PECENW::ENABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _PECENW<'a> {
w: &'a mut W,
}
impl<'a> _PECENW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: PECENW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "PEC calculation disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(PECENW::DISABLED)
}
#[doc = "PEC calculation enabled"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(PECENW::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 &= !(0x01 << 23);
self.w.bits |= ((value as u32) & 0x01) << 23;
self.w
}
}
impl R {
#[doc = r"Value of the register as raw bits"]
#[inline(always)]
pub fn bits(&self) -> u32 {
self.bits
}
#[doc = "Bit 0 - Peripheral enable Note: When PE=0, the I2C SCL and SDA lines are released. Internal state machines and status bits are put back to their reset value. When cleared, PE must be kept low for at least 3 APB clock cycles."]
#[inline(always)]
pub fn pe(&self) -> PER {
PER::_from(((self.bits >> 0) & 0x01) != 0)
}
#[doc = "Bit 1 - TX Interrupt enable"]
#[inline(always)]
pub fn txie(&self) -> TXIER {
TXIER::_from(((self.bits >> 1) & 0x01) != 0)
}
#[doc = "Bit 2 - RX Interrupt enable"]
#[inline(always)]
pub fn rxie(&self) -> RXIER {
RXIER::_from(((self.bits >> 2) & 0x01) != 0)
}
#[doc = "Bit 3 - Address match Interrupt enable (slave only)"]
#[inline(always)]
pub fn addrie(&self) -> ADDRIER {
ADDRIER::_from(((self.bits >> 3) & 0x01) != 0)
}
#[doc = "Bit 4 - Not acknowledge received Interrupt enable"]
#[inline(always)]
pub fn nackie(&self) -> NACKIER {
NACKIER::_from(((self.bits >> 4) & 0x01) != 0)
}
#[doc = "Bit 5 - STOP detection Interrupt enable"]
#[inline(always)]
pub fn stopie(&self) -> STOPIER {
STOPIER::_from(((self.bits >> 5) & 0x01) != 0)
}
#[doc = "Bit 6 - Transfer Complete interrupt enable Note: Any of these events will generate an interrupt: Transfer Complete (TC) Transfer Complete Reload (TCR)"]
#[inline(always)]
pub fn tcie(&self) -> TCIER {
TCIER::_from(((self.bits >> 6) & 0x01) != 0)
}
#[doc = "Bit 7 - Error interrupts enable Note: Any of these errors generate an interrupt: Arbitration Loss (ARLO) Bus Error detection (BERR) Overrun/Underrun (OVR) Timeout detection (TIMEOUT) PEC error detection (PECERR) Alert pin event detection (ALERT)"]
#[inline(always)]
pub fn errie(&self) -> ERRIER {
ERRIER::_from(((self.bits >> 7) & 0x01) != 0)
}
#[doc = "Bits 8:11 - Digital noise filter These bits are used to configure the digital noise filter on SDA and SCL input. The digital filter will filter spikes with a length of up to DNF\\[3:0\\] * tI2CCLK ... Note: If the analog filter is also enabled, the digital filter is added to the analog filter. This filter can only be programmed when the I2C is disabled (PE = 0)."]
#[inline(always)]
pub fn dnf(&self) -> DNFR {
DNFR::_from(((self.bits >> 8) & 0x0f) as u8)
}
#[doc = "Bit 12 - Analog noise filter OFF Note: This bit can only be programmed when the I2C is disabled (PE = 0)."]
#[inline(always)]
pub fn anfoff(&self) -> ANFOFFR {
ANFOFFR::_from(((self.bits >> 12) & 0x01) != 0)
}
#[doc = "Bit 14 - DMA transmission requests enable"]
#[inline(always)]
pub fn txdmaen(&self) -> TXDMAENR {
TXDMAENR::_from(((self.bits >> 14) & 0x01) != 0)
}
#[doc = "Bit 15 - DMA reception requests enable"]
#[inline(always)]
pub fn rxdmaen(&self) -> RXDMAENR {
RXDMAENR::_from(((self.bits >> 15) & 0x01) != 0)
}
#[doc = "Bit 16 - Slave byte control This bit is used to enable hardware byte control in slave mode."]
#[inline(always)]
pub fn sbc(&self) -> SBCR {
SBCR::_from(((self.bits >> 16) & 0x01) != 0)
}
#[doc = "Bit 17 - Clock stretching disable This bit is used to disable clock stretching in slave mode. It must be kept cleared in master mode. Note: This bit can only be programmed when the I2C is disabled (PE = 0)."]
#[inline(always)]
pub fn nostretch(&self) -> NOSTRETCHR {
NOSTRETCHR::_from(((self.bits >> 17) & 0x01) != 0)
}
#[doc = "Bit 18 - Wakeup from Stop mode enable Note: If the Wakeup from Stop mode feature is not supported, this bit is reserved and forced by hardware to 0. Please refer to Section25.3: I2C implementation. Note: WUPEN can be set only when DNF = 0000"]
#[inline(always)]
pub fn wupen(&self) -> WUPENR {
WUPENR::_from(((self.bits >> 18) & 0x01) != 0)
}
#[doc = "Bit 19 - General call enable"]
#[inline(always)]
pub fn gcen(&self) -> GCENR {
GCENR::_from(((self.bits >> 19) & 0x01) != 0)
}
#[doc = "Bit 20 - SMBus Host address enable Note: If the SMBus feature is not supported, this bit is reserved and forced by hardware to 0. Please refer to Section25.3: I2C implementation."]
#[inline(always)]
pub fn smbhen(&self) -> SMBHENR {
SMBHENR::_from(((self.bits >> 20) & 0x01) != 0)
}
#[doc = "Bit 21 - SMBus Device Default address enable Note: If the SMBus feature is not supported, this bit is reserved and forced by hardware to 0. Please refer to Section25.3: I2C implementation."]
#[inline(always)]
pub fn smbden(&self) -> SMBDENR {
SMBDENR::_from(((self.bits >> 21) & 0x01) != 0)
}
#[doc = "Bit 22 - SMBus alert enable Device mode (SMBHEN=0): Host mode (SMBHEN=1): Note: When ALERTEN=0, the SMBA pin can be used as a standard GPIO. If the SMBus feature is not supported, this bit is reserved and forced by hardware to 0. Please refer to Section25.3: I2C implementation."]
#[inline(always)]
pub fn alerten(&self) -> ALERTENR {
ALERTENR::_from(((self.bits >> 22) & 0x01) != 0)
}
#[doc = "Bit 23 - PEC enable Note: If the SMBus feature is not supported, this bit is reserved and forced by hardware to 0. Please refer to Section25.3: I2C implementation."]
#[inline(always)]
pub fn pecen(&self) -> PECENR {
PECENR::_from(((self.bits >> 23) & 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 0 - Peripheral enable Note: When PE=0, the I2C SCL and SDA lines are released. Internal state machines and status bits are put back to their reset value. When cleared, PE must be kept low for at least 3 APB clock cycles."]
#[inline(always)]
pub fn pe(&mut self) -> _PEW {
_PEW { w: self }
}
#[doc = "Bit 1 - TX Interrupt enable"]
#[inline(always)]
pub fn txie(&mut self) -> _TXIEW {
_TXIEW { w: self }
}
#[doc = "Bit 2 - RX Interrupt enable"]
#[inline(always)]
pub fn rxie(&mut self) -> _RXIEW {
_RXIEW { w: self }
}
#[doc = "Bit 3 - Address match Interrupt enable (slave only)"]
#[inline(always)]
pub fn addrie(&mut self) -> _ADDRIEW {
_ADDRIEW { w: self }
}
#[doc = "Bit 4 - Not acknowledge received Interrupt enable"]
#[inline(always)]
pub fn nackie(&mut self) -> _NACKIEW {
_NACKIEW { w: self }
}
#[doc = "Bit 5 - STOP detection Interrupt enable"]
#[inline(always)]
pub fn stopie(&mut self) -> _STOPIEW {
_STOPIEW { w: self }
}
#[doc = "Bit 6 - Transfer Complete interrupt enable Note: Any of these events will generate an interrupt: Transfer Complete (TC) Transfer Complete Reload (TCR)"]
#[inline(always)]
pub fn tcie(&mut self) -> _TCIEW {
_TCIEW { w: self }
}
#[doc = "Bit 7 - Error interrupts enable Note: Any of these errors generate an interrupt: Arbitration Loss (ARLO) Bus Error detection (BERR) Overrun/Underrun (OVR) Timeout detection (TIMEOUT) PEC error detection (PECERR) Alert pin event detection (ALERT)"]
#[inline(always)]
pub fn errie(&mut self) -> _ERRIEW {
_ERRIEW { w: self }
}
#[doc = "Bits 8:11 - Digital noise filter These bits are used to configure the digital noise filter on SDA and SCL input. The digital filter will filter spikes with a length of up to DNF\\[3:0\\] * tI2CCLK ... Note: If the analog filter is also enabled, the digital filter is added to the analog filter. This filter can only be programmed when the I2C is disabled (PE = 0)."]
#[inline(always)]
pub fn dnf(&mut self) -> _DNFW {
_DNFW { w: self }
}
#[doc = "Bit 12 - Analog noise filter OFF Note: This bit can only be programmed when the I2C is disabled (PE = 0)."]
#[inline(always)]
pub fn anfoff(&mut self) -> _ANFOFFW {
_ANFOFFW { w: self }
}
#[doc = "Bit 14 - DMA transmission requests enable"]
#[inline(always)]
pub fn txdmaen(&mut self) -> _TXDMAENW {
_TXDMAENW { w: self }
}
#[doc = "Bit 15 - DMA reception requests enable"]
#[inline(always)]
pub fn rxdmaen(&mut self) -> _RXDMAENW {
_RXDMAENW { w: self }
}
#[doc = "Bit 16 - Slave byte control This bit is used to enable hardware byte control in slave mode."]
#[inline(always)]
pub fn sbc(&mut self) -> _SBCW {
_SBCW { w: self }
}
#[doc = "Bit 17 - Clock stretching disable This bit is used to disable clock stretching in slave mode. It must be kept cleared in master mode. Note: This bit can only be programmed when the I2C is disabled (PE = 0)."]
#[inline(always)]
pub fn nostretch(&mut self) -> _NOSTRETCHW {
_NOSTRETCHW { w: self }
}
#[doc = "Bit 18 - Wakeup from Stop mode enable Note: If the Wakeup from Stop mode feature is not supported, this bit is reserved and forced by hardware to 0. Please refer to Section25.3: I2C implementation. Note: WUPEN can be set only when DNF = 0000"]
#[inline(always)]
pub fn wupen(&mut self) -> _WUPENW {
_WUPENW { w: self }
}
#[doc = "Bit 19 - General call enable"]
#[inline(always)]
pub fn gcen(&mut self) -> _GCENW {
_GCENW { w: self }
}
#[doc = "Bit 20 - SMBus Host address enable Note: If the SMBus feature is not supported, this bit is reserved and forced by hardware to 0. Please refer to Section25.3: I2C implementation."]
#[inline(always)]
pub fn smbhen(&mut self) -> _SMBHENW {
_SMBHENW { w: self }
}
#[doc = "Bit 21 - SMBus Device Default address enable Note: If the SMBus feature is not supported, this bit is reserved and forced by hardware to 0. Please refer to Section25.3: I2C implementation."]
#[inline(always)]
pub fn smbden(&mut self) -> _SMBDENW {
_SMBDENW { w: self }
}
#[doc = "Bit 22 - SMBus alert enable Device mode (SMBHEN=0): Host mode (SMBHEN=1): Note: When ALERTEN=0, the SMBA pin can be used as a standard GPIO. If the SMBus feature is not supported, this bit is reserved and forced by hardware to 0. Please refer to Section25.3: I2C implementation."]
#[inline(always)]
pub fn alerten(&mut self) -> _ALERTENW {
_ALERTENW { w: self }
}
#[doc = "Bit 23 - PEC enable Note: If the SMBus feature is not supported, this bit is reserved and forced by hardware to 0. Please refer to Section25.3: I2C implementation."]
#[inline(always)]
pub fn pecen(&mut self) -> _PECENW {
_PECENW { w: self }
}
}