Files
hardware/firmware/test/Makefile
T
Claude 5f7698895c firmware: phone-line stick (PS_BOARD=line), Si3056 DAA over USB
pico-serial Line's firmware: a USB front end for its Si3056 + Si3018 DAA,
the modem itself being D-Modem on the host (SPEC-L.md).

- Si3056 bring-up: 48 MHz MCLK from the USB PLL on GPIO21, reset in
  serial mode 0, PLL1 N = 125 / M = 256, 9600 Hz, 16-bit mode, line side
  powered up; FDT checked.
- si3056.pio: the RP2040 as the serial port's slave; every word through
  the portable frame engine (daa_frame.c) from the PIO's interrupt.
  Register accesses ride in secondary frames (LSB flag, then FC pin).
- USB: one vendor interface shaped like the SmartUSB56's (alt 1:
  isochronous OUT/IN at 1 ms, IN lengths set by the codec's clock, and an
  interrupt endpoint for events), vendor requests for rate, hook, flash,
  line monitor, register access, status, reset, UF2; 1209:0002.
- Host tests (test_line.c): the frame engine against a model of the
  Si3056's serial port, the sample streams, the device logic; mutations
  of the frame engine are caught. PROTOCOL.md "Line stick" documents it
  for the host's driver; CI builds it.

Not yet run on hardware.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013PRsUCpxazyipPn5UGGkF8
2026-10-22 11:23:50 +00:00

32 lines
1.0 KiB
Makefile

# SPDX-License-Identifier: AGPL-3.0-only
# Copyright (C) 2026 Neo-Desktop
# Host tests for the portable core: make -C firmware/test
CFLAGS ?= -std=c11 -O1 -g -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -fsanitize=address,undefined
CORE = ../src/core/core.c ../src/core/autobaud.c
DEPS = $(CORE) $(wildcard ../src/core/*.h) fake_hal.h wave.h wave.c
all: test_core test_autobaud test_link test_line
test_core: test_core.c fake_hal.c $(DEPS)
$(CC) $(CFLAGS) -o $@ test_core.c fake_hal.c wave.c $(CORE) -lm
test_autobaud: test_autobaud.c $(DEPS)
$(CC) $(CFLAGS) -o $@ test_autobaud.c wave.c ../src/core/autobaud.c -lm
test_link: test_link.c fake_hal.c ../src/core/link.c $(DEPS)
$(CC) $(CFLAGS) -o $@ test_link.c fake_hal.c ../src/core/link.c $(CORE) -lm
LINE = ../src/core/daa_frame.c ../src/core/line_dev.c
test_line: test_line.c $(LINE) $(wildcard ../src/core/*.h)
$(CC) $(CFLAGS) -o $@ test_line.c $(LINE)
.PHONY: all run clean
run: all
./test_core
./test_autobaud
./test_link
./test_line
clean:
rm -f test_core test_autobaud test_link test_line