Skip to content
Snippets Groups Projects
Commit a2c15195 authored by Per Lindgren's avatar Per Lindgren
Browse files

pmw3389 wip, firmare uplode not yet tested

parent a7c31800
Branches
No related tags found
No related merge requests found
...@@ -88,7 +88,9 @@ const APP: () = { ...@@ -88,7 +88,9 @@ const APP: () = {
// iprintln!(stim, "t1 {}", t1); // iprintln!(stim, "t1 {}", t1);
// iprintln!(stim, "t2 {}", t2); // iprintln!(stim, "t2 {}", t2);
let mut pmw3389 = pmw3389::Pmw3389::new(spi, cs, delay).unwrap(); let mut pmw3389 = pmw3389::Pmw3389::new(spi, cs, delay, &mut core.ITM).unwrap();
let stim = &mut core.ITM.stim[0];
let id = pmw3389.product_id().unwrap(); let id = pmw3389.product_id().unwrap();
iprintln!(stim, "id {}", id); iprintln!(stim, "id {}", id);
...@@ -301,7 +303,7 @@ mod pmw3389 { ...@@ -301,7 +303,7 @@ mod pmw3389 {
spi: SPI, spi: SPI,
cs: CS, cs: CS,
delay: DwtDelay, delay: DwtDelay,
mut itm: stm32f4::stm32f411::ITM, itm: &mut stm32f4::stm32f411::ITM,
) -> Result<Self, E> { ) -> Result<Self, E> {
let mut pmw3389 = Pmw3389 { spi, cs, delay }; let mut pmw3389 = Pmw3389 { spi, cs, delay };
...@@ -389,7 +391,7 @@ mod pmw3389 { ...@@ -389,7 +391,7 @@ mod pmw3389 {
} }
/// ///
pub fn upload_firmware(&mut self, mut itm: stm32f4::stm32f411::ITM) -> Result<(), E> { pub fn upload_firmware(&mut self, itm: &mut stm32f4::stm32f411::ITM) -> Result<(), E> {
let stim = &mut itm.stim[0]; let stim = &mut itm.stim[0];
// send the firmware to the chip, cf p.18 of the datasheet // send the firmware to the chip, cf p.18 of the datasheet
// Serial.println("Uploading firmware..."); // Serial.println("Uploading firmware...");
......
...@@ -3,7 +3,7 @@ MEMORY ...@@ -3,7 +3,7 @@ MEMORY
/* NOTE 1 K = 1 KiBi = 1024 bytes */ /* NOTE 1 K = 1 KiBi = 1024 bytes */
/* TODO Adjust these memory regions to match your device memory layout */ /* TODO Adjust these memory regions to match your device memory layout */
/* These values correspond to the STM32F411 */ /* These values correspond to the STM32F411 */
FLASH : ORIGIN = 0x08000000, LENGTH = 64K FLASH : ORIGIN = 0x08000000, LENGTH = 256K
RAM : ORIGIN = 0x20000000, LENGTH = 64K RAM : ORIGIN = 0x20000000, LENGTH = 64K
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment