Closed fx-chun closed 2 years ago
Might be possible to do this by exposing it through an additional USB interface along side the USB-to-UART? Might be interesting to also add support for this interface as an additional board to the Adafruit Blinka project similar to the FT232/FT2232/MCP2221/GreatFET One.
I'm also looking for this feature and working on implementing it. There already is a start of GPIO feature through the CLI bridge provided by the flipper; I was thinking of extending it to allow binary read/write. A small client interface could be written in python. I also saw a beginning of a RPC interface; maybe it would be possible to control the GPIO pins through that but I haven't looked into it.
Also saw that there may be work on a BusPirate Mode too.
I'm also looking for this feature and working on implementing it. There already is a start of GPIO feature through the CLI bridge provided by the flipper; I was thinking of extending it to allow binary read/write. A small client interface could be written in python. I also saw a beginning of a RPC interface; maybe it would be possible to control the GPIO pins through that but I haven't looked into it.
Fantastic @SamuelYvon! Looking forward to it :)
I'm also looking for this feature and working on implementing it. There already is a start of GPIO feature through the CLI bridge provided by the flipper; I was thinking of extending it to allow binary read/write. A small client interface could be written in python. I also saw a beginning of a RPC interface; maybe it would be possible to control the GPIO pins through that but I haven't looked into it.
These enhancements might be useful for humans interacting with CLI, but I strongly advise against using CLI in automated software.
CLI is meant to be used by people and we're trying to keep it as user-friendly as possible.
RPC is the perfect way to go if you want to control your Flipper with software. Maybe our protobuf schema needs a GPIO subsystem?..
These enhancements might be useful for humans interacting with CLI, but I strongly advise against using CLI in automated software.
I agree, my principal interest right now is GPIO through CLI (for humans). If someone can guide me towards the protobuf format and how I could add such a subsys. I'd gladly make a PR later
Ok; I figured out the whole RPC thing, so I'm going to implement that as well. I'll link the PR when it's done / in a draft-worthy state
Maybe our protobuf schema needs a GPIO subsystem?..
See https://github.com/flipperdevices/flipperzero-protobuf/pull/30
I added python bindings in https://github.com/flipperdevices/flipperzero_protobuf_py/pull/5 and the PR for the firmware is here https://github.com/flipperdevices/flipperzero-firmware/pull/1282
PRs by @SamuelYvon are merged. Please check.
Did this end up exposing a usb gpio device, or is it only accessible through the cli?
This doesn't really solve the issue of interfacing with the flipper's gpio pins through standard gpio libraries.
Is your feature request related to a problem? Please describe. It would be useful for the Flipper Zero to have a mode that exposes GPIO pins over USB.
Describe the solution you'd like If the Zero is able to emulate a USB interface for a device that already exposes GPIO (like an FT245R), this would allow PCs to interface with the Zero using existing GPIO libraries.
Describe alternatives you've considered Currently kludging a project using the USB-UART interface, but it would be nice to have access to the GPIOs directly.
Additional context n/a