[Feature Request] GPIO support in MeshCore
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- c
- Bereich
- cli, embedded-iot
Rechercherichtung
Start by reading src/MeshCore.h, especially the existing MainBoard GPIO methods, then trace the common CLI and board subclasses for the roles and board types mentioned in the proposal. The issue proposes GPIO defines, analog and digital access, and new CLI commands, but leaves compatibility and implementation details open; done would mean agreeing on the interface and supporting the requested pin operations across board roles.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
I need to access GPIO pins on my meshcore nodes. I guess that this is something that others also want, and I can write an implementation of this if the proposal is acceptable. The idea is that we expose new CLI commands that lets you set/retieve the values of a GPIO-pin. This is something that I want to implement on all roles.
I want to make some new defines:
GPIO_IN
GPIO_OUT
GPIO_DAC
GPIO_ADC
These defines is a comma-separated list of GPIO-pins that is accessible using the CLI. If a define is not present, then there will be no corresponding GPIO for that type.
Then I want to extend mesh::MainBoard in src/MeshCore.h with some new member functions. These should be overridden at the board type (ESP32 etc).
class MainBoard {
public:
virtual bool setGPIO(int pin, bool newState) = 0; // returns true if the pin was set
virtual bool setDAC(int pin, float value) = 0; // returns true if the pin was set
virtual bool getGPIO(int pin); // return the value, or false if the pin does not exist
virutal float getADC(int pin); // returns the value, or 0
}
I know that getGpio() and setGpio() is defined in MainBoard already, and probably it would be a good idea to use them. I just don't know the consequence yet of using these.
I have not a GPIO-init function here. I think that can be handled by the MainBoard subclass own setup/begin() function.
Then change the common CLI, add some new commands.
set gpio 1 1
get gpio 1
set gpio 2 3.43
If the GPIO is analog, use float values, for digital use 0 or 1.
Any thoughts?
- Vorherrschende Sprache
- C
- Sterne
- 3.9k
- Forks
- 1.5k
- Ø Merge
- 2 T. 20 Std.
- Gemergte PRs (30 T.)
- 36
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus meshcore-dev/MeshCore
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
meshcore-dev/MeshCore#3760 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 67/100
meshcore-dev/MeshCore#3698 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 63/100
meshcore-dev/MeshCore#3622 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Feature Request] Set Australia (Mid) Preset to automatically enable 2 byte default path hash sizeOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
meshcore-dev/MeshCore#3571 · 5 Reaktionen ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
meshcore-dev/MeshCore#3567 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in meshcore-dev/MeshCore
Ähnliche Issues
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 83/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
containers/bubblewrap#826 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Vulkan: create_device reads the device extension list after freeing it (random crash at start)Offen
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 62/100
Revivedx/SavageWindRecomp#488 ·
Maintainer antworten meist innerhalb von 1 Tag
-
needs-device
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
-
feature/themes QA/No release-notes/exclude tests tests/missing-coverage tests/test-quality
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
brave/brave-browser#60971 ·
Maintainer antworten meist innerhalb von 1 Tag