C driver for QW/ST Pad available?

I’m trying to use a pad from C rather than MicroPython; I want to extend the number of buttons available on a Display Pack 2.8, and this seemed an ideal way to do it.

However, I didn’t check first to see if there was an available driver in C as there is for the Display Pack itself.

I have tried ‘converting’ the MP library (which I have done with other code before), but am not getting very far. Is there other code for the Pico to drive the TCA9995, as I don’t seem to be able to initialise it correctly, and whatever value I write to the LED bits (whether 0 or 1) doesn’t change their state, nor does trying to read the button values ever give me any changed values.

I must be doing something wrong, I just can’t see what, and have also asked for advice on the Pi Pico SDK forum.

Thanks,

Steve

Hi.

There’s not a specific C driver for the QwstPad itself, however do we use the TCA9995 for our Yukon product, which has some C code for that you could delve into.

So there is. By looking for ‘9555’ in the source folders, I came across this. Took me a couple of read-throughs of the datasheet and the QwstPad schematic, but I have working code now.

I think my biggest issue was working out which order PORT0 and PORT1 should be, once I got that right it was relatively straightforward. The assignments to the bits of #0 and #1 seemed slightly strange, but without seeing the PCB layout in all it’s glory, I would assume there are good (or fun) reasons for it.

Main thing, I can see when buttons are pressed/released and turn LEDs on and off, so I’m a happy bunny. Of course, if the Pico Display range had more buttons to start with … :)

However, they, and the QwstPad are great products.