summaryrefslogtreecommitdiff
path: root/firmware/c1224/src/common/ptt.c
diff options
context:
space:
mode:
authorinfo@mode42.com <info@mode42.com>2026-08-07 18:15:00 +0000
committerinfo@mode42.com <info@mode42.com>2026-08-07 18:15:00 +0000
commitd393e0c30192611d4cac65a5429fd7180ce1f49c (patch)
tree7e47bd930340c75c4802801a81f3bd17c2469d9f /firmware/c1224/src/common/ptt.c
Initial pushmain
Diffstat (limited to 'firmware/c1224/src/common/ptt.c')
-rw-r--r--firmware/c1224/src/common/ptt.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/firmware/c1224/src/common/ptt.c b/firmware/c1224/src/common/ptt.c
new file mode 100644
index 0000000..f54f221
--- /dev/null
+++ b/firmware/c1224/src/common/ptt.c
@@ -0,0 +1,31 @@
+/*
+ * PTT via Pico GPIO — host asserts over USB CDC (Type-A Path B), not softmodem.
+ * PIN_PTT_DRV = keying (required). PIN_LED_PTT = optional/spare TX LED mirror.
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+#include "ptt.h"
+#include "board_pins.h"
+#include "hardware/gpio.h"
+
+static bool g_ptt;
+
+void ptt_init(void)
+{
+ gpio_init(PIN_PTT_DRV);
+ gpio_set_dir(PIN_PTT_DRV, GPIO_OUT);
+ gpio_put(PIN_PTT_DRV, 0);
+ g_ptt = false;
+ gpio_put(PIN_LED_PTT, 0);
+}
+
+void ptt_set(bool on)
+{
+ g_ptt = on;
+ gpio_put(PIN_PTT_DRV, on ? 1 : 0);
+ gpio_put(PIN_LED_PTT, on ? 1 : 0);
+}
+
+bool ptt_get(void)
+{
+ return g_ptt;
+}
git clone -b <branch> https://cgit.mode42.com/<repo>.git
git clone -b <branch> git://cgit.mode42.com/<repo>.git

info@mode42.com