esp-sdr-zephyr
Raw I/Q receive and transmit on the ESP32-S3/C6 Wi-Fi radio, for Zephyr
Loading...
Searching...
No Matches
esp_sdr_ring_stage.h
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: GPL-3.0-or-later
3 */
4
26
27#ifndef ESP_SDR_RING_STAGE_H_
28#define ESP_SDR_RING_STAGE_H_
29
30#include <stdbool.h>
31#include <stddef.h>
32#include <stdint.h>
33
35#define ESP_SDR_STAGE_WORDS 16240U
36
40 uint32_t pos, rpos;
42 uint32_t holes;
44 uint64_t index;
46 uint32_t lapped;
48 uint32_t gen;
49};
50
56void esp_sdr_stage_init(bool halve);
57
60
62void esp_sdr_stage_sink(void *user, const int16_t *i, const int16_t *q, size_t n, uint64_t index);
63
71void esp_sdr_stage_put(const int16_t *iq, size_t n, uint64_t index);
72
74uint32_t esp_sdr_stage_written(void);
75
78
89uint32_t esp_sdr_stage_peek(struct esp_sdr_stage_reader *r, const uint32_t **w, uint64_t *index,
90 uint32_t max);
91
96bool esp_sdr_stage_advance(struct esp_sdr_stage_reader *r, uint32_t n);
97
98#endif /* ESP_SDR_RING_STAGE_H_ */
void esp_sdr_stage_init(bool halve)
Clear the stage before a capture; halve averages the outputs in pairs. Bank 2 must be the app's (no r...
uint32_t esp_sdr_stage_written(void)
Samples written since esp_sdr_stage_init(), modulo 2^32.
void esp_sdr_stage_run_start(void)
Before each esp_sdr_ring_run(): its output index starts at 0 again (a hole).
bool esp_sdr_stage_advance(struct esp_sdr_stage_reader *r, uint32_t n)
Done with n samples of the last peek. Returns false when the sink overwrote them meanwhile (the reade...
void esp_sdr_stage_sink(void *user, const int16_t *i, const int16_t *q, size_t n, uint64_t index)
The sink for esp_sdr_ring_cfg (user unused).
void esp_sdr_stage_reader_init(struct esp_sdr_stage_reader *r)
A reader at the oldest sample the stage holds now (before the run: at its start).
uint32_t esp_sdr_stage_peek(struct esp_sdr_stage_reader *r, const uint32_t **w, uint64_t *index, uint32_t max)
The samples after r's position that follow each other: up to max words, none past the stage's end or ...
void esp_sdr_stage_put(const int16_t *iq, size_t n, uint64_t index)
Samples into the stage from a writer of its own (the S31's dump ring decimator).
Definition esp_sdr_ring_stage.h:38
uint32_t gen
Definition esp_sdr_ring_stage.h:48
uint32_t lapped
Definition esp_sdr_ring_stage.h:46
uint64_t index
Definition esp_sdr_ring_stage.h:44
uint32_t pos
Definition esp_sdr_ring_stage.h:40
uint32_t holes
Definition esp_sdr_ring_stage.h:42