-
Notifications
You must be signed in to change notification settings - Fork 12
Refactor and add support for Inky Impression 7.3" #49
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
base: master
Are you sure you want to change the base?
Changes from all commits
7d80cce
8ee2dda
6e11741
c56c9be
e415e0e
fc37b1f
cc82eda
99d2cd5
7a636df
753d5a8
3f46d9a
3142798
ae2e48f
07f75e6
63cdb4f
13793cd
853021b
46a3b40
9dfa181
5bfb57f
4689834
3bcf4f1
590c25f
d5bca11
9abc79f
80bdee8
f86d1b8
b30be19
a68e31a
40cda84
6a6cd42
35eb6cd
765d6ff
2fa18a3
5d65f09
f6e11c7
975d63b
4174f7e
c81122d
83a37a8
535ba1d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,13 +12,68 @@ defmodule Inky.Display do | |
| width: 0, | ||
| height: 0, | ||
| packed_dimensions: %{}, | ||
| packed_resolution: nil, | ||
| rotation: 0, | ||
| accent: :black, | ||
| luts: <<>> | ||
|
|
||
| @spec spec_for(:phat_ssd1608 | :phat | :what, :black | :red | :yellow) :: Inky.Display.t() | ||
| def spec_for(type, accent \\ :black) | ||
| @spec spec_for(:impression_7_3, :none) :: Inky.Display.t() | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is, if it's going to be a clause in the same function, since arity is part of function identity... or maybe it isn't in Elixir, in contrast to Erlang? |
||
| def spec_for(type = :impression_7_3, :none) do | ||
| width = 800 | ||
| height = 480 | ||
|
|
||
| %__MODULE__{ | ||
| type: type, | ||
| width: width, | ||
| height: height, | ||
| packed_dimensions: %{}, | ||
| packed_resolution: | ||
| <<width::unsigned-big-integer-size(16)>> <> <<height::unsigned-big-integer-size(16)>>, | ||
| rotation: 0, | ||
| accent: nil, | ||
| luts: <<>> | ||
| } | ||
| end | ||
|
|
||
| @spec spec_for(:impression_5_7, :none) :: Inky.Display.t() | ||
| def spec_for(type = :impression_5_7, :none) do | ||
| width = 600 | ||
| height = 448 | ||
|
|
||
| %__MODULE__{ | ||
| type: type, | ||
| width: width, | ||
| height: height, | ||
| packed_dimensions: %{}, | ||
| packed_resolution: | ||
| <<width::unsigned-big-integer-size(16)>> <> <<height::unsigned-big-integer-size(16)>>, | ||
| rotation: 0, | ||
| accent: nil, | ||
| luts: <<>> | ||
| } | ||
| end | ||
|
|
||
| # WARNING: This is untested on actual hardware | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, I wonder if Pimoroni would be willing to send us one? I went ahead and wrote a quick note to their support team to see if there's a chance.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pimoroni is sending me a 4" Impression for testing 🎉
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wow, that's great!! |
||
| @spec spec_for(:impression_4, :none) :: Inky.Display.t() | ||
| def spec_for(type = :impression_4, :none) do | ||
| width = 640 | ||
| height = 400 | ||
|
|
||
| %__MODULE__{ | ||
| type: type, | ||
| width: width, | ||
| height: height, | ||
| packed_dimensions: %{}, | ||
| packed_resolution: | ||
| <<width::unsigned-big-integer-size(16)>> <> <<height::unsigned-big-integer-size(16)>>, | ||
| rotation: 0, | ||
| accent: nil, | ||
| luts: <<>> | ||
| } | ||
| end | ||
|
|
||
| @spec spec_for(:phat_il91874 | :phat_ssd1608 | :what, :black | :red | :yellow) :: | ||
| Inky.Display.t() | ||
| def spec_for(type = :phat_ssd1608, accent) do | ||
| # Keep it minimal. Details are specified in `Inky.HAL.PhatSSD1608`. | ||
| %__MODULE__{ | ||
|
|
@@ -32,7 +87,7 @@ defmodule Inky.Display do | |
| } | ||
| end | ||
|
|
||
| def spec_for(type = :phat, accent) do | ||
| def spec_for(type = :phat_il91874, accent) do | ||
| %__MODULE__{ | ||
| type: type, | ||
| width: 212, | ||
|
|
@@ -78,7 +133,7 @@ defmodule Inky.Display do | |
| columns = | ||
| case type do | ||
| :what -> width | ||
| :phat -> height | ||
| :phat_il91874 -> height | ||
| :test_small -> height | ||
| end | ||
|
|
||
|
|
@@ -89,7 +144,7 @@ defmodule Inky.Display do | |
| rows = | ||
| case type do | ||
| :what -> height | ||
| :phat -> width | ||
| :phat_il91874 -> width | ||
| :test_small -> width | ||
| end | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.