diff options
author | Brian Cully <bjc@kublai.com> | 2022-10-25 15:15:59 -0400 |
---|---|---|
committer | Brian Cully <bjc@kublai.com> | 2022-10-25 15:15:59 -0400 |
commit | 6c356bf4782b60619216eaf6309787a0ddf49d2c (patch) | |
tree | 5b602098c009fd630a048cd3c658ea4ce65c34e4 /src/main.rs | |
parent | 7118a43e6fba016ac67fdecce44d0f4de5b36fd8 (diff) | |
download | luchie-6c356bf4782b60619216eaf6309787a0ddf49d2c.tar.gz luchie-6c356bf4782b60619216eaf6309787a0ddf49d2c.zip |
pull in cirque driver
seems broken rn, but it's a start.
Diffstat (limited to 'src/main.rs')
-rwxr-xr-x | src/main.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index d0dfe1a..ce5f346 100755 --- a/src/main.rs +++ b/src/main.rs @@ -3,9 +3,11 @@ //extern crate panic_semihosting; +mod cirque; mod led; mod log; +use cirque::Cirque; use led::LED; use cortex_m::{ @@ -82,7 +84,7 @@ fn main() -> ! { phase: Phase::CaptureOnSecondTransition, polarity: Polarity::IdleHigh, }; - let spi = Spi::spi1( + let mut spi = Spi::spi1( dp.SPI1, (sck_pin, miso_pin, mosi_pin), &mut afio.mapr, @@ -90,6 +92,7 @@ fn main() -> ! { 1.MHz(), clocks, ); + let mut cirque = Cirque::new(cs_pin, dr_pin, &mut spi, clocks).expect("couldn't init touch pad"); // BluePill board has a pull-up resistor on the D+ line. // Pull the D+ pin down to send a RESET condition to the USB bus. @@ -119,6 +122,12 @@ fn main() -> ! { loop { logln!("."); + + if let Ok(mut td) = cirque.poll(&mut spi) { + td.scale_to(1920, 1080); + logln!("td: {:?}", td); + } + if !usb_dev.poll(&mut [&mut serial]) { continue; } |