#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum RcmrCkg {
#[doc = "None"]
CONTINUOUS = 0x0,
#[doc = "Receive Clock enabled only if RF Low"]
EN_RF_LOW = 0x01,
#[doc = "Receive Clock enabled only if RF High"]
EN_RF_HIGH = 0x02,
_RESERVED_3 = 0x03,
}
impl RcmrCkg {
#[inline(always)]
pub const fn from_bits(val: u8) -> RcmrCkg {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for RcmrCkg {
#[inline(always)]
fn from(val: u8) -> RcmrCkg {
RcmrCkg::from_bits(val)
}
}
impl From<RcmrCkg> for u8 {
#[inline(always)]
fn from(val: RcmrCkg) -> u8 {
RcmrCkg::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum RcmrCko {
#[doc = "None, RK pin is an input"]
NONE = 0x0,
#[doc = "Continuous Receive Clock, RK pin is an output"]
CONTINUOUS = 0x01,
#[doc = "Receive Clock only during data transfers, RK pin is an output"]
TRANSFER = 0x02,
_RESERVED_3 = 0x03,
_RESERVED_4 = 0x04,
_RESERVED_5 = 0x05,
_RESERVED_6 = 0x06,
_RESERVED_7 = 0x07,
}
impl RcmrCko {
#[inline(always)]
pub const fn from_bits(val: u8) -> RcmrCko {
unsafe { core::mem::transmute(val & 0x07) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for RcmrCko {
#[inline(always)]
fn from(val: u8) -> RcmrCko {
RcmrCko::from_bits(val)
}
}
impl From<RcmrCko> for u8 {
#[inline(always)]
fn from(val: RcmrCko) -> u8 {
RcmrCko::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum RcmrCks {
#[doc = "Divided Clock"]
MCK = 0x0,
#[doc = "TK Clock signal"]
TK = 0x01,
#[doc = "RK pin"]
RK = 0x02,
_RESERVED_3 = 0x03,
}
impl RcmrCks {
#[inline(always)]
pub const fn from_bits(val: u8) -> RcmrCks {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for RcmrCks {
#[inline(always)]
fn from(val: u8) -> RcmrCks {
RcmrCks::from_bits(val)
}
}
impl From<RcmrCks> for u8 {
#[inline(always)]
fn from(val: RcmrCks) -> u8 {
RcmrCks::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum RcmrStart {
#[doc = "Continuous, as soon as the receiver is enabled, and immediately after the end of transfer of the previous data."]
CONTINUOUS = 0x0,
#[doc = "Transmit start"]
TRANSMIT = 0x01,
#[doc = "Detection of a low level on RF signal"]
RF_LOW = 0x02,
#[doc = "Detection of a high level on RF signal"]
RF_HIGH = 0x03,
#[doc = "Detection of a falling edge on RF signal"]
RF_FALLING = 0x04,
#[doc = "Detection of a rising edge on RF signal"]
RF_RISING = 0x05,
#[doc = "Detection of any level change on RF signal"]
RF_LEVEL = 0x06,
#[doc = "Detection of any edge on RF signal"]
RF_EDGE = 0x07,
#[doc = "Compare 0"]
CMP_0 = 0x08,
_RESERVED_9 = 0x09,
_RESERVED_a = 0x0a,
_RESERVED_b = 0x0b,
_RESERVED_c = 0x0c,
_RESERVED_d = 0x0d,
_RESERVED_e = 0x0e,
_RESERVED_f = 0x0f,
}
impl RcmrStart {
#[inline(always)]
pub const fn from_bits(val: u8) -> RcmrStart {
unsafe { core::mem::transmute(val & 0x0f) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for RcmrStart {
#[inline(always)]
fn from(val: u8) -> RcmrStart {
RcmrStart::from_bits(val)
}
}
impl From<RcmrStart> for u8 {
#[inline(always)]
fn from(val: RcmrStart) -> u8 {
RcmrStart::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum RfmrFsedge {
#[doc = "Positive Edge Detection"]
POSITIVE = 0x0,
#[doc = "Negative Edge Detection"]
NEGATIVE = 0x01,
}
impl RfmrFsedge {
#[inline(always)]
pub const fn from_bits(val: u8) -> RfmrFsedge {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for RfmrFsedge {
#[inline(always)]
fn from(val: u8) -> RfmrFsedge {
RfmrFsedge::from_bits(val)
}
}
impl From<RfmrFsedge> for u8 {
#[inline(always)]
fn from(val: RfmrFsedge) -> u8 {
RfmrFsedge::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum RfmrFsos {
#[doc = "None, RF pin is an input"]
NONE = 0x0,
#[doc = "Negative Pulse, RF pin is an output"]
NEGATIVE = 0x01,
#[doc = "Positive Pulse, RF pin is an output"]
POSITIVE = 0x02,
#[doc = "Driven Low during data transfer, RF pin is an output"]
LOW = 0x03,
#[doc = "Driven High during data transfer, RF pin is an output"]
HIGH = 0x04,
#[doc = "Toggling at each start of data transfer, RF pin is an output"]
TOGGLING = 0x05,
_RESERVED_6 = 0x06,
_RESERVED_7 = 0x07,
}
impl RfmrFsos {
#[inline(always)]
pub const fn from_bits(val: u8) -> RfmrFsos {
unsafe { core::mem::transmute(val & 0x07) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for RfmrFsos {
#[inline(always)]
fn from(val: u8) -> RfmrFsos {
RfmrFsos::from_bits(val)
}
}
impl From<RfmrFsos> for u8 {
#[inline(always)]
fn from(val: RfmrFsos) -> u8 {
RfmrFsos::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum TcmrCkg {
#[doc = "None"]
CONTINUOUS = 0x0,
#[doc = "Transmit Clock enabled only if TF Low"]
EN_TF_LOW = 0x01,
#[doc = "Transmit Clock enabled only if TF High"]
EN_TF_HIGH = 0x02,
_RESERVED_3 = 0x03,
}
impl TcmrCkg {
#[inline(always)]
pub const fn from_bits(val: u8) -> TcmrCkg {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for TcmrCkg {
#[inline(always)]
fn from(val: u8) -> TcmrCkg {
TcmrCkg::from_bits(val)
}
}
impl From<TcmrCkg> for u8 {
#[inline(always)]
fn from(val: TcmrCkg) -> u8 {
TcmrCkg::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum TcmrCko {
#[doc = "None, TK pin is an input"]
NONE = 0x0,
#[doc = "Continuous Transmit Clock, TK pin is an output"]
CONTINUOUS = 0x01,
#[doc = "Transmit Clock only during data transfers, TK pin is an output"]
TRANSFER = 0x02,
_RESERVED_3 = 0x03,
_RESERVED_4 = 0x04,
_RESERVED_5 = 0x05,
_RESERVED_6 = 0x06,
_RESERVED_7 = 0x07,
}
impl TcmrCko {
#[inline(always)]
pub const fn from_bits(val: u8) -> TcmrCko {
unsafe { core::mem::transmute(val & 0x07) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for TcmrCko {
#[inline(always)]
fn from(val: u8) -> TcmrCko {
TcmrCko::from_bits(val)
}
}
impl From<TcmrCko> for u8 {
#[inline(always)]
fn from(val: TcmrCko) -> u8 {
TcmrCko::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum TcmrCks {
#[doc = "Divided Clock"]
MCK = 0x0,
#[doc = "RK Clock signal"]
RK = 0x01,
#[doc = "TK pin"]
TK = 0x02,
_RESERVED_3 = 0x03,
}
impl TcmrCks {
#[inline(always)]
pub const fn from_bits(val: u8) -> TcmrCks {
unsafe { core::mem::transmute(val & 0x03) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for TcmrCks {
#[inline(always)]
fn from(val: u8) -> TcmrCks {
TcmrCks::from_bits(val)
}
}
impl From<TcmrCks> for u8 {
#[inline(always)]
fn from(val: TcmrCks) -> u8 {
TcmrCks::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum TcmrStart {
#[doc = "Continuous, as soon as a word is written in the SSC_THR Register (if Transmit is enabled), and immediately after the end of transfer of the previous data"]
CONTINUOUS = 0x0,
#[doc = "Receive start"]
RECEIVE = 0x01,
#[doc = "Detection of a low level on TF signal"]
TF_LOW = 0x02,
#[doc = "Detection of a high level on TF signal"]
TF_HIGH = 0x03,
#[doc = "Detection of a falling edge on TF signal"]
TF_FALLING = 0x04,
#[doc = "Detection of a rising edge on TF signal"]
TF_RISING = 0x05,
#[doc = "Detection of any level change on TF signal"]
TF_LEVEL = 0x06,
#[doc = "Detection of any edge on TF signal"]
TF_EDGE = 0x07,
_RESERVED_8 = 0x08,
_RESERVED_9 = 0x09,
_RESERVED_a = 0x0a,
_RESERVED_b = 0x0b,
_RESERVED_c = 0x0c,
_RESERVED_d = 0x0d,
_RESERVED_e = 0x0e,
_RESERVED_f = 0x0f,
}
impl TcmrStart {
#[inline(always)]
pub const fn from_bits(val: u8) -> TcmrStart {
unsafe { core::mem::transmute(val & 0x0f) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for TcmrStart {
#[inline(always)]
fn from(val: u8) -> TcmrStart {
TcmrStart::from_bits(val)
}
}
impl From<TcmrStart> for u8 {
#[inline(always)]
fn from(val: TcmrStart) -> u8 {
TcmrStart::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum TfmrFsedge {
#[doc = "Positive Edge Detection"]
POSITIVE = 0x0,
#[doc = "Negative Edge Detection"]
NEGATIVE = 0x01,
}
impl TfmrFsedge {
#[inline(always)]
pub const fn from_bits(val: u8) -> TfmrFsedge {
unsafe { core::mem::transmute(val & 0x01) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for TfmrFsedge {
#[inline(always)]
fn from(val: u8) -> TfmrFsedge {
TfmrFsedge::from_bits(val)
}
}
impl From<TfmrFsedge> for u8 {
#[inline(always)]
fn from(val: TfmrFsedge) -> u8 {
TfmrFsedge::to_bits(val)
}
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum TfmrFsos {
#[doc = "None, RF pin is an input"]
NONE = 0x0,
#[doc = "Negative Pulse, RF pin is an output"]
NEGATIVE = 0x01,
#[doc = "Positive Pulse, RF pin is an output"]
POSITIVE = 0x02,
#[doc = "Driven Low during data transfer"]
LOW = 0x03,
#[doc = "Driven High during data transfer"]
HIGH = 0x04,
#[doc = "Toggling at each start of data transfer"]
TOGGLING = 0x05,
_RESERVED_6 = 0x06,
_RESERVED_7 = 0x07,
}
impl TfmrFsos {
#[inline(always)]
pub const fn from_bits(val: u8) -> TfmrFsos {
unsafe { core::mem::transmute(val & 0x07) }
}
#[inline(always)]
pub const fn to_bits(self) -> u8 {
unsafe { core::mem::transmute(self) }
}
}
impl From<u8> for TfmrFsos {
#[inline(always)]
fn from(val: u8) -> TfmrFsos {
TfmrFsos::from_bits(val)
}
}
impl From<TfmrFsos> for u8 {
#[inline(always)]
fn from(val: TfmrFsos) -> u8 {
TfmrFsos::to_bits(val)
}
}
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
pub struct Wpkey(u32);
impl Wpkey {
#[doc = "Writing any other value in this field aborts the write operation of the WPEN bit.Always reads as 0."]
pub const PASSWD: Self = Self(0x0053_5343);
}
impl Wpkey {
pub const fn from_bits(val: u32) -> Wpkey {
Self(val & 0x00ff_ffff)
}
pub const fn to_bits(self) -> u32 {
self.0
}
}
impl core::fmt::Debug for Wpkey {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
match self.0 {
0x0053_5343 => f.write_str("PASSWD"),
other => core::write!(f, "0x{:02X}", other),
}
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Wpkey {
fn format(&self, f: defmt::Formatter) {
match self.0 {
0x0053_5343 => defmt::write!(f, "PASSWD"),
other => defmt::write!(f, "0x{:02X}", other),
}
}
}
impl From<u32> for Wpkey {
#[inline(always)]
fn from(val: u32) -> Wpkey {
Wpkey::from_bits(val)
}
}
impl From<Wpkey> for u32 {
#[inline(always)]
fn from(val: Wpkey) -> u32 {
Wpkey::to_bits(val)
}
}