esp-sdr-zephyr
Raw I/Q receive and transmit on the ESP32-S3/C6 Wi-Fi radio, for Zephyr
Loading...
Searching...
No Matches
DAC-engine replay

Waveform loops at 80 or 40 MS/s through the modem DAC engine, ESP32-C5 (esp_sdr_replay.h, CONFIG_ESP_SDR_REPLAY). More...

Data Structures

struct  esp_sdr_replay_cfg

Macros

#define ESP_SDR_REPLAY_MAX   16383U

Functions

static uint32_t esp_sdr_replay_word (int32_t i, int32_t q)
uint32_t * esp_sdr_replay_buf (size_t *words)
 The sample buffer the engine plays from.
int esp_sdr_replay_start (const struct esp_sdr_replay_cfg *cfg)
 Turn the transmit chain on and start the engine.
int esp_sdr_replay_wait (uint32_t timeout_us, uint32_t *cycles)
 Wait for a finite replay to finish.
int esp_sdr_replay_restart (void)
 Start a finished replay again, with the same settings and samples.
uint32_t esp_sdr_replay_ctrl (void)
bool esp_sdr_replay_active (void)
void esp_sdr_replay_stop (void)
 Stop the engine, give the bank back and return to receive.

Detailed Description

Waveform loops at 80 or 40 MS/s through the modem DAC engine, ESP32-C5 (esp_sdr_replay.h, CONFIG_ESP_SDR_REPLAY).

Macro Definition Documentation

◆ ESP_SDR_REPLAY_MAX

#define ESP_SDR_REPLAY_MAX   16383U

Largest number of words in one pass (the engine's 14-bit count).

Function Documentation

◆ esp_sdr_replay_active()

bool esp_sdr_replay_active ( void )
Returns
Whether a replay holds the radio.

◆ esp_sdr_replay_buf()

uint32_t * esp_sdr_replay_buf ( size_t * words)

The sample buffer the engine plays from.

Parameters
wordsSet to its size in words.
Returns
The buffer; write it only while no replay runs.

◆ esp_sdr_replay_ctrl()

uint32_t esp_sdr_replay_ctrl ( void )
Returns
The trigger register as last read (bench use).

◆ esp_sdr_replay_restart()

int esp_sdr_replay_restart ( void )

Start a finished replay again, with the same settings and samples.

The output pauses between the done flag and the restart (see doc/hardware-quirks.md). Interrupts should be locked around wait and restart.

Returns
0, or -EINVAL for no replay.

◆ esp_sdr_replay_start()

int esp_sdr_replay_start ( const struct esp_sdr_replay_cfg * cfg)

Turn the transmit chain on and start the engine.

Holds the radio until esp_sdr_replay_stop(), at the frequency set with esp_sdr_set_freq().

Returns
0, -EINVAL for a bad setting, -EAGAIN before esp_sdr_init(), -EBUSY while a replay runs, -ERANGE for a frequency the chain cannot take.

◆ esp_sdr_replay_wait()

int esp_sdr_replay_wait ( uint32_t timeout_us,
uint32_t * cycles )

Wait for a finite replay to finish.

Parameters
timeout_usLongest wait.
cyclesSet to the CPU cycles from the start to the done flag (esp_sdr_paced_cycles() clock); may be NULL.
Returns
0, -ETIMEDOUT, or -EINVAL for no replay or an endless one.

◆ esp_sdr_replay_word()

uint32_t esp_sdr_replay_word ( int32_t i,
int32_t q )
inlinestatic
Returns
DAC word for I and Q, each -511 to 511 (clamped): I in bits 9:0, Q in 19:10.