Skip to content

Commit 6134c61

Browse files
authored
Add inky_impression_13 driver (#136)
* Add inky_impression_13 driver * fix
1 parent 87fb141 commit 6134c61

File tree

6 files changed

+37
-38
lines changed

6 files changed

+37
-38
lines changed

backend/app/drivers/devices.py

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
def drivers_for_frame(frame: Frame) -> dict[str, Driver]:
66
device = frame.device
77
device_drivers: dict[str, Driver] = {}
8-
if device == "pimoroni.inky_impression" or device == "pimoroni.inky_python":
8+
if device == "pimoroni.inky_impression" or device == "pimoroni.inky_impression_13" or device == "pimoroni.inky_python":
99
device_drivers = {
1010
"inkyPython": DRIVERS["inkyPython"],
1111
"spi": DRIVERS["spi"],
1212
"i2c": DRIVERS["i2c"],
1313
}
14-
if device == "pimoroni.inky_impression":
14+
if device == "pimoroni.inky_impression" or device == "pimoroni.inky_impression_13":
1515
device_drivers["gpioButton"] = DRIVERS["gpioButton"]
1616
elif device == "pimoroni.hyperpixel2r":
1717
device_drivers = {"inkyHyperPixel2r": DRIVERS["inkyHyperPixel2r"]}
@@ -41,16 +41,24 @@ def drivers_for_frame(frame: Frame) -> dict[str, Driver]:
4141
]
4242

4343
# Always enable evdev if not eink
44-
if device != "pimoroni.inky_impression" and not device.startswith("waveshare."):
44+
if device != "pimoroni.inky_impression" and device != "pimoroni.inky_impression_13" and not device.startswith("waveshare."):
4545
device_drivers['evdev'] = DRIVERS['evdev']
4646

47-
if frame.device == "pimoroni.inky_impression":
48-
frame.gpio_buttons = [
49-
{"pin": 5, "label": "A"},
50-
{"pin": 6, "label": "B"},
51-
{"pin": 16, "label": "C"},
52-
{"pin": 24, "label": "D"},
53-
]
47+
if frame.device == "pimoroni.inky_impression" or frame.device == "pimoroni.inky_impression_13":
48+
if frame.device == "pimoroni.inky_impression_13":
49+
frame.gpio_buttons = [
50+
{"pin": 5, "label": "A"},
51+
{"pin": 6, "label": "B"},
52+
{"pin": 25, "label": "C"},
53+
{"pin": 24, "label": "D"},
54+
]
55+
else:
56+
frame.gpio_buttons = [
57+
{"pin": 5, "label": "A"},
58+
{"pin": 6, "label": "B"},
59+
{"pin": 16, "label": "C"},
60+
{"pin": 24, "label": "D"},
61+
]
5462
device_drivers["bootconfig"] = DRIVERS["bootConfig"]
5563
device_drivers["bootconfig"].lines = [
5664
"dtoverlay=spi0-0cs",

backend/list_devices.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
list = [
99
{"value": 'web_only', "label": 'Web only'},
1010
{"value": 'framebuffer', "label": 'HDMI / Framebuffer'},
11-
{"value": 'pimoroni.inky_impression', "label": 'Pimoroni Inky Impression (Python driver + Buttons)'},
11+
{"value": 'pimoroni.inky_impression_13', "label": 'Pimoroni Inky Impression - 13.3" Spectra'},
12+
{"value": 'pimoroni.inky_impression', "label": 'Pimoroni Inky Impression - all others'},
1213
{"value": 'pimoroni.inky_python', "label": 'Pimoroni Inky other (Python driver)'},
1314
{"value": 'pimoroni.hyperpixel2r', "label": 'Pimoroni HyperPixel 2.1" Round'},
1415
]

frameos/src/frameos/utils/dither.nim

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,28 +27,6 @@ const spectra6ColorPalette* = @[
2727
(67, 138, 28), # 0x6 - green
2828
]
2929

30-
# 6-color Spectra e-ink displays, as measured on a real display (Attempt 1)
31-
const spectra6ColorPaletteTry1* = @[
32-
(50, 44, 52), # 0x0 - black
33-
(255, 255, 255), # 0x1 - white
34-
(255, 248, 0), # 0x2 - yellow
35-
(223, 38, 27), # 0x3 - red
36-
(999, 999, 999), # skips an index!
37-
(41, 112, 238), # 0x5 - blue
38-
(87, 161, 126), # 0x6 - green
39-
]
40-
41-
# 6-color Spectra e-ink displays, measured on display and modulated
42-
const spectra6ColorPaletteTry2* = @[
43-
(13, 0, 19), # 0x0 - black
44-
(220, 220, 215), # 0x1 - white
45-
(242, 220, 0), # 0x2 - yellow
46-
(130, 0, 0), # 0x3 - red
47-
(999, 999, 999), # skips an index!
48-
(19, 60, 160), # 0x5 - blue
49-
(51, 83, 38), # 0x6 - green
50-
]
51-
5230
# 6-color Spectra e-ink displays, as presented by the manufacturer. These are not used.
5331
const spectra6ColorPaletteOrig* = @[
5432
(0, 0, 0), # 0x0 - black

frameos/vendor/inkyPython/check.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,13 @@ def init():
1818

1919
if __name__ == "__main__":
2020
inky = init()
21-
log({ "inky": True, "width": inky.resolution[0], "height": inky.resolution[1], "color": inky.colour })
21+
log({
22+
"inky": True,
23+
"width": inky.resolution[0],
24+
"height": inky.resolution[1],
25+
"color": inky.colour,
26+
"model": inky.eeprom.get_variant(),
27+
"variant": inky.eeprom.display_variant,
28+
"pcb": inky.eeprom.pcb_variant,
29+
})
2230
sys.exit(0)

frontend/src/devices.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import { Option } from './components/Select'
66
export const devices: Option[] = [
77
{ value: 'web_only', label: 'Web only' },
88
{ value: 'framebuffer', label: 'HDMI / Framebuffer' },
9-
{ value: 'pimoroni.inky_impression', label: 'Pimoroni Inky Impression (Python driver + Buttons)' },
9+
{ value: 'pimoroni.inky_impression_13', label: 'Pimoroni Inky Impression - 13.3" Spectra' },
10+
{ value: 'pimoroni.inky_impression', label: 'Pimoroni Inky Impression - all others' },
1011
{ value: 'pimoroni.inky_python', label: 'Pimoroni Inky other (Python driver)' },
1112
{ value: 'pimoroni.hyperpixel2r', label: 'Pimoroni HyperPixel 2.1" Round' },
1213
{ value: 'waveshare.EPD_1in02d', label: 'Waveshare 1.02" (D) 128x80 Black/White' },

frontend/src/scenes/frame/panels/FrameSettings/FrameSettings.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ export function FrameSettings({ className }: FrameSettingsProps) {
478478
</div>
479479
<H6 className="flex items-center gap-2">
480480
GPIO buttons
481-
{frameForm.device !== 'pimoroni.inky_impression' ? (
481+
{frameForm.device !== 'pimoroni.inky_impression' && frameForm.device !== 'pimoroni.inky_impression_13' ? (
482482
<Button
483483
size="small"
484484
color="secondary"
@@ -491,8 +491,11 @@ export function FrameSettings({ className }: FrameSettingsProps) {
491491
) : null}
492492
</H6>
493493
<div className="pl-2 @md:pl-8 space-y-2">
494-
{frameForm.device === 'pimoroni.inky_impression' ? (
495-
<div>Inky Impression boards automatically configure pins 5, 6, 16 and 24 as buttons A, B, C and D</div>
494+
{frameForm.device === 'pimoroni.inky_impression' || frameForm.device === 'pimoroni.inky_impression_13' ? (
495+
<div>
496+
Inky Impression boards automatically configure pins 5, 6,{' '}
497+
{frameForm.device === 'pimoroni.inky_impression_13' ? '25' : '16'} and 24 as buttons A, B, C and D
498+
</div>
496499
) : (
497500
frameForm.gpio_buttons?.map((_, index) => (
498501
<Group key={index} name={`gpio_buttons.${index}`}>

0 commit comments

Comments
 (0)