STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
self_test_devices.h
Go to the documentation of this file.
1#ifndef STAR_SELF_TEST_DEVICES_H
2#define STAR_SELF_TEST_DEVICES_H
3
4#include "self_test_port.h"
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
20
21#define SELF_TEST_DEVICE_ENABLED(id) (UINT32_C(1) << (id))
22#define SELF_TEST_DIAG_IDENTITY 0x10000
23#define SELF_TEST_DIAG_BLANK_PROM 0x20000
24#define SELF_TEST_DIAG_PROM_CRC 0x30000
25#define SELF_TEST_DIAG_RADIO_STATUS 0x40000
26#define SELF_TEST_DIAG_RADIO_ERRORS 0x50000
27
28typedef struct {
29 uint8_t tx[4];
30 uint8_t rx[4];
31 uint8_t length;
33
34/* One synchronous batch: separate CS assertion for EACH frame, no writes to
35 * device registers, 8-bit MSB-first full duplex. The adapter must enforce mode,
36 * max_hz and a TOTAL budget including locks, BUSY waits and every frame. PASS
37 * means all RX bytes were acquired. Release CS/locks/transfers on every return.
38 * Radio commands require BUSY low before each frame. No wake/reset is allowed.
39 * Incompatible/uninitialized hardware returns NOT_CONFIGURED. A driver service
40 * may return PENDING only without leaving a transaction owned by this call.
41 */
43 void* context, uint16_t device_id, uint8_t mode, uint32_t max_hz,
44 self_test_spi_frame_t* frames, uint8_t count, uint32_t budget_ms);
45
46typedef struct {
49 /* Opt in only after board routing, power/reset/startup and SPI setup are
50 * verified. MS5611 must have completed its startup reset/PROM reload;
51 * SX1262 must already be awake. Zero means no device is configured. */
53 /* Private scratch; one owner, no reentry. Keep off a small RTOS stack. */
56
57/* Directly usable as self_test_port_t.probe, with self_test_devices_t context.
58 * Battery/publication wrappers may compose this context into a board context.
59 * No state survives a call except scratch; coordinator reset needs no cleanup.
60 */
61self_test_reply_t self_test_devices_probe(void* context, uint16_t device_id,
62 uint8_t attempt, uint32_t now_ms,
63 uint32_t budget_ms);
64
65#ifdef __cplusplus
66}
67#endif
68#endif
size_type count(const key_type &key) const
Definition json.hpp:19264
self_test_device_id_t
@ SELF_TEST_DEVICE_ETHERNET
@ SELF_TEST_DEVICE_IMU
@ SELF_TEST_DEVICE_GNSS
@ SELF_TEST_DEVICE_HIGH_G
@ SELF_TEST_DEVICE_NAND
@ SELF_TEST_DEVICE_RADIO
@ SELF_TEST_DEVICE_BAROMETER
@ SELF_TEST_DEVICE_EMMC
self_test_reply_t(* self_test_spi_exchange_t)(void *context, uint16_t device_id, uint8_t mode, uint32_t max_hz, self_test_spi_frame_t *frames, uint8_t count, uint32_t budget_ms)
self_test_reply_t self_test_devices_probe(void *context, uint16_t device_id, uint8_t attempt, uint32_t now_ms, uint32_t budget_ms)
self_test_spi_exchange_t exchange
self_test_spi_frame_t frames[8]