pub type R = crate::R<CRrs>;
pub type W = crate::W<CRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ADENR {
Disabled = 0,
Enabled = 1,
}
impl From<ADENR> for bool {
#[inline(always)]
fn from(variant: ADENR) -> Self {
variant as u8 != 0
}
}
pub type ADEN_R = crate::BitReader<ADENR>;
impl ADEN_R {
#[inline(always)]
pub const fn variant(&self) -> ADENR {
match self.bits {
false => ADENR::Disabled,
true => ADENR::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == ADENR::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == ADENR::Enabled
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ADENW {
Enabled = 1,
}
impl From<ADENW> for bool {
#[inline(always)]
fn from(variant: ADENW) -> Self {
variant as u8 != 0
}
}
pub type ADEN_W<'a, REG> = crate::BitWriter1S<'a, REG, ADENW>;
impl<'a, REG> ADEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(ADENW::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ADDISR {
NotDisabling = 0,
Disabling = 1,
}
impl From<ADDISR> for bool {
#[inline(always)]
fn from(variant: ADDISR) -> Self {
variant as u8 != 0
}
}
pub type ADDIS_R = crate::BitReader<ADDISR>;
impl ADDIS_R {
#[inline(always)]
pub const fn variant(&self) -> ADDISR {
match self.bits {
false => ADDISR::NotDisabling,
true => ADDISR::Disabling,
}
}
#[inline(always)]
pub fn is_not_disabling(&self) -> bool {
*self == ADDISR::NotDisabling
}
#[inline(always)]
pub fn is_disabling(&self) -> bool {
*self == ADDISR::Disabling
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ADDISW {
Disable = 1,
}
impl From<ADDISW> for bool {
#[inline(always)]
fn from(variant: ADDISW) -> Self {
variant as u8 != 0
}
}
pub type ADDIS_W<'a, REG> = crate::BitWriter1S<'a, REG, ADDISW>;
impl<'a, REG> ADDIS_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disable(self) -> &'a mut crate::W<REG> {
self.variant(ADDISW::Disable)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ADSTARTR {
NotActive = 0,
Active = 1,
}
impl From<ADSTARTR> for bool {
#[inline(always)]
fn from(variant: ADSTARTR) -> Self {
variant as u8 != 0
}
}
pub type ADSTART_R = crate::BitReader<ADSTARTR>;
impl ADSTART_R {
#[inline(always)]
pub const fn variant(&self) -> ADSTARTR {
match self.bits {
false => ADSTARTR::NotActive,
true => ADSTARTR::Active,
}
}
#[inline(always)]
pub fn is_not_active(&self) -> bool {
*self == ADSTARTR::NotActive
}
#[inline(always)]
pub fn is_active(&self) -> bool {
*self == ADSTARTR::Active
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ADSTARTW {
StartConversion = 1,
}
impl From<ADSTARTW> for bool {
#[inline(always)]
fn from(variant: ADSTARTW) -> Self {
variant as u8 != 0
}
}
pub type ADSTART_W<'a, REG> = crate::BitWriter1S<'a, REG, ADSTARTW>;
impl<'a, REG> ADSTART_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn start_conversion(self) -> &'a mut crate::W<REG> {
self.variant(ADSTARTW::StartConversion)
}
}
pub use ADSTART_R as JADSTART_R;
pub use ADSTART_W as JADSTART_W;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ADSTPR {
NotStopping = 0,
Stopping = 1,
}
impl From<ADSTPR> for bool {
#[inline(always)]
fn from(variant: ADSTPR) -> Self {
variant as u8 != 0
}
}
pub type ADSTP_R = crate::BitReader<ADSTPR>;
impl ADSTP_R {
#[inline(always)]
pub const fn variant(&self) -> ADSTPR {
match self.bits {
false => ADSTPR::NotStopping,
true => ADSTPR::Stopping,
}
}
#[inline(always)]
pub fn is_not_stopping(&self) -> bool {
*self == ADSTPR::NotStopping
}
#[inline(always)]
pub fn is_stopping(&self) -> bool {
*self == ADSTPR::Stopping
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ADSTPW {
StopConversion = 1,
}
impl From<ADSTPW> for bool {
#[inline(always)]
fn from(variant: ADSTPW) -> Self {
variant as u8 != 0
}
}
pub type ADSTP_W<'a, REG> = crate::BitWriter1S<'a, REG, ADSTPW>;
impl<'a, REG> ADSTP_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn stop_conversion(self) -> &'a mut crate::W<REG> {
self.variant(ADSTPW::StopConversion)
}
}
pub use ADSTP_R as JADSTP_R;
pub use ADSTP_W as JADSTP_W;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum BOOST {
Off = 0,
On = 1,
}
impl From<BOOST> for bool {
#[inline(always)]
fn from(variant: BOOST) -> Self {
variant as u8 != 0
}
}
pub type BOOST_R = crate::BitReader<BOOST>;
impl BOOST_R {
#[inline(always)]
pub const fn variant(&self) -> BOOST {
match self.bits {
false => BOOST::Off,
true => BOOST::On,
}
}
#[inline(always)]
pub fn is_off(&self) -> bool {
*self == BOOST::Off
}
#[inline(always)]
pub fn is_on(&self) -> bool {
*self == BOOST::On
}
}
pub type BOOST_W<'a, REG> = crate::BitWriter<'a, REG, BOOST>;
impl<'a, REG> BOOST_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn off(self) -> &'a mut crate::W<REG> {
self.variant(BOOST::Off)
}
#[inline(always)]
pub fn on(self) -> &'a mut crate::W<REG> {
self.variant(BOOST::On)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ADCALLIN {
NoLinearity = 0,
Linearity = 1,
}
impl From<ADCALLIN> for bool {
#[inline(always)]
fn from(variant: ADCALLIN) -> Self {
variant as u8 != 0
}
}
pub type ADCALLIN_R = crate::BitReader<ADCALLIN>;
impl ADCALLIN_R {
#[inline(always)]
pub const fn variant(&self) -> ADCALLIN {
match self.bits {
false => ADCALLIN::NoLinearity,
true => ADCALLIN::Linearity,
}
}
#[inline(always)]
pub fn is_no_linearity(&self) -> bool {
*self == ADCALLIN::NoLinearity
}
#[inline(always)]
pub fn is_linearity(&self) -> bool {
*self == ADCALLIN::Linearity
}
}
pub type ADCALLIN_W<'a, REG> = crate::BitWriter<'a, REG, ADCALLIN>;
impl<'a, REG> ADCALLIN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn no_linearity(self) -> &'a mut crate::W<REG> {
self.variant(ADCALLIN::NoLinearity)
}
#[inline(always)]
pub fn linearity(self) -> &'a mut crate::W<REG> {
self.variant(ADCALLIN::Linearity)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum LINCALRDYW1 {
Reset = 0,
Set = 1,
}
impl From<LINCALRDYW1> for bool {
#[inline(always)]
fn from(variant: LINCALRDYW1) -> Self {
variant as u8 != 0
}
}
pub type LINCALRDYW_R = crate::BitReader<LINCALRDYW1>;
impl LINCALRDYW_R {
#[inline(always)]
pub const fn variant(&self) -> LINCALRDYW1 {
match self.bits {
false => LINCALRDYW1::Reset,
true => LINCALRDYW1::Set,
}
}
#[inline(always)]
pub fn is_reset(&self) -> bool {
*self == LINCALRDYW1::Reset
}
#[inline(always)]
pub fn is_set(&self) -> bool {
*self == LINCALRDYW1::Set
}
}
pub type LINCALRDYW_W<'a, REG> = crate::BitWriter<'a, REG, LINCALRDYW1>;
impl<'a, REG> LINCALRDYW_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn reset(self) -> &'a mut crate::W<REG> {
self.variant(LINCALRDYW1::Reset)
}
#[inline(always)]
pub fn set_(self) -> &'a mut crate::W<REG> {
self.variant(LINCALRDYW1::Set)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ADVREGEN {
Disabled = 0,
Enabled = 1,
}
impl From<ADVREGEN> for bool {
#[inline(always)]
fn from(variant: ADVREGEN) -> Self {
variant as u8 != 0
}
}
pub type ADVREGEN_R = crate::BitReader<ADVREGEN>;
impl ADVREGEN_R {
#[inline(always)]
pub const fn variant(&self) -> ADVREGEN {
match self.bits {
false => ADVREGEN::Disabled,
true => ADVREGEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == ADVREGEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == ADVREGEN::Enabled
}
}
pub type ADVREGEN_W<'a, REG> = crate::BitWriter<'a, REG, ADVREGEN>;
impl<'a, REG> ADVREGEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(ADVREGEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(ADVREGEN::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DEEPPWD {
PowerUp = 0,
PowerDown = 1,
}
impl From<DEEPPWD> for bool {
#[inline(always)]
fn from(variant: DEEPPWD) -> Self {
variant as u8 != 0
}
}
pub type DEEPPWD_R = crate::BitReader<DEEPPWD>;
impl DEEPPWD_R {
#[inline(always)]
pub const fn variant(&self) -> DEEPPWD {
match self.bits {
false => DEEPPWD::PowerUp,
true => DEEPPWD::PowerDown,
}
}
#[inline(always)]
pub fn is_power_up(&self) -> bool {
*self == DEEPPWD::PowerUp
}
#[inline(always)]
pub fn is_power_down(&self) -> bool {
*self == DEEPPWD::PowerDown
}
}
pub type DEEPPWD_W<'a, REG> = crate::BitWriter<'a, REG, DEEPPWD>;
impl<'a, REG> DEEPPWD_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn power_up(self) -> &'a mut crate::W<REG> {
self.variant(DEEPPWD::PowerUp)
}
#[inline(always)]
pub fn power_down(self) -> &'a mut crate::W<REG> {
self.variant(DEEPPWD::PowerDown)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ADCALDIF {
SingleEnded = 0,
Differential = 1,
}
impl From<ADCALDIF> for bool {
#[inline(always)]
fn from(variant: ADCALDIF) -> Self {
variant as u8 != 0
}
}
pub type ADCALDIF_R = crate::BitReader<ADCALDIF>;
impl ADCALDIF_R {
#[inline(always)]
pub const fn variant(&self) -> ADCALDIF {
match self.bits {
false => ADCALDIF::SingleEnded,
true => ADCALDIF::Differential,
}
}
#[inline(always)]
pub fn is_single_ended(&self) -> bool {
*self == ADCALDIF::SingleEnded
}
#[inline(always)]
pub fn is_differential(&self) -> bool {
*self == ADCALDIF::Differential
}
}
pub type ADCALDIF_W<'a, REG> = crate::BitWriter<'a, REG, ADCALDIF>;
impl<'a, REG> ADCALDIF_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn single_ended(self) -> &'a mut crate::W<REG> {
self.variant(ADCALDIF::SingleEnded)
}
#[inline(always)]
pub fn differential(self) -> &'a mut crate::W<REG> {
self.variant(ADCALDIF::Differential)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ADCALR {
NotCalibrating = 0,
Calibrating = 1,
}
impl From<ADCALR> for bool {
#[inline(always)]
fn from(variant: ADCALR) -> Self {
variant as u8 != 0
}
}
pub type ADCAL_R = crate::BitReader<ADCALR>;
impl ADCAL_R {
#[inline(always)]
pub const fn variant(&self) -> ADCALR {
match self.bits {
false => ADCALR::NotCalibrating,
true => ADCALR::Calibrating,
}
}
#[inline(always)]
pub fn is_not_calibrating(&self) -> bool {
*self == ADCALR::NotCalibrating
}
#[inline(always)]
pub fn is_calibrating(&self) -> bool {
*self == ADCALR::Calibrating
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ADCALW {
StartCalibration = 1,
}
impl From<ADCALW> for bool {
#[inline(always)]
fn from(variant: ADCALW) -> Self {
variant as u8 != 0
}
}
pub type ADCAL_W<'a, REG> = crate::BitWriter1S<'a, REG, ADCALW>;
impl<'a, REG> ADCAL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn start_calibration(self) -> &'a mut crate::W<REG> {
self.variant(ADCALW::StartCalibration)
}
}
impl R {
#[inline(always)]
pub fn aden(&self) -> ADEN_R {
ADEN_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn addis(&self) -> ADDIS_R {
ADDIS_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn adstart(&self) -> ADSTART_R {
ADSTART_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn jadstart(&self) -> JADSTART_R {
JADSTART_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn adstp(&self) -> ADSTP_R {
ADSTP_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn jadstp(&self) -> JADSTP_R {
JADSTP_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn boost(&self) -> BOOST_R {
BOOST_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn adcallin(&self) -> ADCALLIN_R {
ADCALLIN_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn lincalrdyw(&self, n: u8) -> LINCALRDYW_R {
#[allow(clippy::no_effect)] [(); 6][n as usize];
LINCALRDYW_R::new(((self.bits >> (n + 22)) & 1) != 0)
}
#[inline(always)]
pub fn lincalrdyw_iter(&self) -> impl Iterator<Item = LINCALRDYW_R> + '_ {
(0..6).map(move |n| LINCALRDYW_R::new(((self.bits >> (n + 22)) & 1) != 0))
}
#[inline(always)]
pub fn lincalrdyw1(&self) -> LINCALRDYW_R {
LINCALRDYW_R::new(((self.bits >> 22) & 1) != 0)
}
#[inline(always)]
pub fn lincalrdyw2(&self) -> LINCALRDYW_R {
LINCALRDYW_R::new(((self.bits >> 23) & 1) != 0)
}
#[inline(always)]
pub fn lincalrdyw3(&self) -> LINCALRDYW_R {
LINCALRDYW_R::new(((self.bits >> 24) & 1) != 0)
}
#[inline(always)]
pub fn lincalrdyw4(&self) -> LINCALRDYW_R {
LINCALRDYW_R::new(((self.bits >> 25) & 1) != 0)
}
#[inline(always)]
pub fn lincalrdyw5(&self) -> LINCALRDYW_R {
LINCALRDYW_R::new(((self.bits >> 26) & 1) != 0)
}
#[inline(always)]
pub fn lincalrdyw6(&self) -> LINCALRDYW_R {
LINCALRDYW_R::new(((self.bits >> 27) & 1) != 0)
}
#[inline(always)]
pub fn advregen(&self) -> ADVREGEN_R {
ADVREGEN_R::new(((self.bits >> 28) & 1) != 0)
}
#[inline(always)]
pub fn deeppwd(&self) -> DEEPPWD_R {
DEEPPWD_R::new(((self.bits >> 29) & 1) != 0)
}
#[inline(always)]
pub fn adcaldif(&self) -> ADCALDIF_R {
ADCALDIF_R::new(((self.bits >> 30) & 1) != 0)
}
#[inline(always)]
pub fn adcal(&self) -> ADCAL_R {
ADCAL_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("CR")
.field("adcal", &self.adcal())
.field("adcaldif", &self.adcaldif())
.field("deeppwd", &self.deeppwd())
.field("advregen", &self.advregen())
.field("lincalrdyw1", &self.lincalrdyw1())
.field("lincalrdyw2", &self.lincalrdyw2())
.field("lincalrdyw3", &self.lincalrdyw3())
.field("lincalrdyw4", &self.lincalrdyw4())
.field("lincalrdyw5", &self.lincalrdyw5())
.field("lincalrdyw6", &self.lincalrdyw6())
.field("adcallin", &self.adcallin())
.field("boost", &self.boost())
.field("adstp", &self.adstp())
.field("jadstp", &self.jadstp())
.field("adstart", &self.adstart())
.field("jadstart", &self.jadstart())
.field("addis", &self.addis())
.field("aden", &self.aden())
.finish()
}
}
impl W {
#[inline(always)]
pub fn aden(&mut self) -> ADEN_W<CRrs> {
ADEN_W::new(self, 0)
}
#[inline(always)]
pub fn addis(&mut self) -> ADDIS_W<CRrs> {
ADDIS_W::new(self, 1)
}
#[inline(always)]
pub fn adstart(&mut self) -> ADSTART_W<CRrs> {
ADSTART_W::new(self, 2)
}
#[inline(always)]
pub fn jadstart(&mut self) -> JADSTART_W<CRrs> {
JADSTART_W::new(self, 3)
}
#[inline(always)]
pub fn adstp(&mut self) -> ADSTP_W<CRrs> {
ADSTP_W::new(self, 4)
}
#[inline(always)]
pub fn jadstp(&mut self) -> JADSTP_W<CRrs> {
JADSTP_W::new(self, 5)
}
#[inline(always)]
pub fn boost(&mut self) -> BOOST_W<CRrs> {
BOOST_W::new(self, 8)
}
#[inline(always)]
pub fn adcallin(&mut self) -> ADCALLIN_W<CRrs> {
ADCALLIN_W::new(self, 16)
}
#[inline(always)]
pub fn lincalrdyw(&mut self, n: u8) -> LINCALRDYW_W<CRrs> {
#[allow(clippy::no_effect)] [(); 6][n as usize];
LINCALRDYW_W::new(self, n + 22)
}
#[inline(always)]
pub fn lincalrdyw1(&mut self) -> LINCALRDYW_W<CRrs> {
LINCALRDYW_W::new(self, 22)
}
#[inline(always)]
pub fn lincalrdyw2(&mut self) -> LINCALRDYW_W<CRrs> {
LINCALRDYW_W::new(self, 23)
}
#[inline(always)]
pub fn lincalrdyw3(&mut self) -> LINCALRDYW_W<CRrs> {
LINCALRDYW_W::new(self, 24)
}
#[inline(always)]
pub fn lincalrdyw4(&mut self) -> LINCALRDYW_W<CRrs> {
LINCALRDYW_W::new(self, 25)
}
#[inline(always)]
pub fn lincalrdyw5(&mut self) -> LINCALRDYW_W<CRrs> {
LINCALRDYW_W::new(self, 26)
}
#[inline(always)]
pub fn lincalrdyw6(&mut self) -> LINCALRDYW_W<CRrs> {
LINCALRDYW_W::new(self, 27)
}
#[inline(always)]
pub fn advregen(&mut self) -> ADVREGEN_W<CRrs> {
ADVREGEN_W::new(self, 28)
}
#[inline(always)]
pub fn deeppwd(&mut self) -> DEEPPWD_W<CRrs> {
DEEPPWD_W::new(self, 29)
}
#[inline(always)]
pub fn adcaldif(&mut self) -> ADCALDIF_W<CRrs> {
ADCALDIF_W::new(self, 30)
}
#[inline(always)]
pub fn adcal(&mut self) -> ADCAL_W<CRrs> {
ADCAL_W::new(self, 31)
}
}
pub struct CRrs;
impl crate::RegisterSpec for CRrs {
type Ux = u32;
}
impl crate::Readable for CRrs {}
impl crate::Writable for CRrs {
type Safety = crate::Unsafe;
const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0x8000_003f;
}
impl crate::Resettable for CRrs {}