summaryrefslogtreecommitdiff
path: root/firmware/c1224/include/afsk_bitbang.h
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/include/afsk_bitbang.h
Initial pushmain
Diffstat (limited to 'firmware/c1224/include/afsk_bitbang.h')
-rw-r--r--firmware/c1224/include/afsk_bitbang.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/firmware/c1224/include/afsk_bitbang.h b/firmware/c1224/include/afsk_bitbang.h
new file mode 100644
index 0000000..886b912
--- /dev/null
+++ b/firmware/c1224/include/afsk_bitbang.h
@@ -0,0 +1,30 @@
+/**
+ * Bitbang / timed NRZI on TCM3105 TXD (GP6) and RXD (GP7).
+ * Rate matches stuffed crystal — compile C1224_BITRATE=1200|2400.
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+#ifndef C1224_AFSK_BITBANG_H
+#define C1224_AFSK_BITBANG_H
+
+#include <stddef.h>
+#include <stdint.h>
+#include <stdbool.h>
+
+#ifndef C1224_BITRATE
+#define C1224_BITRATE 1200
+#endif
+
+void afsk_bitbang_init(void);
+
+/** Transmit HDLC info payload (AX.25 frame without flags/FCS). Auto-PTT. */
+bool afsk_tx_frame(const uint8_t *info, size_t info_len);
+
+/** Poll RX sampler; call often from main loop. May emit via callback. */
+typedef void (*afsk_rx_frame_fn)(const uint8_t *info, size_t len);
+void afsk_rx_set_callback(afsk_rx_frame_fn fn);
+void afsk_rx_poll(void);
+
+bool afsk_tx_busy(void);
+unsigned afsk_bitrate(void);
+
+#endif /* C1224_AFSK_BITBANG_H */
git clone -b <branch> https://cgit.mode42.com/<repo>.git
git clone -b <branch> git://cgit.mode42.com/<repo>.git

info@mode42.com