cargo fix
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
use defmt::info;
|
|
||||||
use embassy_rp::{
|
use embassy_rp::{
|
||||||
gpio::{Level, Output},
|
gpio::{Level, Output},
|
||||||
peripherals::{PIN_13, PIN_14, PIN_15, SPI1},
|
peripherals::{PIN_13, PIN_14, PIN_15, SPI1},
|
||||||
@@ -7,26 +6,19 @@ use embassy_rp::{
|
|||||||
use embassy_time::{Delay, Timer};
|
use embassy_time::{Delay, Timer};
|
||||||
use embedded_graphics::{
|
use embedded_graphics::{
|
||||||
Drawable,
|
Drawable,
|
||||||
mono_font::{
|
mono_font::{MonoTextStyle, ascii::FONT_10X20},
|
||||||
MonoFont, MonoTextStyle,
|
|
||||||
ascii::{FONT_6X9, FONT_10X20},
|
|
||||||
},
|
|
||||||
pixelcolor::Rgb565,
|
pixelcolor::Rgb565,
|
||||||
prelude::{Point, RgbColor, WebColors},
|
prelude::{Point, RgbColor},
|
||||||
text::{Baseline, Text, TextStyle},
|
text::Text,
|
||||||
};
|
};
|
||||||
use embedded_hal_bus::spi::ExclusiveDevice;
|
use embedded_hal_bus::spi::ExclusiveDevice;
|
||||||
use st7365p_lcd::{FrameBuffer, ST7365P};
|
use st7365p_lcd::{FrameBuffer, ST7365P};
|
||||||
|
|
||||||
type SPI = Spi<'static, SPI1, Async>;
|
|
||||||
|
|
||||||
type FRAMEBUFFER = FrameBuffer<SCREEN_WIDTH, SCREEN_HEIGHT>;
|
|
||||||
|
|
||||||
const SCREEN_WIDTH: usize = 320;
|
const SCREEN_WIDTH: usize = 320;
|
||||||
const SCREEN_HEIGHT: usize = 320;
|
const SCREEN_HEIGHT: usize = 320;
|
||||||
|
|
||||||
#[embassy_executor::task]
|
#[embassy_executor::task]
|
||||||
pub async fn display_task(spi: SPI, cs: PIN_13, data: PIN_14, reset: PIN_15) {
|
pub async fn display_task(spi: Spi<'static, SPI1, Async>, cs: PIN_13, data: PIN_14, reset: PIN_15) {
|
||||||
let spi_device = ExclusiveDevice::new(spi, Output::new(cs, Level::Low), Delay).unwrap();
|
let spi_device = ExclusiveDevice::new(spi, Output::new(cs, Level::Low), Delay).unwrap();
|
||||||
let mut display = ST7365P::new(
|
let mut display = ST7365P::new(
|
||||||
spi_device,
|
spi_device,
|
||||||
@@ -38,7 +30,7 @@ pub async fn display_task(spi: SPI, cs: PIN_13, data: PIN_14, reset: PIN_15) {
|
|||||||
display.init(&mut Delay).await.unwrap();
|
display.init(&mut Delay).await.unwrap();
|
||||||
display.set_custom_orientation(0x60).await.unwrap();
|
display.set_custom_orientation(0x60).await.unwrap();
|
||||||
|
|
||||||
let mut framebuffer: FRAMEBUFFER = FrameBuffer::new();
|
let mut framebuffer: FrameBuffer<SCREEN_WIDTH, SCREEN_HEIGHT> = FrameBuffer::new();
|
||||||
|
|
||||||
Text::with_alignment(
|
Text::with_alignment(
|
||||||
"Hello!",
|
"Hello!",
|
||||||
|
|||||||
13
src/main.rs
13
src/main.rs
@@ -3,29 +3,18 @@
|
|||||||
#![no_std]
|
#![no_std]
|
||||||
#![no_main]
|
#![no_main]
|
||||||
|
|
||||||
#[cfg(feature = "defmt")]
|
|
||||||
use defmt::*;
|
|
||||||
use {defmt_rtt as _, panic_probe as _};
|
use {defmt_rtt as _, panic_probe as _};
|
||||||
|
|
||||||
use embassy_executor::Spawner;
|
use embassy_executor::Spawner;
|
||||||
use embassy_rp::peripherals::I2C1;
|
use embassy_rp::peripherals::I2C1;
|
||||||
use embassy_rp::spi::Spi;
|
|
||||||
use embassy_rp::{
|
use embassy_rp::{
|
||||||
bind_interrupts,
|
|
||||||
gpio::{Level, Output},
|
|
||||||
i2c,
|
i2c,
|
||||||
i2c::I2c,
|
i2c::I2c,
|
||||||
spi,
|
spi,
|
||||||
};
|
};
|
||||||
use embassy_sync::blocking_mutex::raw::NoopRawMutex;
|
|
||||||
use embassy_sync::channel::Channel;
|
|
||||||
use embassy_time::Timer;
|
|
||||||
use embedded_hal_bus::spi::ExclusiveDevice;
|
|
||||||
use embedded_sdmmc::asynchronous::{File, SdCard, ShortFileName, VolumeIdx, VolumeManager};
|
|
||||||
use static_cell::StaticCell;
|
|
||||||
|
|
||||||
mod peripherals;
|
mod peripherals;
|
||||||
use peripherals::{conf_peripherals, keyboard::KeyEvent};
|
use peripherals::conf_peripherals;
|
||||||
mod display;
|
mod display;
|
||||||
use display::display_task;
|
use display::display_task;
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,3 @@
|
|||||||
use defmt::{info, warn};
|
|
||||||
use embassy_rp::{
|
|
||||||
i2c::{Async, I2c},
|
|
||||||
peripherals::I2C1,
|
|
||||||
};
|
|
||||||
use embassy_sync::{
|
|
||||||
blocking_mutex::raw::{CriticalSectionRawMutex, NoopRawMutex},
|
|
||||||
channel::Sender,
|
|
||||||
};
|
|
||||||
|
|
||||||
use crate::peripherals::PERIPHERAL_BUS;
|
use crate::peripherals::PERIPHERAL_BUS;
|
||||||
|
|
||||||
|
|||||||
@@ -6,14 +6,13 @@ use embassy_rp::{
|
|||||||
peripherals::I2C1,
|
peripherals::I2C1,
|
||||||
};
|
};
|
||||||
use embassy_sync::{
|
use embassy_sync::{
|
||||||
blocking_mutex::raw::NoopRawMutex, channel::Sender, lazy_lock::LazyLock, mutex::Mutex,
|
blocking_mutex::raw::NoopRawMutex, lazy_lock::LazyLock, mutex::Mutex,
|
||||||
};
|
};
|
||||||
use embassy_time::{Duration, Timer};
|
use embassy_time::Timer;
|
||||||
|
|
||||||
pub mod keyboard;
|
pub mod keyboard;
|
||||||
use keyboard::{KeyCode, KeyEvent, KeyState};
|
|
||||||
|
|
||||||
use crate::peripherals::keyboard::{configure_keyboard, read_keyboard_fifo};
|
use crate::peripherals::keyboard::configure_keyboard;
|
||||||
|
|
||||||
const MCU_ADDR: u8 = 0x1F;
|
const MCU_ADDR: u8 = 0x1F;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user