Thanks, I’ll take a look. I’ll continue working away at the GPIO interrupt problem
Enable GPIO in Manjaro
Based on the discussion here: Zero interrupts
it appears that irq mode 3 is not supported for gpio on the Radxa Zero. I’m not sure what your exact requirements are, but you may be able to work around this limitation by polling the gpio pins rather than using them to generate system interrupts. That’s what I ended up doing.
Thanks! I came to the same conclusions after reading through the drivers as well and was going to follow up here.
I’m working on a project similar to Guy Dupont’s Spotify iPod build that uses a Raspberry Pi Zero and an iPod clickwheel via GPIO. He has his source code available and I was looking to use libgpiod and the Radxa to interface with a clickwheel. Polling seems to be too inconsistent unfortunately.
I’m not familiar with the click wheel hardware, but if it can be configured to behave the same as a basic rotary encoder, you can probably get acceptable performance with polling if you dial in debouncing parameters.
Alternately, you could stick something like an Arduino Pro Micro between the Radxa board and the clickwheel. There’s some microcontroller code here that might be helpful. Then the Arduino could emulate a USB HID device, so all the Radxa Zero is seeing is a USB keyboard or joystick or something.
That’s what I did in my project (a retro gaming handheld) which has a 4-way directional pad, four face buttons, two shoulder buttons, and two analog thumbsticks. The Arduino handles the inputs from all the buttons and even absurdly granular settings like advanced acceleration curves for the analog sticks, and as far as the Radxa Zero is concerned, it’s merely a generic USB gamepad that “just works” out of the box.
That’s a great idea, thanks. I appreciate the help.
The microcontroller code was used as the source for the Pi implementation! That is the actual source of truth for interfacing with this clickwheel.
I found I could get the polling to work but only if I pinned the CPU with no delay or debounce which is unsustainable obviously and eventually locks up given enough inputs.
The interior of this iPod shell is getting awfully tight with all this hardware ha!
Just to follow up here I ended up using an Adafruit Trinket and everything is working flawlessly. Thanks again for the suggestion!