Trying to connect/use a small LED screen with SPI (ssd1351 controller)
Hi Hi!
I've been trying to use a Waveshare 1.5" RGB LED screen with the ROC-RK3328-CC using SPI (running the libre debian image for this board) but am very new to SPI devices and am not sure of a few things.
I'm using LUMA-OLED python library (with the help of R64-GPIO python library) and just trying to use the examples that come with it (I already have an i2c LED screen working), however I am unsure of a few things regarding the SPI hardware connection and software configuration:
Hardware:
Am I supposed to be using GPIO3 for something like this?
I've only been finding info of people wiring these LED screens to Raspberry Pis, and I'm not 100% sure I've got the pins plugged in correctly:
DIN - GPIOTX pin 19?
CLOCK - pin 23?
Chip Select - pin 24?
DC or Data/Command - which pin?
Reset - which pin?
in LUMA-OLED's documentation, it states that you need to connect RESET and DC pins to GPIO 24 and 25 on a raspberry pi, so does that mean that somewhere in the LUMA-OLED code, that is hard coded? I'm just wondering what I may need to find/change to make sure the software is trying to speak on the right pins considering this isn't a RPi.
Software:
is "cat /sys/kernel/debug/gpio" the SPI equivalent to i2detect for i2c?
is that how I would confirm that my SPI device is being recognized?
how would I go about "setting" those GPIO pins to be in the proper modes?
Any help would be supremely appreciated.
Thanks
P.S. Output of "cat /sys/kernel/debug/gpio":
firefly@firefly:/sys/kernel/debug$ cat gpio
GPIOs 1000-1031, platform/pinctrl, gpio0:
gpio-1000 ( |vcc_host_5v ) out hi
gpio-1025 ( |? ) out lo
gpio-1030 ( |vcc_sd ) out lo
GPIOs 1032-1063, platform/pinctrl, gpio1:
gpio-1050 ( |mdio-reset ) out hi
gpio-1058 ( |vcc_host1_5v ) out hi
GPIOs 1064-1095, platform/pinctrl, gpio2:
GPIOs 1096-1127, platform/pinctrl, gpio3:
GPIOs 1510-1511, platform/rk8xx-gpio, rk8xx-gpio, can sleep:
gpio-1510 ( |? ) out hi
gpio-1511 ( |? ) out lo
GPIOs 1000-1031, platform/pinctrl, gpio0:
gpio-1000 ( |vcc_host_5v ) out hi
gpio-1025 ( |? ) out lo
gpio-1030 ( |vcc_sd ) out lo
GPIOs 1032-1063, platform/pinctrl, gpio1:
gpio-1050 ( |mdio-reset ) out hi
gpio-1058 ( |vcc_host1_5v ) out hi
GPIOs 1064-1095, platform/pinctrl, gpio2:
GPIOs 1096-1127, platform/pinctrl, gpio3:
GPIOs 1510-1511, platform/rk8xx-gpio, rk8xx-gpio, can sleep:
gpio-1510 ( |? ) out hi
gpio-1511 ( |? ) out lo
Comments
Version: luma.oled 3.3.0 (luma.core 1.12.0)
Display: ssd1351
Interface: spi
Dimensions: 128 x 64
------------------------------------------------------------
Error: Unable to export GPIO
Error: Unable to set GPIO direction
Error: Unable to export GPIO
Error: Unable to set GPIO direction
You must setup() the GPIO channel (BCM 25) as an output first
You must setup() the GPIO channel (BCM 25) as an output first
usage: 3d_box.py [-h] [--config CONFIG] [--display DISPLAY] [--width WIDTH]
[--height HEIGHT] [--rotate ROTATION] [--interface INTERFACE]
[--i2c-port I2C_PORT] [--i2c-address I2C_ADDRESS]
[--spi-port SPI_PORT] [--spi-device SPI_DEVICE]
[--spi-bus-speed SPI_BUS_SPEED] [--spi-cs-high SPI_CS_HIGH]
[--spi-transfer-size SPI_TRANSFER_SIZE]
[--ftdi-device FTDI_DEVICE] [--gpio GPIO]
[--gpio-mode GPIO_MODE]
[--gpio-data-command GPIO_DATA_COMMAND]
[--gpio-reset GPIO_RESET] [--gpio-backlight GPIO_BACKLIGHT]
[--block-orientation ORIENTATION] [--mode MODE]
[--framebuffer FRAMEBUFFER] [--bgr] [--h-offset H_OFFSET]
[--v-offset V_OFFSET] [--backlight-active VALUE]
[--transform TRANSFORM] [--scale SCALE] [--duration DURATION]
[--loop LOOP] [--max-frames MAX_FRAMES]
3d_box.py: error: SPI device not found
gpio-30 ( |sdmmc-regulator ) out lo ACTIVE LOW
gpiochip1: GPIOs 32-63, parent: platform/pinctrl, gpio1:
gpio-50 ( |snps,reset ) out hi ACTIVE LOW
gpio-58 ( |vcc-host1-5v-regulat) out hi
gpiochip2: GPIOs 64-95, parent: platform/pinctrl, gpio2:
gpiochip3: GPIOs 96-127, parent: platform/pinctrl, gpio3:
gpiochip4: GPIOs 511-511, parent: platform/ff100000.syscon:grf-gpio, ff100000.syscon:grf-gpio:
gpio-511 ( |vcc_sdio ) out lo
SPI 1 pins (MOSI, MISO, SCK, CS): GPIO1_A7, GPIO1_B0, GPIO1_B1, GPIO1_B2
SPI 2 pins (MOSI, MISO, SCK, CS): GPIO1_C0, GPIO1_B7, GPIO1_C1, GPIO1_C2
SPI 3 pins (MOSI, MISO, SCK, CS): GPIO2_B2, GPIO2_B1, GPIO2_B3, GPIO2_B4
param_spidev_spi_bus=0