I wish I saw this like 4 hours ago I ran into the same keyboard issue, which to my current understanding is a bit odd because a similar I2C setup in micropython works just fine.
CircuitPython seems better for memory management and I love its file system, but honestly, the Adafruit libraries (mainly the graphic ones) aren’t that good compared to the MicroPython ones.
I also see that some developers have already created some MicroPython drivers for the PicoCalc so I’m discontinuing CircuitPython support in Picoware for now.
If anyone figures out the keyboard in the future, certainly tag me
OK I have the southbridge working on a CircuitPython Build. I took the southbridge code from the Micropython picoware user module. I added that to CircuitPython and had to do some tweaks. I had to remove the interrupt handling and change it to a polling method. But it all seems to be working now. I have 8meg of heap and 16meg of flash now on my Pimoroni pico plus2w board under Circuitpython. It should compile fine under the RPI_PICO_2W build in circuitpython. but you do need to build a custom UF2 that compiles in this module to get it working
Here is an app the proxies through an RPI to pull public pictures from the web. I just cant get the new Cert authentication to work. It is a real PITA. So I gave up and moved the heavy lifting of web work to an RPI 5.
If you use this driver is causes the screen to be inverted. I had to do an XOR with 0xFFFFFF co correct the screen colors. But it still was not quite right. I fished around and found there were a couple of errors in the init “stream” for the controller. This is a corrected init. No invertion needed and corrects some other problems. much better now.
OLD
_INIT_SEQUENCE = (
b"\xE0\x0F\x00\x03\x09\x08\x16\x0A\x3F\x78\x4C\x09\x0A\x08\x16\x1A\x0F"
b"\xE1\x0F\x00\x16\x19\x03\x0F\x05\x32\x45\x46\x04\x0E\x0D\x35\x37\x0F"
b"\xC0\x02\x17\x15" # Power Control 1 Vreg1out Verg2out
b"\xC1\x01\x41" # Power Control 2 VGH,VGL
b"\xC5\x03\x00\x12\x80" # Power Control 3 Vcom
b"\x36\x01\x48" # Memory Access
b"\x3A\x01\x55" # Interface Pixel Format 16 bit
b"\xB0\x01\x00" # Interface Mode Control
b"\xB1\x01\xA0" # Frame rate 60Hz
b"\xB4\x01\x02" # Display Inversion Control 2-dot
b"\xB6\x00" # Display Function Control RGB/MCU Interface Control
b"\x02\x01\x02" # MCU Source,Gate scan direction
b"\xE9\x01\x00" # Set Image Function Disable 24 bit data
b"\xF7\x04\xA9\x51\x2C\x82" # Adjust Control D7 stream, loose
b"\x11\x80\x78" # Sleep out delay 120ms
b"\x29\x00"
)
NEW FIXED
_INIT_SEQUENCE = (
b"\xE0\x0F\x00\x03\x09\x08\x16\x0A\x3F\x78\x4C\x09\x0A\x08\x16\x1A\x0F"
b"\xE1\x0F\x00\x16\x19\x03\x0F\x05\x32\x45\x46\x04\x0E\x0D\x35\x37\x0F"
b"\xC0\x02\x17\x15" # Power Control 1 Vreg1out Verg2out
b"\xC1\x01\x41" # Power Control 2 VGH,VGL
b"\xC5\x03\x00\x12\x80" # Power Control 3 Vcom
b"\x36\x01\x48" # MADCTL (try 0x40 if R/B swapped)
b"\x3A\x01\x55" # COLMOD = 16bpp
b"\xB0\x01\x00" # Interface Mode Control
b"\xB1\x01\xA0" # Frame rate 60Hz
b"\xB4\x01\x02" # DIC = 2-dot inversion (drive scheme), not color invert
b"\xB6\x03\x80\x02\x3B" # FIX: proper DFC(B6) 3 params
b"\xE9\x01\x00" # Set Image Function Disable 24 bit data
b"\xF7\x04\xA9\x51\x2C\x82" # Adjust Control D7 stream, loose
b"\x11\x80\x78" # SLPOUT + 120ms delay
b"\x21\x00" # NEW: INVOFF (stop needing XOR)
b"\x29\x00" # DISPON
)