Skip to content

Commit

Permalink
All: Revert to using line numbers.
Browse files Browse the repository at this point in the history
Avoid calling gpiodevice's platform detect on import time.
  • Loading branch information
Gadgetoid committed Feb 7, 2024
1 parent a6f270a commit ffcc67a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 45 deletions.
12 changes: 3 additions & 9 deletions inky/inky.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import gpiodevice
import numpy
from gpiod.line import Bias, Direction, Edge, Value
from gpiodevice import platform
from PIL import Image

from . import eeprom
Expand All @@ -20,14 +19,9 @@
BLACK = 1
RED = YELLOW = 2

if platform.get_name().startswith("Raspberry Pi 5"):
RESET_PIN = "PIN13" # GPIO 27
BUSY_PIN = "PIN11" # GPIO 17
DC_PIN = "PIN15" # GPIO 22
else:
RESET_PIN = "GPIO27"
BUSY_PIN = "GPIO17"
DC_PIN = "GPIO22"
RESET_PIN = 27 # PIN13
BUSY_PIN = 17 # PIN11
DC_PIN = 22 # PIN15

# In addition the following pins are used for SPI
MOSI_PIN = 10
Expand Down
12 changes: 3 additions & 9 deletions inky/inky_ac073tc1a.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import gpiod
import gpiodevice
from gpiod.line import Direction, Edge, Value
from gpiodevice import platform
from PIL import Image

from . import eeprom
Expand All @@ -25,14 +24,9 @@
ORANGE = 6
CLEAN = 7

if platform.get_name().startswith("Raspberry Pi 5"):
RESET_PIN = "PIN13" # GPIO 27
BUSY_PIN = "PIN11" # GPIO 17
DC_PIN = "PIN15" # GPIO 22
else:
RESET_PIN = "GPIO27"
BUSY_PIN = "GPIO17"
DC_PIN = "GPIO22"
RESET_PIN = 27 # PIN13
BUSY_PIN = 17 # PIN11
DC_PIN = 22 # PIN15

MOSI_PIN = 10
SCLK_PIN = 11
Expand Down
12 changes: 3 additions & 9 deletions inky/inky_ssd1608.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import gpiodevice
import numpy
from gpiod.line import Bias, Direction, Edge, Value
from gpiodevice import platform
from PIL import Image

from . import eeprom, ssd1608
Expand All @@ -16,14 +15,9 @@
BLACK = 1
RED = YELLOW = 2

if platform.get_name().startswith("Raspberry Pi 5"):
RESET_PIN = "PIN13" # GPIO 27
BUSY_PIN = "PIN11" # GPIO 17
DC_PIN = "PIN15" # GPIO 22
else:
RESET_PIN = "GPIO27"
BUSY_PIN = "GPIO17"
DC_PIN = "GPIO22"
RESET_PIN = 27 # PIN13
BUSY_PIN = 17 # PIN11
DC_PIN = 22 # PIN15

MOSI_PIN = 10
SCLK_PIN = 11
Expand Down
12 changes: 3 additions & 9 deletions inky/inky_ssd1683.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import gpiodevice
import numpy
from gpiod.line import Bias, Direction, Edge, Value
from gpiodevice import platform
from PIL import Image

from . import eeprom, ssd1683
Expand All @@ -15,14 +14,9 @@
BLACK = 1
RED = YELLOW = 2

if platform.get_name().startswith("Raspberry Pi 5"):
RESET_PIN = "PIN13" # GPIO 27
BUSY_PIN = "PIN11" # GPIO 17
DC_PIN = "PIN15" # GPIO 22
else:
RESET_PIN = "GPIO27"
BUSY_PIN = "GPIO17"
DC_PIN = "GPIO22"
RESET_PIN = 27 # PIN13
BUSY_PIN = 17 # PIN11
DC_PIN = 22 # PIN15

MOSI_PIN = 10
SCLK_PIN = 11
Expand Down
12 changes: 3 additions & 9 deletions inky/inky_uc8159.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import gpiodevice
import numpy
from gpiod.line import Bias, Direction, Edge, Value
from gpiodevice import platform
from PIL import Image

from . import eeprom
Expand Down Expand Up @@ -44,14 +43,9 @@
[255, 255, 255]
]

if platform.get_name().startswith("Raspberry Pi 5"):
RESET_PIN = "PIN13" # GPIO 27
BUSY_PIN = "PIN11" # GPIO 17
DC_PIN = "PIN15" # GPIO 22
else:
RESET_PIN = "GPIO27"
BUSY_PIN = "GPIO17"
DC_PIN = "GPIO22"
RESET_PIN = 27 # PIN13
BUSY_PIN = 17 # PIN11
DC_PIN = 22 # PIN15

MOSI_PIN = 10
SCLK_PIN = 11
Expand Down

0 comments on commit ffcc67a

Please sign in to comment.