Browse Source

improved readme

embedded-hal-1.0
Chris 7 years ago
parent
commit
b505440c09
  1. 30
      README.md
  2. 5
      examples/embedded_linux_epd4in2/src/main.rs

30
README.md

@ -4,6 +4,34 @@ This library contains a driver for E-Paper Modules from Waveshare.
It uses the [embedded graphics](https://crates.io/crates/embedded-graphics) library for the optional graphics support.
## Examples
There are multiple examples in the examples folder. For more infos about the examples see the seperate Readme [there](/examples/Readme.md).
```Rust
// Setup the epd
let mut epd = EPD4in2::new(&mut spi, cs, busy, dc, rst, &mut delay)?;
// Setup the graphics
let mut buffer = Buffer4in2::default();
let mut display = Display::new(epd.width(), epd.height(), &mut buffer.buffer);
// Draw some text
display.draw(
Font12x16::render_str("Hello Rust!")
.with_stroke(Some(Color::Black))
.with_fill(Some(Color::White))
.translate(Coord::new(5, 50))
.into_iter(),
);
// Transfer the frame data to the epd
epd.update_frame(&mut spi, &display.buffer())?;
// Display the frame on the epd
epd.display_frame(&mut spi)?;
```
## (Supported) Devices
| Device (with Link) | Colors | Flexible Display | Partial Refresh | Supported | Tested |
@ -64,9 +92,7 @@ They are also called A and B, but you shouldn't get confused and mix it with the
- [ ] improve the partial drawing/check the timings/timing improvements/....
## Examples
There are multiple examples in the examples folder. For more infos see the seperate Readme [there](/examples/Readme.md):

5
examples/embedded_linux_epd4in2/src/main.rs

@ -76,11 +76,6 @@ fn run() -> Result<(), std::io::Error> {
let mut delay = Delay {};
//TODO: wait for Digital::InputPin
//fixed currently with the HackInputPin, see further above
let mut epd4in2 = EPD4in2::new(&mut spi, cs, busy, dc, rst, &mut delay).expect("eink initalize error");
println!("Test all the rotations");

Loading…
Cancel
Save