match up with metapac change

This commit is contained in:
eZio Pan 2023-12-19 17:12:34 +08:00 committed by Dario Nieuwenhuis
parent 1df1f8e742
commit 81f7569a52
2 changed files with 18 additions and 29 deletions

View File

@ -303,20 +303,14 @@ impl<'a, C: Channel> Transfer<'a, C> {
ch.cr().write(|w| { ch.cr().write(|w| {
w.set_psize(data_size.into()); w.set_psize(data_size.into());
w.set_msize(data_size.into()); w.set_msize(data_size.into());
if incr_mem { w.set_minc(incr_mem);
w.set_minc(vals::Inc::ENABLED);
} else {
w.set_minc(vals::Inc::DISABLED);
}
w.set_dir(dir.into()); w.set_dir(dir.into());
w.set_teie(true); w.set_teie(true);
w.set_tcie(options.complete_transfer_ir); w.set_tcie(options.complete_transfer_ir);
w.set_htie(options.half_transfer_ir); w.set_htie(options.half_transfer_ir);
w.set_circ(options.circular);
if options.circular { if options.circular {
w.set_circ(vals::Circ::ENABLED);
debug!("Setting circular mode"); debug!("Setting circular mode");
} else {
w.set_circ(vals::Circ::DISABLED);
} }
w.set_pl(vals::Pl::VERYHIGH); w.set_pl(vals::Pl::VERYHIGH);
w.set_en(true); w.set_en(true);
@ -352,7 +346,7 @@ impl<'a, C: Channel> Transfer<'a, C> {
pub fn is_running(&mut self) -> bool { pub fn is_running(&mut self) -> bool {
let ch = self.channel.regs().ch(self.channel.num()); let ch = self.channel.regs().ch(self.channel.num());
let en = ch.cr().read().en(); let en = ch.cr().read().en();
let circular = ch.cr().read().circ() == vals::Circ::ENABLED; let circular = ch.cr().read().circ();
let tcif = STATE.complete_count[self.channel.index()].load(Ordering::Acquire) != 0; let tcif = STATE.complete_count[self.channel.index()].load(Ordering::Acquire) != 0;
en && (circular || !tcif) en && (circular || !tcif)
} }
@ -467,12 +461,12 @@ impl<'a, C: Channel, W: Word> ReadableRingBuffer<'a, C, W> {
let mut w = regs::Cr(0); let mut w = regs::Cr(0);
w.set_psize(data_size.into()); w.set_psize(data_size.into());
w.set_msize(data_size.into()); w.set_msize(data_size.into());
w.set_minc(vals::Inc::ENABLED); w.set_minc(true);
w.set_dir(dir.into()); w.set_dir(dir.into());
w.set_teie(true); w.set_teie(true);
w.set_htie(true); w.set_htie(true);
w.set_tcie(true); w.set_tcie(true);
w.set_circ(vals::Circ::ENABLED); w.set_circ(true);
w.set_pl(vals::Pl::VERYHIGH); w.set_pl(vals::Pl::VERYHIGH);
w.set_en(true); w.set_en(true);
@ -625,12 +619,12 @@ impl<'a, C: Channel, W: Word> WritableRingBuffer<'a, C, W> {
let mut w = regs::Cr(0); let mut w = regs::Cr(0);
w.set_psize(data_size.into()); w.set_psize(data_size.into());
w.set_msize(data_size.into()); w.set_msize(data_size.into());
w.set_minc(vals::Inc::ENABLED); w.set_minc(true);
w.set_dir(dir.into()); w.set_dir(dir.into());
w.set_teie(true); w.set_teie(true);
w.set_htie(true); w.set_htie(true);
w.set_tcie(true); w.set_tcie(true);
w.set_circ(vals::Circ::ENABLED); w.set_circ(true);
w.set_pl(vals::Pl::VERYHIGH); w.set_pl(vals::Pl::VERYHIGH);
w.set_en(true); w.set_en(true);

View File

@ -382,18 +382,13 @@ impl<'a, C: Channel> Transfer<'a, C> {
w.set_msize(data_size.into()); w.set_msize(data_size.into());
w.set_psize(data_size.into()); w.set_psize(data_size.into());
w.set_pl(vals::Pl::VERYHIGH); w.set_pl(vals::Pl::VERYHIGH);
w.set_minc(match incr_mem { w.set_minc(incr_mem);
true => vals::Inc::INCREMENTED, w.set_pinc(false);
false => vals::Inc::FIXED,
});
w.set_pinc(vals::Inc::FIXED);
w.set_teie(true); w.set_teie(true);
w.set_tcie(options.complete_transfer_ir); w.set_tcie(options.complete_transfer_ir);
w.set_circ(options.circular);
if options.circular { if options.circular {
w.set_circ(vals::Circ::ENABLED);
debug!("Setting circular mode"); debug!("Setting circular mode");
} else {
w.set_circ(vals::Circ::DISABLED);
} }
#[cfg(dma_v1)] #[cfg(dma_v1)]
w.set_trbuff(true); w.set_trbuff(true);
@ -545,8 +540,8 @@ impl<'a, C: Channel, W: Word> DoubleBuffered<'a, C, W> {
w.set_msize(data_size.into()); w.set_msize(data_size.into());
w.set_psize(data_size.into()); w.set_psize(data_size.into());
w.set_pl(vals::Pl::VERYHIGH); w.set_pl(vals::Pl::VERYHIGH);
w.set_minc(vals::Inc::INCREMENTED); w.set_minc(true);
w.set_pinc(vals::Inc::FIXED); w.set_pinc(false);
w.set_teie(true); w.set_teie(true);
w.set_tcie(true); w.set_tcie(true);
#[cfg(dma_v1)] #[cfg(dma_v1)]
@ -703,12 +698,12 @@ impl<'a, C: Channel, W: Word> ReadableRingBuffer<'a, C, W> {
w.set_msize(data_size.into()); w.set_msize(data_size.into());
w.set_psize(data_size.into()); w.set_psize(data_size.into());
w.set_pl(vals::Pl::VERYHIGH); w.set_pl(vals::Pl::VERYHIGH);
w.set_minc(vals::Inc::INCREMENTED); w.set_minc(true);
w.set_pinc(vals::Inc::FIXED); w.set_pinc(false);
w.set_teie(true); w.set_teie(true);
w.set_htie(options.half_transfer_ir); w.set_htie(options.half_transfer_ir);
w.set_tcie(true); w.set_tcie(true);
w.set_circ(vals::Circ::ENABLED); w.set_circ(true);
#[cfg(dma_v1)] #[cfg(dma_v1)]
w.set_trbuff(true); w.set_trbuff(true);
#[cfg(dma_v2)] #[cfg(dma_v2)]
@ -878,12 +873,12 @@ impl<'a, C: Channel, W: Word> WritableRingBuffer<'a, C, W> {
w.set_msize(data_size.into()); w.set_msize(data_size.into());
w.set_psize(data_size.into()); w.set_psize(data_size.into());
w.set_pl(vals::Pl::VERYHIGH); w.set_pl(vals::Pl::VERYHIGH);
w.set_minc(vals::Inc::INCREMENTED); w.set_minc(true);
w.set_pinc(vals::Inc::FIXED); w.set_pinc(false);
w.set_teie(true); w.set_teie(true);
w.set_htie(options.half_transfer_ir); w.set_htie(options.half_transfer_ir);
w.set_tcie(true); w.set_tcie(true);
w.set_circ(vals::Circ::ENABLED); w.set_circ(true);
#[cfg(dma_v1)] #[cfg(dma_v1)]
w.set_trbuff(true); w.set_trbuff(true);
#[cfg(dma_v2)] #[cfg(dma_v2)]