Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support the Inky Impression #36

Open
lawik opened this issue Oct 10, 2021 · 10 comments
Open

Support the Inky Impression #36

lawik opened this issue Oct 10, 2021 · 10 comments

Comments

@lawik
Copy link
Collaborator

lawik commented Oct 10, 2021

This issue will be used for now to capture any and all notes about implementing support for the impression.

It is different hardware but I think we could extend the current API or make a 2.x series to support it where we extend the API in a breaking fashion if necessary.

The way we built the Phat and What support was by porting from Pimoroni. pimoroni/inky

Example for the 7color should be the Impression: https://github.com/pimoroni/inky/blob/master/examples/7color/stripes.py

That indicates using this:
https://github.com/pimoroni/inky/blob/master/library/inky/inky_uc8159.py

Make any notes on progress or dead ends available here :)

Ping @jasonmj @axelson who have also ordered this thing.

@lawik
Copy link
Collaborator Author

lawik commented Oct 10, 2021

https://github.com/pappersverk/inky/pull/37/files

Current progress will be in that PR on my end. Made a #TODO note on how far I've gotten (not very).

I don't think this uses the eeprom that was a thing on the what at all. I get the impression that a lot was copy and pasted and never cleaned up. I'll try to figure out what we can rip out after I have it working.

Unclear if all the SPI stuff and pins actually mostly line up between the old ones and the Impression or if they are unused copy and pastes. I guess I'll find out as I get through it :D

@axelson
Copy link
Collaborator

axelson commented Nov 6, 2021

I haven't found any documentation on the orientation (the pinout links to https://pinout.xyz/pinout/inky_impression# but that doesn't help me with the orientation), but the product page has an image that shows the correct orientation with a rpi0:
inky-7-colour-reverse-1_1024x1024

@axelson
Copy link
Collaborator

axelson commented Nov 7, 2021

This is what I receive back from Inky.EEPROM.read/0:

iex(livebook@nerves-517f.local)1> Inky.EEPROM.read
{:ok,
 %Inky.EEPROM{
   color: :unknown,
   display_variant: "7-Color (UC8159)",
   height: 192,
   pcb_variant: 12,
   timestamp: "2021-08-25 17:12:10.3",
   width: 88
 }}

I've also started a shell project to be used for testing/developing this work: https://github.com/axelson/inky_impression_livebook

@axelson
Copy link
Collaborator

axelson commented Nov 8, 2021

Some progress! This is effectively what I get if I skip using the cs0 pin entirely (and fix a couple minor bugs in the code):

out2.mp4

@axelson
Copy link
Collaborator

axelson commented Nov 8, 2021

Update, I'm able to display things now!

By generating a buffer with (w=width h=height):

    buffer =
      for y <- 0..(h - 1), x <- 0..(w - 1), into: <<>> do
        cond do
          y > 100 -> <<3>>
          x > 100 -> <<4>>
          true -> <<rem(y, @colors[:orange] + 1)>>
        end
        # color = floor(0 / w * 7)
      end

I get:
2021-11-07 22 04 09

It seems like we'll have to update or re-write PixelBuffer to generate a buffer
Also the setup code causing about 5x more flashing than what I'm seeing in a YouTube video: https://www.youtube.com/watch?v=RWgaSNRqyEg

@axelson
Copy link
Collaborator

axelson commented Nov 12, 2021

2021-11-11 21 26 19
2021-11-11 21 25 55

Okay, making progress! The bars are mostly gone. They seem completely gone for some colors but not others. I'm not quite sure what's happening.

My updates are in #45 but the latest code isn't being used. The main thing I've added is an implementation of the following python code:

buf = ((buf[::2] << 4) & 0xF0) | (buf[1::2] & 0x0F)

Which is saying that they're using the top 4 bits and the bottom 4 bits.

Edit: actually what's happening in the picture is that the color on the right is bleeding into the color on the left.

@axelson
Copy link
Collaborator

axelson commented Nov 14, 2021

2021-11-13 18 26 14

I finally got the coordinates working properly, when writing to the display we should treat it as if it's 300x896 instead of 600x448

@lawik
Copy link
Collaborator Author

lawik commented Nov 14, 2021 via email

@axelson
Copy link
Collaborator

axelson commented Nov 14, 2021

Thanks!
Next up I'm trying to figure out why it takes me 30 seconds to update but all the videos I can find online seem to take about 10 seconds to do the equivalent update:

@nyaray
Copy link
Collaborator

nyaray commented Dec 5, 2021

One thing you could do is to compare the command sequence generated by the python library exactly to the one that Inky creates. That way you could figure out if something is being done in a weird manner or causing a setting to be changed or something. Be sure to check values carefully! :)... have "fun", hehe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants