Skip to content

jettify/uf-max7456

Repository files navigation

uf-max7456

CI codecov crates.io docs.rs

uf-max7456 is a platform-agnostic, no_std driver for the MAX7456 and AT7456E single-channel monochrome on-screen display, often found in betaflight/inav compatible flight controllers.

Note

Originally developed for the uflight flight-controller project, but useful as a standalone driver. Library is under active development and testing, API might change at any time.

Supported Hardware

Installation

[dependencies]
uf-max7456 = "0.1"

Enable defmt formatting support with:

[dependencies]
uf-max7456 = { version = "0.1", features = ["defmt"] }

Usage

use uf_max7456::{Config, Configured, Max7456Async};

async fn init_osd<SPI, DELAY>(
    spi: SPI,
    delay: &mut DELAY,
) -> Result<Max7456Async<SPI, Configured>, uf_max7456::Error<SPI::Error>>
where
    SPI: embedded_hal_async::spi::SpiDevice,
    DELAY: embedded_hal_async::delay::DelayNs,
{
    let osd = Max7456Async::new(spi);
    let mut osd = osd.init(delay, Config::auto()).await.map_err(|e| e.error)?;
    let state = osd.state();

    osd.write_text(0, 0, b"uf-max7456").await?;
    osd.write_char(state.geometry.columns - 1, 0, b'!').await?;

    Ok(osd)
}

License

This project is licensed under Apache-2.0. See LICENSE for details.

About

No description or website provided.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors