36#ifndef ESP_SDR_ESP_SDR_PACED_H_
37#define ESP_SDR_ESP_SDR_PACED_H_
53#define ESP_SDR_PACED_INPUT_HZ 80000000U
144#if defined(CONFIG_SOC_SERIES_ESP32C6)
146 __asm__
volatile(
"csrr %0, 0x7e2" :
"=r"(v));
148 __asm__
volatile(
"csrr %0, cycle" :
"=r"(v));
156#if defined(CONFIG_SOC_SERIES_ESP32C6)
158 __asm__
volatile(
"csrw 0x7e0, %0" ::
"r"(1));
159 __asm__
volatile(
"csrw 0x7e1, %0" ::
"r"(1));
bool(* esp_sdr_tx_paced_input_t)(void *user, int16_t *i, int16_t *q)
Definition esp_sdr_paced.h:108
uint32_t esp_sdr_rx_paced_fill_iq8(int8_t *out, size_t n, unsigned int shift)
Produce the next n receive samples as they fall due, as 8-bit I, Q pairs. The tight form of esp_sdr_r...
bool esp_sdr_rx_paced_poll(int32_t *i, int32_t *q)
Produce the next receive sample if it is due.
void esp_sdr_tx_paced_stop(void)
Turn the transmit chain off and release the radio; no-op when stopped.
uint32_t esp_sdr_paced_deadline(void)
When the running stream's next sample is due, on esp_sdr_paced_cycles().
unsigned int esp_sdr_tx_paced_power_max(void)
Highest power step: 2 dB per step of the vendor tone's backoff (none on the C5, S31).
static uint32_t esp_sdr_paced_cycles(void)
The CPU cycle counter the paced streams run on (inlined into IRAM loops).
Definition esp_sdr_paced.h:140
void esp_sdr_paced_get_stats(struct esp_sdr_paced_stats *stats)
Statistics of the running or last stream.
void esp_sdr_rx_paced_stop(void)
Stop receiving and release the radio; no-op when stopped.
int esp_sdr_rx_paced_start(uint32_t rate_hz)
Start receiving at rate_hz.
bool esp_sdr_tx_paced_poll(void)
Write the next DAC value if it is due, then compute the one after.
int esp_sdr_tx_paced_start(uint32_t rate_hz, unsigned int interp, unsigned int power, esp_sdr_tx_paced_input_t input, void *user)
Turn the transmit chain on at the current frequency and start playing input at rate_hz.
void esp_sdr_paced_sync(void)
Restart the running stream's clock: the next sample is due one period from now. Call once interrupts ...
static void esp_sdr_paced_cycles_enable(void)
Make esp_sdr_paced_cycles() count CPU cycles (a stream's start does it too).
Definition esp_sdr_paced.h:154
Definition esp_sdr_paced.h:55
uint32_t events
Definition esp_sdr_paced.h:63
uint64_t samples
Definition esp_sdr_paced.h:57
uint32_t late_max
Definition esp_sdr_paced.h:61
uint32_t late
Definition esp_sdr_paced.h:59