epd-waveshare
epd-waveshare copied to clipboard
Add EPD 4in2bc support
So... Does it work? Well, mostly. Display works fine as far as I can tell, however color coding is broken. For some reason 4in2bc
uses a completely different scheme than anything implemented.
// 4in2bc
// White bw - 0xFF c - 0xFF
// Black bw - 0 c - 0xFF
// Red bw - 0 c - 0
// bwrbit = true
// White: bw - 0xFF c - 0
// Black: bw - 0 c - 0
// Red: bw - 0 c - 0xFF
// bwrbit = false
// White: bw - 0xFF c - 0
// Black: bw - 0 c - 0
// Red: bw - 0xFF c - 0xFF
@caemor could you help with extending TriColor
implementation to match these requirements? I am willing to do it myself, let's just agree on the best way to approach it. Thanks!
After this modification colors render correctly. I need to look how to integrate it with current implementation.
impl ColorType for TriColor {
const BITS_PER_PIXEL_PER_BUFFER: usize = 1;
const BUFFER_COUNT: usize = 2;
fn bitmask(&self, bwrbit: bool, pos: u32) -> (u8, u16) {
let bit = 0x80 >> (pos % 8);
let mask = match self {
TriColor::Black => (bit as u16) << 8,
TriColor::White => (bit as u16) << 8 | bit as u16,
TriColor::Chromatic => 0u16,
};
(!bit, mask)
}
}
Also, update_partial_frame()
doesn't work for whatever reason.
Hello Yurinnick, I was working on an implementation on the same screen and got the same issue about the chromatic buffer which is inverted. I have tested your implementation and can confirm it is working on EPD4IN2bc screen As a reference i use the EPD_4in2b_V2 example code from Waveshare here : https://github.com/waveshare/e-Paper
Thanks for your work, Simon
Sup guys, any plans on releasing this one?
@caemor could you provide feedback please?