From a7362dc14bca1233eb34b41aefebe9cfb22684ac Mon Sep 17 00:00:00 2001 From: "info@mode42.com" Date: Fri, 7 Aug 2026 18:09:58 +0000 Subject: Initial push --- firmware/s1224/src/common/ptt.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 firmware/s1224/src/common/ptt.c (limited to 'firmware/s1224/src/common/ptt.c') diff --git a/firmware/s1224/src/common/ptt.c b/firmware/s1224/src/common/ptt.c new file mode 100644 index 0000000..f54f221 --- /dev/null +++ b/firmware/s1224/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; +} -- cgit v1.3.1