pub type R = crate::R<CFGR2rs>;
pub type W = crate::W<CFGR2rs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FWDIS {
Enabled = 0,
Disabled = 1,
}
impl From<FWDIS> for bool {
#[inline(always)]
fn from(variant: FWDIS) -> Self {
variant as u8 != 0
}
}
pub type FWDIS_R = crate::BitReader<FWDIS>;
impl FWDIS_R {
#[inline(always)]
pub const fn variant(&self) -> FWDIS {
match self.bits {
false => FWDIS::Enabled,
true => FWDIS::Disabled,
}
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == FWDIS::Enabled
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == FWDIS::Disabled
}
}
pub type FWDIS_W<'a, REG> = crate::BitWriter<'a, REG, FWDIS>;
impl<'a, REG> FWDIS_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(FWDIS::Enabled)
}
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(FWDIS::Disabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum I2C_PB6_FMP {
Standard = 0,
Fmp = 1,
}
impl From<I2C_PB6_FMP> for bool {
#[inline(always)]
fn from(variant: I2C_PB6_FMP) -> Self {
variant as u8 != 0
}
}
pub type I2C_PB6_FMP_R = crate::BitReader<I2C_PB6_FMP>;
impl I2C_PB6_FMP_R {
#[inline(always)]
pub const fn variant(&self) -> I2C_PB6_FMP {
match self.bits {
false => I2C_PB6_FMP::Standard,
true => I2C_PB6_FMP::Fmp,
}
}
#[inline(always)]
pub fn is_standard(&self) -> bool {
*self == I2C_PB6_FMP::Standard
}
#[inline(always)]
pub fn is_fmp(&self) -> bool {
*self == I2C_PB6_FMP::Fmp
}
}
pub type I2C_PB6_FMP_W<'a, REG> = crate::BitWriter<'a, REG, I2C_PB6_FMP>;
impl<'a, REG> I2C_PB6_FMP_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn standard(self) -> &'a mut crate::W<REG> {
self.variant(I2C_PB6_FMP::Standard)
}
#[inline(always)]
pub fn fmp(self) -> &'a mut crate::W<REG> {
self.variant(I2C_PB6_FMP::Fmp)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum I2C_PB7_FMP {
Standard = 0,
Fmp = 1,
}
impl From<I2C_PB7_FMP> for bool {
#[inline(always)]
fn from(variant: I2C_PB7_FMP) -> Self {
variant as u8 != 0
}
}
pub type I2C_PB7_FMP_R = crate::BitReader<I2C_PB7_FMP>;
impl I2C_PB7_FMP_R {
#[inline(always)]
pub const fn variant(&self) -> I2C_PB7_FMP {
match self.bits {
false => I2C_PB7_FMP::Standard,
true => I2C_PB7_FMP::Fmp,
}
}
#[inline(always)]
pub fn is_standard(&self) -> bool {
*self == I2C_PB7_FMP::Standard
}
#[inline(always)]
pub fn is_fmp(&self) -> bool {
*self == I2C_PB7_FMP::Fmp
}
}
pub type I2C_PB7_FMP_W<'a, REG> = crate::BitWriter<'a, REG, I2C_PB7_FMP>;
impl<'a, REG> I2C_PB7_FMP_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn standard(self) -> &'a mut crate::W<REG> {
self.variant(I2C_PB7_FMP::Standard)
}
#[inline(always)]
pub fn fmp(self) -> &'a mut crate::W<REG> {
self.variant(I2C_PB7_FMP::Fmp)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum I2C_PB8_FMP {
Standard = 0,
Fmp = 1,
}
impl From<I2C_PB8_FMP> for bool {
#[inline(always)]
fn from(variant: I2C_PB8_FMP) -> Self {
variant as u8 != 0
}
}
pub type I2C_PB8_FMP_R = crate::BitReader<I2C_PB8_FMP>;
impl I2C_PB8_FMP_R {
#[inline(always)]
pub const fn variant(&self) -> I2C_PB8_FMP {
match self.bits {
false => I2C_PB8_FMP::Standard,
true => I2C_PB8_FMP::Fmp,
}
}
#[inline(always)]
pub fn is_standard(&self) -> bool {
*self == I2C_PB8_FMP::Standard
}
#[inline(always)]
pub fn is_fmp(&self) -> bool {
*self == I2C_PB8_FMP::Fmp
}
}
pub type I2C_PB8_FMP_W<'a, REG> = crate::BitWriter<'a, REG, I2C_PB8_FMP>;
impl<'a, REG> I2C_PB8_FMP_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn standard(self) -> &'a mut crate::W<REG> {
self.variant(I2C_PB8_FMP::Standard)
}
#[inline(always)]
pub fn fmp(self) -> &'a mut crate::W<REG> {
self.variant(I2C_PB8_FMP::Fmp)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum I2C_PB9_FMP {
Standard = 0,
Fmp = 1,
}
impl From<I2C_PB9_FMP> for bool {
#[inline(always)]
fn from(variant: I2C_PB9_FMP) -> Self {
variant as u8 != 0
}
}
pub type I2C_PB9_FMP_R = crate::BitReader<I2C_PB9_FMP>;
impl I2C_PB9_FMP_R {
#[inline(always)]
pub const fn variant(&self) -> I2C_PB9_FMP {
match self.bits {
false => I2C_PB9_FMP::Standard,
true => I2C_PB9_FMP::Fmp,
}
}
#[inline(always)]
pub fn is_standard(&self) -> bool {
*self == I2C_PB9_FMP::Standard
}
#[inline(always)]
pub fn is_fmp(&self) -> bool {
*self == I2C_PB9_FMP::Fmp
}
}
pub type I2C_PB9_FMP_W<'a, REG> = crate::BitWriter<'a, REG, I2C_PB9_FMP>;
impl<'a, REG> I2C_PB9_FMP_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn standard(self) -> &'a mut crate::W<REG> {
self.variant(I2C_PB9_FMP::Standard)
}
#[inline(always)]
pub fn fmp(self) -> &'a mut crate::W<REG> {
self.variant(I2C_PB9_FMP::Fmp)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum I2C1_FMP {
Standard = 0,
Fmp = 1,
}
impl From<I2C1_FMP> for bool {
#[inline(always)]
fn from(variant: I2C1_FMP) -> Self {
variant as u8 != 0
}
}
pub type I2C1_FMP_R = crate::BitReader<I2C1_FMP>;
impl I2C1_FMP_R {
#[inline(always)]
pub const fn variant(&self) -> I2C1_FMP {
match self.bits {
false => I2C1_FMP::Standard,
true => I2C1_FMP::Fmp,
}
}
#[inline(always)]
pub fn is_standard(&self) -> bool {
*self == I2C1_FMP::Standard
}
#[inline(always)]
pub fn is_fmp(&self) -> bool {
*self == I2C1_FMP::Fmp
}
}
pub type I2C1_FMP_W<'a, REG> = crate::BitWriter<'a, REG, I2C1_FMP>;
impl<'a, REG> I2C1_FMP_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn standard(self) -> &'a mut crate::W<REG> {
self.variant(I2C1_FMP::Standard)
}
#[inline(always)]
pub fn fmp(self) -> &'a mut crate::W<REG> {
self.variant(I2C1_FMP::Fmp)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum I2C2_FMP {
Standard = 0,
Fmp = 1,
}
impl From<I2C2_FMP> for bool {
#[inline(always)]
fn from(variant: I2C2_FMP) -> Self {
variant as u8 != 0
}
}
pub type I2C2_FMP_R = crate::BitReader<I2C2_FMP>;
impl I2C2_FMP_R {
#[inline(always)]
pub const fn variant(&self) -> I2C2_FMP {
match self.bits {
false => I2C2_FMP::Standard,
true => I2C2_FMP::Fmp,
}
}
#[inline(always)]
pub fn is_standard(&self) -> bool {
*self == I2C2_FMP::Standard
}
#[inline(always)]
pub fn is_fmp(&self) -> bool {
*self == I2C2_FMP::Fmp
}
}
pub type I2C2_FMP_W<'a, REG> = crate::BitWriter<'a, REG, I2C2_FMP>;
impl<'a, REG> I2C2_FMP_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn standard(self) -> &'a mut crate::W<REG> {
self.variant(I2C2_FMP::Standard)
}
#[inline(always)]
pub fn fmp(self) -> &'a mut crate::W<REG> {
self.variant(I2C2_FMP::Fmp)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum I2C3_FMP {
Standard = 0,
Fmp = 1,
}
impl From<I2C3_FMP> for bool {
#[inline(always)]
fn from(variant: I2C3_FMP) -> Self {
variant as u8 != 0
}
}
pub type I2C3_FMP_R = crate::BitReader<I2C3_FMP>;
impl I2C3_FMP_R {
#[inline(always)]
pub const fn variant(&self) -> I2C3_FMP {
match self.bits {
false => I2C3_FMP::Standard,
true => I2C3_FMP::Fmp,
}
}
#[inline(always)]
pub fn is_standard(&self) -> bool {
*self == I2C3_FMP::Standard
}
#[inline(always)]
pub fn is_fmp(&self) -> bool {
*self == I2C3_FMP::Fmp
}
}
pub type I2C3_FMP_W<'a, REG> = crate::BitWriter<'a, REG, I2C3_FMP>;
impl<'a, REG> I2C3_FMP_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn standard(self) -> &'a mut crate::W<REG> {
self.variant(I2C3_FMP::Standard)
}
#[inline(always)]
pub fn fmp(self) -> &'a mut crate::W<REG> {
self.variant(I2C3_FMP::Fmp)
}
}
impl R {
#[inline(always)]
pub fn fwdis(&self) -> FWDIS_R {
FWDIS_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn i2c_pb6_fmp(&self) -> I2C_PB6_FMP_R {
I2C_PB6_FMP_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn i2c_pb7_fmp(&self) -> I2C_PB7_FMP_R {
I2C_PB7_FMP_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn i2c_pb8_fmp(&self) -> I2C_PB8_FMP_R {
I2C_PB8_FMP_R::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn i2c_pb9_fmp(&self) -> I2C_PB9_FMP_R {
I2C_PB9_FMP_R::new(((self.bits >> 11) & 1) != 0)
}
#[inline(always)]
pub fn i2c1_fmp(&self) -> I2C1_FMP_R {
I2C1_FMP_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn i2c2_fmp(&self) -> I2C2_FMP_R {
I2C2_FMP_R::new(((self.bits >> 13) & 1) != 0)
}
#[inline(always)]
pub fn i2c3_fmp(&self) -> I2C3_FMP_R {
I2C3_FMP_R::new(((self.bits >> 14) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CFGR2")
.field("i2c2_fmp", &self.i2c2_fmp())
.field("i2c1_fmp", &self.i2c1_fmp())
.field("i2c_pb9_fmp", &self.i2c_pb9_fmp())
.field("i2c_pb8_fmp", &self.i2c_pb8_fmp())
.field("i2c_pb7_fmp", &self.i2c_pb7_fmp())
.field("i2c_pb6_fmp", &self.i2c_pb6_fmp())
.field("i2c3_fmp", &self.i2c3_fmp())
.field("fwdis", &self.fwdis())
.finish()
}
}
impl W {
#[inline(always)]
pub fn fwdis(&mut self) -> FWDIS_W<CFGR2rs> {
FWDIS_W::new(self, 0)
}
#[inline(always)]
pub fn i2c_pb6_fmp(&mut self) -> I2C_PB6_FMP_W<CFGR2rs> {
I2C_PB6_FMP_W::new(self, 8)
}
#[inline(always)]
pub fn i2c_pb7_fmp(&mut self) -> I2C_PB7_FMP_W<CFGR2rs> {
I2C_PB7_FMP_W::new(self, 9)
}
#[inline(always)]
pub fn i2c_pb8_fmp(&mut self) -> I2C_PB8_FMP_W<CFGR2rs> {
I2C_PB8_FMP_W::new(self, 10)
}
#[inline(always)]
pub fn i2c_pb9_fmp(&mut self) -> I2C_PB9_FMP_W<CFGR2rs> {
I2C_PB9_FMP_W::new(self, 11)
}
#[inline(always)]
pub fn i2c1_fmp(&mut self) -> I2C1_FMP_W<CFGR2rs> {
I2C1_FMP_W::new(self, 12)
}
#[inline(always)]
pub fn i2c2_fmp(&mut self) -> I2C2_FMP_W<CFGR2rs> {
I2C2_FMP_W::new(self, 13)
}
#[inline(always)]
pub fn i2c3_fmp(&mut self) -> I2C3_FMP_W<CFGR2rs> {
I2C3_FMP_W::new(self, 14)
}
}
pub struct CFGR2rs;
impl crate::RegisterSpec for CFGR2rs {
type Ux = u32;
}
impl crate::Readable for CFGR2rs {}
impl crate::Writable for CFGR2rs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CFGR2rs {}