17#include <zephyr/device.h>
30 const void *data,
size_t len);
37int esdr_fpga_read(
const struct device *dev,
const void *head,
size_t head_len,
void *rx,
57int esdr_fpga_palette(
const struct device *dev, uint8_t first,
const uint16_t *rgb565,
size_t n);
132float esdr_fpga_l_to_db(int16_t l);
int esdr_fpga_wf_line(const struct device *dev, const uint8_t *idx, size_t n)
A new waterfall line on top: n palette indices, one per column.
int esdr_fpga_reg_read(const struct device *dev, uint16_t addr, uint16_t *words, size_t n)
Read n words (at most 2046) from addr on.
int esdr_fpga_palette(const struct device *dev, uint8_t first, const uint16_t *rgb565, size_t n)
Load n RGB565 palette entries from first on.
int esdr_fpga_waterfall(const struct device *dev, uint16_t x, uint16_t y, uint16_t w, uint16_t h)
Place the waterfall: w columns (at most 320) of h rows; w = 0 turns it off.
int esdr_fpga_dsp_run(const struct device *dev, bool on, const struct esdr_fpga_dsp *cfg)
Start or stop the DSP chain; starting restarts the average.
int esdr_fpga_samples(const struct device *dev, uint8_t format, bool resync, const void *data, size_t len)
Samples for the DSP: format one of ESDR_FPGA_FMT_*, resync starts a new frame at the first of them.
void esdr_fpga_set_read_frequency(const struct device *dev, uint32_t hz)
Change the read clock (tests; the default comes from devicetree).
int esdr_fpga_dsp_columns(const struct device *dev, int16_t *l, size_t n)
The last line's levels per column, in L units (esdr_fpga_l_to_db()).
int esdr_fpga_read(const struct device *dev, const void *head, size_t head_len, void *rx, size_t len)
One read frame at the read clock: send head, then receive len bytes.
int esdr_fpga_redraw(const struct device *dev, bool waterfall, bool spectrum)
Redraw regions now (or at the next TE).
int esdr_fpga_reg_write(const struct device *dev, uint16_t addr, const uint16_t *words, size_t n)
Write n words to the gateware's registers from addr on.
int esdr_fpga_render(const struct device *dev, bool on, bool te_sync, bool line_dirty)
Start or stop the renderer.
bool esdr_fpga_loaded(const struct device *dev)
Whether the FPGA (the parent lattice,ice40-fpga device) has a bitstream.
int esdr_fpga_dsp_config(const struct device *dev, const struct esdr_fpga_dsp *cfg)
Load window, average table and scales (dB relative to a full-scale tone).
int esdr_fpga_columns(const struct device *dev, const uint8_t *rows, size_t n)
New trace: the row (0 at the top) of each of n columns; redraws the trace.
int16_t esdr_fpga_db_to_l(float db)
dB to the gateware's level units (256 log2 of power) and back.
int esdr_fpga_write(const struct device *dev, const void *head, size_t head_len, const void *data, size_t len)
One write frame: head then data (either may be empty) under one CS assertion.
int esdr_fpga_spectrum(const struct device *dev, uint16_t x, uint16_t y, uint16_t w, uint16_t h, const struct esdr_fpga_trace *t)
Place the spectrum trace; w = 0 turns it off.
The DSP chain's settings.
Definition esdr_fpga.h:97
float alpha
Definition esdr_fpga.h:101
float full_scale
Definition esdr_fpga.h:111
uint16_t zoom_step
Definition esdr_fpga.h:105
float tr_top_db
Definition esdr_fpga.h:108
uint8_t window
Definition esdr_fpga.h:99
uint8_t log2n
Definition esdr_fpga.h:98
float wf_min_db
Definition esdr_fpga.h:106
float wf_max_db
Definition esdr_fpga.h:107
uint16_t cols
Definition esdr_fpga.h:103
float tr_bottom_db
Definition esdr_fpga.h:109
bool overlap
Definition esdr_fpga.h:100
uint16_t tr_rows
Definition esdr_fpga.h:110
uint8_t frames_per_line
Definition esdr_fpga.h:102
uint16_t zoom_start
Definition esdr_fpga.h:104
The spectrum trace's look.
Definition esdr_fpga.h:67
uint8_t flags
Definition esdr_fpga.h:68