pub type R = crate::R<DTRrs>;
pub type W = crate::W<DTRrs>;
pub type DTR_R = crate::FieldReader<u16>;
pub type DTR_W<'a, REG> = crate::FieldWriter<'a, REG, 9, u16, crate::Safe>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SDTR {
Positive = 0,
Negative = 1,
}
impl From<SDTR> for bool {
#[inline(always)]
fn from(variant: SDTR) -> Self {
variant as u8 != 0
}
}
pub type SDTR_R = crate::BitReader<SDTR>;
impl SDTR_R {
#[inline(always)]
pub const fn variant(&self) -> SDTR {
match self.bits {
false => SDTR::Positive,
true => SDTR::Negative,
}
}
#[inline(always)]
pub fn is_positive(&self) -> bool {
*self == SDTR::Positive
}
#[inline(always)]
pub fn is_negative(&self) -> bool {
*self == SDTR::Negative
}
}
pub type SDTR_W<'a, REG> = crate::BitWriter<'a, REG, SDTR>;
impl<'a, REG> SDTR_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn positive(self) -> &'a mut crate::W<REG> {
self.variant(SDTR::Positive)
}
#[inline(always)]
pub fn negative(self) -> &'a mut crate::W<REG> {
self.variant(SDTR::Negative)
}
}
pub type DTPRSC_R = crate::FieldReader;
pub type DTPRSC_W<'a, REG> = crate::FieldWriter<'a, REG, 3, u8, crate::Safe>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DTRSLK {
Unlocked = 0,
Locked = 1,
}
impl From<DTRSLK> for bool {
#[inline(always)]
fn from(variant: DTRSLK) -> Self {
variant as u8 != 0
}
}
pub type DTRSLK_R = crate::BitReader<DTRSLK>;
impl DTRSLK_R {
#[inline(always)]
pub const fn variant(&self) -> DTRSLK {
match self.bits {
false => DTRSLK::Unlocked,
true => DTRSLK::Locked,
}
}
#[inline(always)]
pub fn is_unlocked(&self) -> bool {
*self == DTRSLK::Unlocked
}
#[inline(always)]
pub fn is_locked(&self) -> bool {
*self == DTRSLK::Locked
}
}
pub type DTRSLK_W<'a, REG> = crate::BitWriter<'a, REG, DTRSLK>;
impl<'a, REG> DTRSLK_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn unlocked(self) -> &'a mut crate::W<REG> {
self.variant(DTRSLK::Unlocked)
}
#[inline(always)]
pub fn locked(self) -> &'a mut crate::W<REG> {
self.variant(DTRSLK::Locked)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DTRLK {
Unlocked = 0,
Locked = 1,
}
impl From<DTRLK> for bool {
#[inline(always)]
fn from(variant: DTRLK) -> Self {
variant as u8 != 0
}
}
pub type DTRLK_R = crate::BitReader<DTRLK>;
impl DTRLK_R {
#[inline(always)]
pub const fn variant(&self) -> DTRLK {
match self.bits {
false => DTRLK::Unlocked,
true => DTRLK::Locked,
}
}
#[inline(always)]
pub fn is_unlocked(&self) -> bool {
*self == DTRLK::Unlocked
}
#[inline(always)]
pub fn is_locked(&self) -> bool {
*self == DTRLK::Locked
}
}
pub type DTRLK_W<'a, REG> = crate::BitWriter<'a, REG, DTRLK>;
impl<'a, REG> DTRLK_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn unlocked(self) -> &'a mut crate::W<REG> {
self.variant(DTRLK::Unlocked)
}
#[inline(always)]
pub fn locked(self) -> &'a mut crate::W<REG> {
self.variant(DTRLK::Locked)
}
}
pub type DTF_R = crate::FieldReader<u16>;
pub type DTF_W<'a, REG> = crate::FieldWriter<'a, REG, 9, u16, crate::Safe>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SDTF {
Positive = 0,
Negative = 1,
}
impl From<SDTF> for bool {
#[inline(always)]
fn from(variant: SDTF) -> Self {
variant as u8 != 0
}
}
pub type SDTF_R = crate::BitReader<SDTF>;
impl SDTF_R {
#[inline(always)]
pub const fn variant(&self) -> SDTF {
match self.bits {
false => SDTF::Positive,
true => SDTF::Negative,
}
}
#[inline(always)]
pub fn is_positive(&self) -> bool {
*self == SDTF::Positive
}
#[inline(always)]
pub fn is_negative(&self) -> bool {
*self == SDTF::Negative
}
}
pub type SDTF_W<'a, REG> = crate::BitWriter<'a, REG, SDTF>;
impl<'a, REG> SDTF_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn positive(self) -> &'a mut crate::W<REG> {
self.variant(SDTF::Positive)
}
#[inline(always)]
pub fn negative(self) -> &'a mut crate::W<REG> {
self.variant(SDTF::Negative)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DTFSLK {
Unlocked = 0,
Locked = 1,
}
impl From<DTFSLK> for bool {
#[inline(always)]
fn from(variant: DTFSLK) -> Self {
variant as u8 != 0
}
}
pub type DTFSLK_R = crate::BitReader<DTFSLK>;
impl DTFSLK_R {
#[inline(always)]
pub const fn variant(&self) -> DTFSLK {
match self.bits {
false => DTFSLK::Unlocked,
true => DTFSLK::Locked,
}
}
#[inline(always)]
pub fn is_unlocked(&self) -> bool {
*self == DTFSLK::Unlocked
}
#[inline(always)]
pub fn is_locked(&self) -> bool {
*self == DTFSLK::Locked
}
}
pub type DTFSLK_W<'a, REG> = crate::BitWriter<'a, REG, DTFSLK>;
impl<'a, REG> DTFSLK_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn unlocked(self) -> &'a mut crate::W<REG> {
self.variant(DTFSLK::Unlocked)
}
#[inline(always)]
pub fn locked(self) -> &'a mut crate::W<REG> {
self.variant(DTFSLK::Locked)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DTFLK {
Unlocked = 0,
Locked = 1,
}
impl From<DTFLK> for bool {
#[inline(always)]
fn from(variant: DTFLK) -> Self {
variant as u8 != 0
}
}
pub type DTFLK_R = crate::BitReader<DTFLK>;
impl DTFLK_R {
#[inline(always)]
pub const fn variant(&self) -> DTFLK {
match self.bits {
false => DTFLK::Unlocked,
true => DTFLK::Locked,
}
}
#[inline(always)]
pub fn is_unlocked(&self) -> bool {
*self == DTFLK::Unlocked
}
#[inline(always)]
pub fn is_locked(&self) -> bool {
*self == DTFLK::Locked
}
}
pub type DTFLK_W<'a, REG> = crate::BitWriter<'a, REG, DTFLK>;
impl<'a, REG> DTFLK_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn unlocked(self) -> &'a mut crate::W<REG> {
self.variant(DTFLK::Unlocked)
}
#[inline(always)]
pub fn locked(self) -> &'a mut crate::W<REG> {
self.variant(DTFLK::Locked)
}
}
impl R {
#[inline(always)]
pub fn dtr(&self) -> DTR_R {
DTR_R::new((self.bits & 0x01ff) as u16)
}
#[inline(always)]
pub fn sdtr(&self) -> SDTR_R {
SDTR_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn dtprsc(&self) -> DTPRSC_R {
DTPRSC_R::new(((self.bits >> 10) & 7) as u8)
}
#[inline(always)]
pub fn dtrslk(&self) -> DTRSLK_R {
DTRSLK_R::new(((self.bits >> 14) & 1) != 0)
}
#[inline(always)]
pub fn dtrlk(&self) -> DTRLK_R {
DTRLK_R::new(((self.bits >> 15) & 1) != 0)
}
#[inline(always)]
pub fn dtf(&self) -> DTF_R {
DTF_R::new(((self.bits >> 16) & 0x01ff) as u16)
}
#[inline(always)]
pub fn sdtf(&self) -> SDTF_R {
SDTF_R::new(((self.bits >> 25) & 1) != 0)
}
#[inline(always)]
pub fn dtfslk(&self) -> DTFSLK_R {
DTFSLK_R::new(((self.bits >> 30) & 1) != 0)
}
#[inline(always)]
pub fn dtflk(&self) -> DTFLK_R {
DTFLK_R::new(((self.bits >> 31) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("DTR")
.field("dtflk", &self.dtflk())
.field("dtfslk", &self.dtfslk())
.field("sdtf", &self.sdtf())
.field("dtf", &self.dtf())
.field("dtrlk", &self.dtrlk())
.field("dtrslk", &self.dtrslk())
.field("dtprsc", &self.dtprsc())
.field("sdtr", &self.sdtr())
.field("dtr", &self.dtr())
.finish()
}
}
impl W {
#[inline(always)]
pub fn dtr(&mut self) -> DTR_W<DTRrs> {
DTR_W::new(self, 0)
}
#[inline(always)]
pub fn sdtr(&mut self) -> SDTR_W<DTRrs> {
SDTR_W::new(self, 9)
}
#[inline(always)]
pub fn dtprsc(&mut self) -> DTPRSC_W<DTRrs> {
DTPRSC_W::new(self, 10)
}
#[inline(always)]
pub fn dtrslk(&mut self) -> DTRSLK_W<DTRrs> {
DTRSLK_W::new(self, 14)
}
#[inline(always)]
pub fn dtrlk(&mut self) -> DTRLK_W<DTRrs> {
DTRLK_W::new(self, 15)
}
#[inline(always)]
pub fn dtf(&mut self) -> DTF_W<DTRrs> {
DTF_W::new(self, 16)
}
#[inline(always)]
pub fn sdtf(&mut self) -> SDTF_W<DTRrs> {
SDTF_W::new(self, 25)
}
#[inline(always)]
pub fn dtfslk(&mut self) -> DTFSLK_W<DTRrs> {
DTFSLK_W::new(self, 30)
}
#[inline(always)]
pub fn dtflk(&mut self) -> DTFLK_W<DTRrs> {
DTFLK_W::new(self, 31)
}
}
pub struct DTRrs;
impl crate::RegisterSpec for DTRrs {
type Ux = u32;
}
impl crate::Readable for DTRrs {}
impl crate::Writable for DTRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for DTRrs {}