Solved it, my own fault for trying to enable it on spi1 bus first. I had put the following in /boot/config.txt and rebooted, so originally was targeting /dev/spidev1.0.
dtoverlay=spi1-1cs,cs0_pin=16 # BCM 16 = gpio pin 36
# MISO - pin 35
# CE0 - pin 36 (default 12?)
# MOSI - pin 38
# CLK - pin 40
When that didnt work I reverted to /dev/spidev0.1 - updated my settings to run bounce, but didn’t properly reconfigure my own program to match the pinout (port 0, device 1 and gpio pin 9) - here is a minimal working example for this device https://shop.pimoroni.com/?q=PIM473
#!/usr/bin/python3
import time
from luma.core.interface.serial import i2c,spi
from luma.core.render import canvas
from luma.oled.device import sh1106
serial = spi(device=1, port=0, gpio_DC=9)
device = sh1106(serial, width=128, height=128, rotate=2)
with canvas(device) as draw:
draw.rectangle(device.bounding_box, outline="white", fill="black")
draw.text((10, 40), "Hello World", fill="white")
time.sleep(5)
with canvas(device) as draw:
draw.rectangle(device.bounding_box, outline="black", fill="white")
draw.text((10, 40), "Hello World", fill="black")
time.sleep(5)
p.s. Thanks to Shoe for the helpful comments regarding syntax - that line was a complete red herring however, as the canvas object automatically flushes the image when the with block completes, and took me down the wrong path. I think it was the ordering of the parameters and tired eyes that made me think (device 0, port 1) was targeting spidev0.1 - plus I omitted the gpio pin. Sadly, even with this now working code, I still could not get spi1 to work yet, even with the demos, however I guess those pins can now be used for something else.