From e0f3adf82244851ab88eb5133641677c3ebe93f4 Mon Sep 17 00:00:00 2001
From: Per Lindgren <per.lindgren@ltu.se>
Date: Mon, 22 Feb 2021 20:45:21 +0100
Subject: [PATCH] test of i2c->spi wip7, split transactions work (cleanup)

---
 examples/rtt_rtic_i2c.rs | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/examples/rtt_rtic_i2c.rs b/examples/rtt_rtic_i2c.rs
index 23ec17f..8a0d6e9 100644
--- a/examples/rtt_rtic_i2c.rs
+++ b/examples/rtt_rtic_i2c.rs
@@ -69,7 +69,7 @@ const APP: () = {
         spi_emu.set_low().ok();
         let mut req = [0x00];
         spi_emu.transfer(&mut req).unwrap();
-        rprintln!("id resp {:02x?}", req);
+        rprintln!("id request {:02x?}", req);
 
         cortex_m::asm::delay(1_000);
         // the read part
@@ -79,7 +79,20 @@ const APP: () = {
 
         spi_emu.set_high().ok();
 
-        cortex_m::asm::delay(100_000);
+        rprintln!("try split transaction");
+        // the write part
+        spi_emu.set_low().ok();
+        let mut req = [0x01];
+        spi_emu.transfer(&mut req).unwrap();
+        rprintln!("version request {:02x?}", req);
+
+        cortex_m::asm::delay(1_000);
+        // the read part
+        let mut req = [00];
+        spi_emu.transfer(&mut req).unwrap();
+        rprintln!("version resp {:02x?}", req);
+
+        spi_emu.set_high().ok();
     }
 
     #[idle]
-- 
GitLab