summaryrefslogtreecommitdiff
path: root/firmware/c1224/src/common/modem_probe.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/modem_probe.c
Initial pushmain
Diffstat (limited to 'firmware/c1224/src/common/modem_probe.c')
-rw-r--r--firmware/c1224/src/common/modem_probe.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/firmware/c1224/src/common/modem_probe.c b/firmware/c1224/src/common/modem_probe.c
new file mode 100644
index 0000000..33b58e4
--- /dev/null
+++ b/firmware/c1224/src/common/modem_probe.c
@@ -0,0 +1,38 @@
+/*
+ * Offline health check — CDT+RXD readable; crystal_steer no-op applied.
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+#include "modem_probe.h"
+#include "config.h"
+#include "board_pins.h"
+#include "crystal_steer.h"
+#include "hardware/gpio.h"
+#include "pico/stdlib.h"
+#include <stdio.h>
+
+modem_probe_result_t modem_probe_run(void)
+{
+ modem_probe_result_t r = {0};
+
+ crystal_steer_apply();
+ r.crystal_driven = crystal_steer_applied();
+
+ (void)gpio_get(PIN_MODEM_CDT);
+ (void)gpio_get(PIN_MODEM_RXD);
+ r.cdt_readable = true;
+ r.rxd_readable = true;
+
+ /* Optional TXD pulse — no CDT reaction required offline */
+ gpio_put(PIN_MODEM_TXD, 1);
+ sleep_ms(1);
+ gpio_put(PIN_MODEM_TXD, 0);
+
+ r.ready = r.crystal_driven && r.cdt_readable && r.rxd_readable;
+
+ if (config_unsolicited_ok()) {
+ printf("PROBE crystal=%d cdt=%d rxd=%d -> %s\r\n",
+ (int)r.crystal_driven, (int)r.cdt_readable, (int)r.rxd_readable,
+ r.ready ? "READY" : "FAULT");
+ }
+ return r;
+}
git clone -b <branch> https://cgit.mode42.com/<repo>.git
git clone -b <branch> git://cgit.mode42.com/<repo>.git

info@mode42.com