Files
rockblock9704-zephyr/src/rb9704_internal.h
T
scottp 0cda7335d6 The modem's UART heard from boot, and the Stamp-C3 under the sky
The module turned the modem UART's receive interrupt off whenever the
library was closed. With the power pins wired, the modem sends about
500 bytes of boot lines as it comes up, to nobody; on the M5Stamp-C3
they overflowed the UART's 128-byte FIFO, after which begin heard only
repeated fragments of old lines and failed with -EIO, and a second
begin crashed the board in the library's line parser (docs/JSPR.md,
section 8, item 2). The interrupt is now on from boot: bytes heard while
the library is closed are thrown away, and when it opens part-way
through a line the rest of that line is too. On the Stamp, 8 of 8 power
cycles and 12 of 12 with 0 to 5 s between power on and begin, where 1 of
6 and none had worked.

The fake modem's raw and before commands write any bytes, now or just
ahead of its next reply, and test_a_boot_burst_while_closed sends a
680-byte boot burst before begin: that overflow on a board through the
rig, a check that it does no harm on native_sim.

docs/boards/stamp_c3.md records the first run under open sky: the
constellation visible and 3 to 5 bars within seconds of begin. It also
records what is open: on the Stamp's 5V the modem stopped answering 2 to
5 minutes after each begin, four times, indoors and out, most likely
its supply; not yet measured, and the tests that would settle it are
listed there. Not yet provisioned, and no message sent.
2026-10-25 22:21:17 +11:00

35 lines
923 B
C

/* SPDX-License-Identifier: MIT
* Copyright (c) 2026 Scott Penrose <scottp@dd.com.au>
*
* rb9704_internal.h - between this module's own files.
*/
#ifndef RB9704_INTERNAL_H_
#define RB9704_INTERNAL_H_
#include <stdbool.h>
#include <stdint.h>
#include <zephyr/devicetree.h>
#include <zephyr/kernel.h>
#define RB9704_NODE DT_COMPAT_GET_ANY_STATUS_OKAY(rock7_rockblock_9704)
/* rb9704_serial.c */
/* The receive interrupt, on from boot (rb9704_serial.c says why). */
int rb9704_serial_start(void);
int rb9704_serial_available(void);
uint32_t rb9704_serial_dropped(void);
void rb9704_serial_spy(bool on);
/* rb9704_worker.c */
k_tid_t rb9704_worker_tid_get(void);
void rb9704_worker_rx(void);
/* rb9704_power.c, or the stubs in rb9704_worker.c without the pins */
int rb9704_power_init(void);
int rb9704_power_set(bool on);
bool rb9704_power_on(void);
bool rb9704_power_present(void);
#endif /* RB9704_INTERNAL_H_ */