pub type R = crate::R<CFGR1rs>;
pub type W = crate::W<CFGR1rs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DMAEN {
Disabled = 0,
Enabled = 1,
}
impl From<DMAEN> for bool {
#[inline(always)]
fn from(variant: DMAEN) -> Self {
variant as u8 != 0
}
}
pub type DMAEN_R = crate::BitReader<DMAEN>;
impl DMAEN_R {
#[inline(always)]
pub const fn variant(&self) -> DMAEN {
match self.bits {
false => DMAEN::Disabled,
true => DMAEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == DMAEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == DMAEN::Enabled
}
}
pub type DMAEN_W<'a, REG> = crate::BitWriter<'a, REG, DMAEN>;
impl<'a, REG> DMAEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(DMAEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(DMAEN::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DMACFG {
OneShot = 0,
Circular = 1,
}
impl From<DMACFG> for bool {
#[inline(always)]
fn from(variant: DMACFG) -> Self {
variant as u8 != 0
}
}
pub type DMACFG_R = crate::BitReader<DMACFG>;
impl DMACFG_R {
#[inline(always)]
pub const fn variant(&self) -> DMACFG {
match self.bits {
false => DMACFG::OneShot,
true => DMACFG::Circular,
}
}
#[inline(always)]
pub fn is_one_shot(&self) -> bool {
*self == DMACFG::OneShot
}
#[inline(always)]
pub fn is_circular(&self) -> bool {
*self == DMACFG::Circular
}
}
pub type DMACFG_W<'a, REG> = crate::BitWriter<'a, REG, DMACFG>;
impl<'a, REG> DMACFG_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn one_shot(self) -> &'a mut crate::W<REG> {
self.variant(DMACFG::OneShot)
}
#[inline(always)]
pub fn circular(self) -> &'a mut crate::W<REG> {
self.variant(DMACFG::Circular)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SCANDIR {
Upward = 0,
Backward = 1,
}
impl From<SCANDIR> for bool {
#[inline(always)]
fn from(variant: SCANDIR) -> Self {
variant as u8 != 0
}
}
pub type SCANDIR_R = crate::BitReader<SCANDIR>;
impl SCANDIR_R {
#[inline(always)]
pub const fn variant(&self) -> SCANDIR {
match self.bits {
false => SCANDIR::Upward,
true => SCANDIR::Backward,
}
}
#[inline(always)]
pub fn is_upward(&self) -> bool {
*self == SCANDIR::Upward
}
#[inline(always)]
pub fn is_backward(&self) -> bool {
*self == SCANDIR::Backward
}
}
pub type SCANDIR_W<'a, REG> = crate::BitWriter<'a, REG, SCANDIR>;
impl<'a, REG> SCANDIR_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn upward(self) -> &'a mut crate::W<REG> {
self.variant(SCANDIR::Upward)
}
#[inline(always)]
pub fn backward(self) -> &'a mut crate::W<REG> {
self.variant(SCANDIR::Backward)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum RES {
TwelveBit = 0,
TenBit = 1,
EightBit = 2,
SixBit = 3,
}
impl From<RES> for u8 {
#[inline(always)]
fn from(variant: RES) -> Self {
variant as _
}
}
impl crate::FieldSpec for RES {
type Ux = u8;
}
impl crate::IsEnum for RES {}
pub type RES_R = crate::FieldReader<RES>;
impl RES_R {
#[inline(always)]
pub const fn variant(&self) -> RES {
match self.bits {
0 => RES::TwelveBit,
1 => RES::TenBit,
2 => RES::EightBit,
3 => RES::SixBit,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_twelve_bit(&self) -> bool {
*self == RES::TwelveBit
}
#[inline(always)]
pub fn is_ten_bit(&self) -> bool {
*self == RES::TenBit
}
#[inline(always)]
pub fn is_eight_bit(&self) -> bool {
*self == RES::EightBit
}
#[inline(always)]
pub fn is_six_bit(&self) -> bool {
*self == RES::SixBit
}
}
pub type RES_W<'a, REG> = crate::FieldWriter<'a, REG, 2, RES, crate::Safe>;
impl<'a, REG> RES_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn twelve_bit(self) -> &'a mut crate::W<REG> {
self.variant(RES::TwelveBit)
}
#[inline(always)]
pub fn ten_bit(self) -> &'a mut crate::W<REG> {
self.variant(RES::TenBit)
}
#[inline(always)]
pub fn eight_bit(self) -> &'a mut crate::W<REG> {
self.variant(RES::EightBit)
}
#[inline(always)]
pub fn six_bit(self) -> &'a mut crate::W<REG> {
self.variant(RES::SixBit)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ALIGN {
Right = 0,
Left = 1,
}
impl From<ALIGN> for bool {
#[inline(always)]
fn from(variant: ALIGN) -> Self {
variant as u8 != 0
}
}
pub type ALIGN_R = crate::BitReader<ALIGN>;
impl ALIGN_R {
#[inline(always)]
pub const fn variant(&self) -> ALIGN {
match self.bits {
false => ALIGN::Right,
true => ALIGN::Left,
}
}
#[inline(always)]
pub fn is_right(&self) -> bool {
*self == ALIGN::Right
}
#[inline(always)]
pub fn is_left(&self) -> bool {
*self == ALIGN::Left
}
}
pub type ALIGN_W<'a, REG> = crate::BitWriter<'a, REG, ALIGN>;
impl<'a, REG> ALIGN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn right(self) -> &'a mut crate::W<REG> {
self.variant(ALIGN::Right)
}
#[inline(always)]
pub fn left(self) -> &'a mut crate::W<REG> {
self.variant(ALIGN::Left)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum EXTSEL {
Tim6Trgo = 0,
Tim21Ch2 = 1,
Tim2Trgo = 2,
Tim2Ch4 = 3,
Tim22Trgo = 4,
Tim2Ch3 = 5,
Tim3Trgo = 6,
ExtiLine11 = 7,
}
impl From<EXTSEL> for u8 {
#[inline(always)]
fn from(variant: EXTSEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for EXTSEL {
type Ux = u8;
}
impl crate::IsEnum for EXTSEL {}
pub type EXTSEL_R = crate::FieldReader<EXTSEL>;
impl EXTSEL_R {
#[inline(always)]
pub const fn variant(&self) -> EXTSEL {
match self.bits {
0 => EXTSEL::Tim6Trgo,
1 => EXTSEL::Tim21Ch2,
2 => EXTSEL::Tim2Trgo,
3 => EXTSEL::Tim2Ch4,
4 => EXTSEL::Tim22Trgo,
5 => EXTSEL::Tim2Ch3,
6 => EXTSEL::Tim3Trgo,
7 => EXTSEL::ExtiLine11,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_tim6_trgo(&self) -> bool {
*self == EXTSEL::Tim6Trgo
}
#[inline(always)]
pub fn is_tim21_ch2(&self) -> bool {
*self == EXTSEL::Tim21Ch2
}
#[inline(always)]
pub fn is_tim2_trgo(&self) -> bool {
*self == EXTSEL::Tim2Trgo
}
#[inline(always)]
pub fn is_tim2_ch4(&self) -> bool {
*self == EXTSEL::Tim2Ch4
}
#[inline(always)]
pub fn is_tim22_trgo(&self) -> bool {
*self == EXTSEL::Tim22Trgo
}
#[inline(always)]
pub fn is_tim2_ch3(&self) -> bool {
*self == EXTSEL::Tim2Ch3
}
#[inline(always)]
pub fn is_tim3_trgo(&self) -> bool {
*self == EXTSEL::Tim3Trgo
}
#[inline(always)]
pub fn is_exti_line11(&self) -> bool {
*self == EXTSEL::ExtiLine11
}
}
pub type EXTSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 3, EXTSEL, crate::Safe>;
impl<'a, REG> EXTSEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn tim6_trgo(self) -> &'a mut crate::W<REG> {
self.variant(EXTSEL::Tim6Trgo)
}
#[inline(always)]
pub fn tim21_ch2(self) -> &'a mut crate::W<REG> {
self.variant(EXTSEL::Tim21Ch2)
}
#[inline(always)]
pub fn tim2_trgo(self) -> &'a mut crate::W<REG> {
self.variant(EXTSEL::Tim2Trgo)
}
#[inline(always)]
pub fn tim2_ch4(self) -> &'a mut crate::W<REG> {
self.variant(EXTSEL::Tim2Ch4)
}
#[inline(always)]
pub fn tim22_trgo(self) -> &'a mut crate::W<REG> {
self.variant(EXTSEL::Tim22Trgo)
}
#[inline(always)]
pub fn tim2_ch3(self) -> &'a mut crate::W<REG> {
self.variant(EXTSEL::Tim2Ch3)
}
#[inline(always)]
pub fn tim3_trgo(self) -> &'a mut crate::W<REG> {
self.variant(EXTSEL::Tim3Trgo)
}
#[inline(always)]
pub fn exti_line11(self) -> &'a mut crate::W<REG> {
self.variant(EXTSEL::ExtiLine11)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum EXTEN {
Disabled = 0,
RisingEdge = 1,
FallingEdge = 2,
BothEdges = 3,
}
impl From<EXTEN> for u8 {
#[inline(always)]
fn from(variant: EXTEN) -> Self {
variant as _
}
}
impl crate::FieldSpec for EXTEN {
type Ux = u8;
}
impl crate::IsEnum for EXTEN {}
pub type EXTEN_R = crate::FieldReader<EXTEN>;
impl EXTEN_R {
#[inline(always)]
pub const fn variant(&self) -> EXTEN {
match self.bits {
0 => EXTEN::Disabled,
1 => EXTEN::RisingEdge,
2 => EXTEN::FallingEdge,
3 => EXTEN::BothEdges,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == EXTEN::Disabled
}
#[inline(always)]
pub fn is_rising_edge(&self) -> bool {
*self == EXTEN::RisingEdge
}
#[inline(always)]
pub fn is_falling_edge(&self) -> bool {
*self == EXTEN::FallingEdge
}
#[inline(always)]
pub fn is_both_edges(&self) -> bool {
*self == EXTEN::BothEdges
}
}
pub type EXTEN_W<'a, REG> = crate::FieldWriter<'a, REG, 2, EXTEN, crate::Safe>;
impl<'a, REG> EXTEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(EXTEN::Disabled)
}
#[inline(always)]
pub fn rising_edge(self) -> &'a mut crate::W<REG> {
self.variant(EXTEN::RisingEdge)
}
#[inline(always)]
pub fn falling_edge(self) -> &'a mut crate::W<REG> {
self.variant(EXTEN::FallingEdge)
}
#[inline(always)]
pub fn both_edges(self) -> &'a mut crate::W<REG> {
self.variant(EXTEN::BothEdges)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum OVRMOD {
Preserve = 0,
Overwrite = 1,
}
impl From<OVRMOD> for bool {
#[inline(always)]
fn from(variant: OVRMOD) -> Self {
variant as u8 != 0
}
}
pub type OVRMOD_R = crate::BitReader<OVRMOD>;
impl OVRMOD_R {
#[inline(always)]
pub const fn variant(&self) -> OVRMOD {
match self.bits {
false => OVRMOD::Preserve,
true => OVRMOD::Overwrite,
}
}
#[inline(always)]
pub fn is_preserve(&self) -> bool {
*self == OVRMOD::Preserve
}
#[inline(always)]
pub fn is_overwrite(&self) -> bool {
*self == OVRMOD::Overwrite
}
}
pub type OVRMOD_W<'a, REG> = crate::BitWriter<'a, REG, OVRMOD>;
impl<'a, REG> OVRMOD_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn preserve(self) -> &'a mut crate::W<REG> {
self.variant(OVRMOD::Preserve)
}
#[inline(always)]
pub fn overwrite(self) -> &'a mut crate::W<REG> {
self.variant(OVRMOD::Overwrite)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CONT {
Single = 0,
Continuous = 1,
}
impl From<CONT> for bool {
#[inline(always)]
fn from(variant: CONT) -> Self {
variant as u8 != 0
}
}
pub type CONT_R = crate::BitReader<CONT>;
impl CONT_R {
#[inline(always)]
pub const fn variant(&self) -> CONT {
match self.bits {
false => CONT::Single,
true => CONT::Continuous,
}
}
#[inline(always)]
pub fn is_single(&self) -> bool {
*self == CONT::Single
}
#[inline(always)]
pub fn is_continuous(&self) -> bool {
*self == CONT::Continuous
}
}
pub type CONT_W<'a, REG> = crate::BitWriter<'a, REG, CONT>;
impl<'a, REG> CONT_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn single(self) -> &'a mut crate::W<REG> {
self.variant(CONT::Single)
}
#[inline(always)]
pub fn continuous(self) -> &'a mut crate::W<REG> {
self.variant(CONT::Continuous)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum WAIT {
Disabled = 0,
Enabled = 1,
}
impl From<WAIT> for bool {
#[inline(always)]
fn from(variant: WAIT) -> Self {
variant as u8 != 0
}
}
pub type WAIT_R = crate::BitReader<WAIT>;
impl WAIT_R {
#[inline(always)]
pub const fn variant(&self) -> WAIT {
match self.bits {
false => WAIT::Disabled,
true => WAIT::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == WAIT::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == WAIT::Enabled
}
}
pub type WAIT_W<'a, REG> = crate::BitWriter<'a, REG, WAIT>;
impl<'a, REG> WAIT_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(WAIT::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(WAIT::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum AUTOFF {
Disabled = 0,
Enabled = 1,
}
impl From<AUTOFF> for bool {
#[inline(always)]
fn from(variant: AUTOFF) -> Self {
variant as u8 != 0
}
}
pub type AUTOFF_R = crate::BitReader<AUTOFF>;
impl AUTOFF_R {
#[inline(always)]
pub const fn variant(&self) -> AUTOFF {
match self.bits {
false => AUTOFF::Disabled,
true => AUTOFF::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == AUTOFF::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == AUTOFF::Enabled
}
}
pub type AUTOFF_W<'a, REG> = crate::BitWriter<'a, REG, AUTOFF>;
impl<'a, REG> AUTOFF_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(AUTOFF::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(AUTOFF::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DISCEN {
Disabled = 0,
Enabled = 1,
}
impl From<DISCEN> for bool {
#[inline(always)]
fn from(variant: DISCEN) -> Self {
variant as u8 != 0
}
}
pub type DISCEN_R = crate::BitReader<DISCEN>;
impl DISCEN_R {
#[inline(always)]
pub const fn variant(&self) -> DISCEN {
match self.bits {
false => DISCEN::Disabled,
true => DISCEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == DISCEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == DISCEN::Enabled
}
}
pub type DISCEN_W<'a, REG> = crate::BitWriter<'a, REG, DISCEN>;
impl<'a, REG> DISCEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(DISCEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(DISCEN::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum AWDSGL {
AllChannels = 0,
SingleChannel = 1,
}
impl From<AWDSGL> for bool {
#[inline(always)]
fn from(variant: AWDSGL) -> Self {
variant as u8 != 0
}
}
pub type AWDSGL_R = crate::BitReader<AWDSGL>;
impl AWDSGL_R {
#[inline(always)]
pub const fn variant(&self) -> AWDSGL {
match self.bits {
false => AWDSGL::AllChannels,
true => AWDSGL::SingleChannel,
}
}
#[inline(always)]
pub fn is_all_channels(&self) -> bool {
*self == AWDSGL::AllChannels
}
#[inline(always)]
pub fn is_single_channel(&self) -> bool {
*self == AWDSGL::SingleChannel
}
}
pub type AWDSGL_W<'a, REG> = crate::BitWriter<'a, REG, AWDSGL>;
impl<'a, REG> AWDSGL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn all_channels(self) -> &'a mut crate::W<REG> {
self.variant(AWDSGL::AllChannels)
}
#[inline(always)]
pub fn single_channel(self) -> &'a mut crate::W<REG> {
self.variant(AWDSGL::SingleChannel)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum AWDEN {
Disabled = 0,
Enabled = 1,
}
impl From<AWDEN> for bool {
#[inline(always)]
fn from(variant: AWDEN) -> Self {
variant as u8 != 0
}
}
pub type AWDEN_R = crate::BitReader<AWDEN>;
impl AWDEN_R {
#[inline(always)]
pub const fn variant(&self) -> AWDEN {
match self.bits {
false => AWDEN::Disabled,
true => AWDEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == AWDEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == AWDEN::Enabled
}
}
pub type AWDEN_W<'a, REG> = crate::BitWriter<'a, REG, AWDEN>;
impl<'a, REG> AWDEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(AWDEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(AWDEN::Enabled)
}
}
pub type AWDCH_R = crate::FieldReader;
pub type AWDCH_W<'a, REG> = crate::FieldWriter<'a, REG, 5>;
impl R {
#[inline(always)]
pub fn dmaen(&self) -> DMAEN_R {
DMAEN_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn dmacfg(&self) -> DMACFG_R {
DMACFG_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn scandir(&self) -> SCANDIR_R {
SCANDIR_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn res(&self) -> RES_R {
RES_R::new(((self.bits >> 3) & 3) as u8)
}
#[inline(always)]
pub fn align(&self) -> ALIGN_R {
ALIGN_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn extsel(&self) -> EXTSEL_R {
EXTSEL_R::new(((self.bits >> 6) & 7) as u8)
}
#[inline(always)]
pub fn exten(&self) -> EXTEN_R {
EXTEN_R::new(((self.bits >> 10) & 3) as u8)
}
#[inline(always)]
pub fn ovrmod(&self) -> OVRMOD_R {
OVRMOD_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn cont(&self) -> CONT_R {
CONT_R::new(((self.bits >> 13) & 1) != 0)
}
#[inline(always)]
pub fn wait(&self) -> WAIT_R {
WAIT_R::new(((self.bits >> 14) & 1) != 0)
}
#[inline(always)]
pub fn autoff(&self) -> AUTOFF_R {
AUTOFF_R::new(((self.bits >> 15) & 1) != 0)
}
#[inline(always)]
pub fn discen(&self) -> DISCEN_R {
DISCEN_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn awdsgl(&self) -> AWDSGL_R {
AWDSGL_R::new(((self.bits >> 22) & 1) != 0)
}
#[inline(always)]
pub fn awden(&self) -> AWDEN_R {
AWDEN_R::new(((self.bits >> 23) & 1) != 0)
}
#[inline(always)]
pub fn awdch(&self) -> AWDCH_R {
AWDCH_R::new(((self.bits >> 26) & 0x1f) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CFGR1")
.field("awdch", &self.awdch())
.field("awden", &self.awden())
.field("awdsgl", &self.awdsgl())
.field("discen", &self.discen())
.field("autoff", &self.autoff())
.field("wait", &self.wait())
.field("cont", &self.cont())
.field("ovrmod", &self.ovrmod())
.field("exten", &self.exten())
.field("extsel", &self.extsel())
.field("align", &self.align())
.field("res", &self.res())
.field("scandir", &self.scandir())
.field("dmacfg", &self.dmacfg())
.field("dmaen", &self.dmaen())
.finish()
}
}
impl W {
#[inline(always)]
pub fn dmaen(&mut self) -> DMAEN_W<CFGR1rs> {
DMAEN_W::new(self, 0)
}
#[inline(always)]
pub fn dmacfg(&mut self) -> DMACFG_W<CFGR1rs> {
DMACFG_W::new(self, 1)
}
#[inline(always)]
pub fn scandir(&mut self) -> SCANDIR_W<CFGR1rs> {
SCANDIR_W::new(self, 2)
}
#[inline(always)]
pub fn res(&mut self) -> RES_W<CFGR1rs> {
RES_W::new(self, 3)
}
#[inline(always)]
pub fn align(&mut self) -> ALIGN_W<CFGR1rs> {
ALIGN_W::new(self, 5)
}
#[inline(always)]
pub fn extsel(&mut self) -> EXTSEL_W<CFGR1rs> {
EXTSEL_W::new(self, 6)
}
#[inline(always)]
pub fn exten(&mut self) -> EXTEN_W<CFGR1rs> {
EXTEN_W::new(self, 10)
}
#[inline(always)]
pub fn ovrmod(&mut self) -> OVRMOD_W<CFGR1rs> {
OVRMOD_W::new(self, 12)
}
#[inline(always)]
pub fn cont(&mut self) -> CONT_W<CFGR1rs> {
CONT_W::new(self, 13)
}
#[inline(always)]
pub fn wait(&mut self) -> WAIT_W<CFGR1rs> {
WAIT_W::new(self, 14)
}
#[inline(always)]
pub fn autoff(&mut self) -> AUTOFF_W<CFGR1rs> {
AUTOFF_W::new(self, 15)
}
#[inline(always)]
pub fn discen(&mut self) -> DISCEN_W<CFGR1rs> {
DISCEN_W::new(self, 16)
}
#[inline(always)]
pub fn awdsgl(&mut self) -> AWDSGL_W<CFGR1rs> {
AWDSGL_W::new(self, 22)
}
#[inline(always)]
pub fn awden(&mut self) -> AWDEN_W<CFGR1rs> {
AWDEN_W::new(self, 23)
}
#[inline(always)]
pub fn awdch(&mut self) -> AWDCH_W<CFGR1rs> {
AWDCH_W::new(self, 26)
}
}
pub struct CFGR1rs;
impl crate::RegisterSpec for CFGR1rs {
type Ux = u32;
}
impl crate::Readable for CFGR1rs {}
impl crate::Writable for CFGR1rs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CFGR1rs {}