Merge pull request #30 from plaes/min-doc-example

Add basic usage example to the index screen
This commit is contained in:
Yuri Iozzelli 2021-11-19 11:23:14 +01:00 committed by GitHub
commit 8aeefc4abc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,30 @@
#![no_std]
//! ILI9341 Display Driver
//!
//! ### Usage
//!
//! To control the display you need to set up:
//!
//! * Interface for communicating with display ([display-interface-spi crate] for SPI)
//! * Configuration (reset pin, delay, orientation and size) for display
//!
//! ```ignore
//! let iface = SPIInterface::new(spi, dc, cs);
//!
//! let mut display = Ili9341::new(
//! iface,
//! reset_gpio,
//! &mut delay,
//! Orientation::Landscape,
//! ili9341::DisplaySize240x320,
//! )
//! .unwrap();
//!
//! display.clear(Rgb565::RED).unwrap()
//! ```
//!
//! [display-interface-spi crate]: https://crates.io/crates/display-interface-spi
use embedded_hal::blocking::delay::DelayMs;
use embedded_hal::digital::v2::OutputPin;