Gapless 40 MS/s receive through the modem diagnostic bus and PARLIO, ESP32-C5 (esp_sdr_diag.h, CONFIG_ESP_SDR_DIAG).
More...
Gapless 40 MS/s receive through the modem diagnostic bus and PARLIO, ESP32-C5 (esp_sdr_diag.h, CONFIG_ESP_SDR_DIAG).
◆ ESP_SDR_DIAG_BLOCK
| #define ESP_SDR_DIAG_BLOCK 8192U |
Bytes per sink call: the unit of the ring.
◆ ESP_SDR_DIAG_DECIM_MIN
| #define ESP_SDR_DIAG_DECIM_MIN 8U |
◆ ESP_SDR_DIAG_LSB_AUTO
| #define ESP_SDR_DIAG_LSB_AUTO 0xffU |
cfg.lsb: pick the nibble window from the signal level at the start.
◆ ESP_SDR_DIAG_LSB_MAX
| #define ESP_SDR_DIAG_LSB_MAX 6U |
Highest nibble window start: I[9:6].
◆ ESP_SDR_DIAG_PINS
| #define ESP_SDR_DIAG_PINS 8U |
Data lines (PARLIO RX width on the C5).
◆ ESP_SDR_DIAG_RING
| #define ESP_SDR_DIAG_RING 57344U |
Ring size in bytes: 7 blocks, 1.43 ms at 40 MB/s.
◆ esp_sdr_diag_iq_sink_t
| typedef void(* esp_sdr_diag_iq_sink_t) (void *user, const int32_t *iq, size_t n, uint64_t index) |
Receives decimated I/Q, called four times per ring block (every 51 us at 40 MB/s).
- Parameters
-
| user | cfg.iq_user. |
| iq | n interleaved I, Q pairs, valid only during the call, in raw 10-bit counts times 16 (full scale +-8192), a boxcar of 16 and a third-order CIC of cfg.decim down from 40 MS/s. |
| n | Complex samples in this call (0 to 17). |
| index | Index of the first sample since the start; a jump means blocks were skipped. |
◆ esp_sdr_diag_sink_t
| typedef void(* esp_sdr_diag_sink_t) (void *user, const uint8_t *blk, size_t n, uint64_t index) |
Receives one block.
- Parameters
-
| user | cfg.user. |
| blk | ESP_SDR_DIAG_BLOCK bytes, valid only during the call. |
| n | Block size in bytes. |
| index | Byte index of the block since the start; a jump from the previous index plus size means the consumer fell behind and blocks were skipped. |
◆ esp_sdr_diag_active()
| bool esp_sdr_diag_active |
( |
void | | ) |
|
◆ esp_sdr_diag_level()
| int esp_sdr_diag_level |
( |
uint8_t * | lsb | ) |
|
The nibble window start that fits the current signal.
One 10-bit snapshot; the lowest start that does not wrap at the 99.9 % point of the I and Q magnitudes.
- Parameters
-
| lsb | Set to 0 to ESP_SDR_DIAG_LSB_MAX. |
- Returns
- 0, or the error of esp_sdr_rx_capture().
◆ esp_sdr_diag_run()
Run the ring until the time is up, esp_sdr_diag_stop() or an overrun.
Takes the radio, and SRAM bank 1, for the whole run. The receiver keeps its frequency, gain and filter. Needs the bank usage of the capture engine, so it cannot run with esp_sdr_rx_capture() on another thread.
- Returns
- 0, -EINVAL for a bad configuration, -EAGAIN before esp_sdr_init(), -EBUSY when already running, -EOVERFLOW when the interrupt could not keep up with the ring (stats->overrun).