I coincidentally came across BlackBerry Passport (Q30) Keyboard replacement part on Aliexpress. I Remembered that It has built-in capacitive touch sensing and Ortholinear-likes keys stacking, which is caught my eyes immediately. So I bought one. Problem is there is no one using this keyboard in DIY or hacking thingy project (Closed one is BBQ10 keyboard). Which it means that there's no one reverse engineer the pinout and the schematics are secret to BB too. No hesitate, I decide to do it on my own.
Several years ago I have a project called KouchPad. I reuse the Synaptics trackpad as a touch keyboard + trackpad. And STM32 as USB HID thingy.
After I get the Q30 keyboard working with nRF51822 over HID BLE. I though that this project might be another KouchPad. But to name it like Wac0m Rif0ff. I went for the name "k0uchpad BLE".
Yesterday I have some test with it (trackpad part). And I managed to crash Windows and get GSOD (Yes, I literally mean Green screen). For some reason the Windows driver kernel (win32kbase.sys) hates 2 or more trackpad on 1 Laptop. I have to change the usage from trackpad to touchscreen to not crash my laptop. Face palm moment
Right now I'm waiting the PCB and working on Key matrix scanning (with STM8L151F3). The code is here : k0uchpad BLE
After couple months of finding. Finally, a complete pinout of Blackberry Q30 Keyboard !
Right now I'm working on the driver of Synaptics touch controller IC. It turned out that my previous keyboard has Synaptics S3501B and my current keyboard has Synaptics S3508A instead. These are RMI4 compliance chip from Synaptics. And I confirmed that S3508A works with RMI4 driver on Linux.
Above pic is Dmesg log from my F1C100s board. The driver has a problem parsing IRQ number from device tree, so I did some quick workaround patch in rmi_drive.c . pdata->irq = 39 is to request irq from irq number 39. Which is GPIO Port E interrupt number.
Some quick patch
Since this thing is work correctly. I did some logic analyzing on the I2C bus. Especially with the HID report.
I was able to decode the HID report of the Synaptics IC. I'll update on this soon but this is what I got:
page number : 0x00
function : 0x12
HID report : 0x05 for finger detection, 0x06 for HID report
Today after I took 4th covid vax jab. I can't move much since my arm hurts xD. So I decided to revisit this project after I've been working on oscilloscope project and before I go back to Bangkok (Uni) soon.
Jump to the pinout. I already found the LED pinout of this keyboard. It turned out that each row (1-3) has its own LEDs. They share cathode (-) on same row. So pin 20, 21 and 24 are LED cathode pin for row number 1 2 and 3. These LEDs separated anode (+) pin. Pin 7 is for left side and pin 22 is for right side. So the configuration is something like this :
Because I have no idea about pinout of this keyboard. I ended up borrowing Arduino Mega 2560 from my friend living next door for this project. I wrote a small(?) code that use roughly 16 GPIOs to scan each pin. By the scanning pin set as input pull-up mode, other pin as output with logic 0. When button is pressed, it completes the circuit and pull the input pin down to GND level. With this setup I can easily map out every single button and create buttons matrix map. Unfortunately, my hardware setup is to cozy and I need to put the keyboard in weird angle. Ended up tearing the FFC cable. I be able to only map few pins, Until the new keyboard arrive. This is by far the most mapping I can get :