Get interrupts set up somehow

This commit is contained in:
Frederik Menke 2024-07-20 15:48:33 +02:00
parent 5ef267736b
commit 992ae640a6

View file

@ -12,14 +12,22 @@ use embassy_embedded_hal::SetConfig;
use embassy_executor::Spawner;
use embassy_rp::peripherals::{PIN_10, PIN_11, PIN_12, PIN_16, SPI1};
use embassy_rp::spi::Spi;
use embassy_rp::{bind_interrupts, interrupt};
use embassy_rp::{gpio, spi};
use embassy_time::{Duration, Timer};
use embedded_hal_bus::spi::ExclusiveDevice;
use embedded_sdmmc::sdcard::{DummyCsPin, SdCard};
use embedded_sdmmc::{Block, BlockDevice, BlockIdx, VolumeIdx};
use gpio::{Level, Output};
use {defmt_rtt as _, panic_probe as _};
use embassy_rp::i2c::{self, Config};
use embassy_time::{Duration, Timer};
use embedded_hal_async::i2c::I2c;
bind_interrupts!(struct Irqs {
I2C1_IRQ => i2c::InterruptHandler<embassy_rp::peripherals::I2C1>;
});
struct DummyTimesource();
impl embedded_sdmmc::TimeSource for DummyTimesource {
@ -40,9 +48,15 @@ async fn main(spawner: Spawner) {
embassy_rp::pac::SIO.spinlock(31).write_value(1);
let p = embassy_rp::init(Default::default());
spawner
.spawn(write_to_sd(p.SPI1, p.PIN_10, p.PIN_11, p.PIN_12, p.PIN_16))
.unwrap();
// spawner
// .spawn(write_to_sd(p.SPI1, p.PIN_10, p.PIN_11, p.PIN_12, p.PIN_16))
// .unwrap();
let sda = p.PIN_14;
let scl = p.PIN_15;
info!("set up i2c ");
let mut i2c = embassy_rp::i2c::I2c::new_async(p.I2C1, scl, sda, Irqs, Config::default());
debug!("TASK ENDED: Main")
}