dac: use inifinite xfers

This commit is contained in:
Robert Jördens 2019-03-20 09:51:06 +00:00
parent 4f628c6a41
commit cbd9bcd302

View File

@ -349,9 +349,10 @@ fn main() -> ! {
.mssi().bits(0) // master SS idle .mssi().bits(0) // master SS idle
}); });
spi2.cr2.modify(|_, w| unsafe { spi2.cr2.modify(|_, w| unsafe {
w.tsize().bits(1) w.tsize().bits(0)
}); });
spi2.cr1.write(|w| w.spe().set_bit()); spi2.cr1.write(|w| w.spe().set_bit());
spi2.cr1.modify(|r, w| unsafe { w.bits(r.bits() | (1 << 9)) });
loop { loop {
#[cfg(feature = "bkpt")] #[cfg(feature = "bkpt")]
@ -373,10 +374,7 @@ fn main() -> ! {
let txdr = &spi2.txdr as *const _ as *mut u16; let txdr = &spi2.txdr as *const _ as *mut u16;
unsafe { ptr::write_volatile(txdr, d) }; unsafe { ptr::write_volatile(txdr, d) };
// at least one SCK between EOT and CSTART // at least one SCK between EOT and CSTART
spi2.cr1.modify(|r, w| unsafe { w.bits(r.bits() | (1 << 9)) });
while spi2.sr.read().txc().bit_is_clear() {} while spi2.sr.read().txc().bit_is_clear() {}
while spi2.sr.read().eot().bit_is_clear() {}
spi1.ifcr.write(|w| w.eotc().set_bit());
#[cfg(feature = "bkpt")] #[cfg(feature = "bkpt")]
cortex_m::asm::bkpt(); cortex_m::asm::bkpt();