|
| int | esp_sdr_rx_set_gain (int index) |
| | Select hardware AGC or a fixed receive gain.
|
| int | esp_sdr_rx_get_gain (void) |
| int | esp_sdr_rx_gain_max (void) |
| int | esp_sdr_rx_set_bandwidth (uint32_t mhz) |
| | Select the analog low-pass filter by approximate bandwidth.
|
| void | esp_sdr_rx_bandwidth_range (uint32_t *min, uint32_t *max) |
| | Supported bandwidth range in MHz.
|
| int | esp_sdr_rx_set_lpf (int code) |
| | Select a raw low-pass filter capacitor code.
|
| int | esp_sdr_rx_get_lpf (void) |
| int | esp_sdr_rx_capture (enum esp_sdr_rate rate, size_t count, struct esp_sdr_rx_burst *burst) |
| | Capture one burst of complex samples.
|
| int | esp_sdr_rx_capture_iq (enum esp_sdr_rate rate, size_t count, struct esp_sdr_iq16 *out, uint64_t *first_ns) |
| | Capture one burst and convert it to I/Q (raw units, -512 to 511) under the radio lock.
|
| int | esp_sdr_rx_capture_bank (enum esp_sdr_rate rate, size_t count, int bank, struct esp_sdr_rx_burst *burst) |
| | Capture one burst into a chosen bank, like esp_sdr_rx_capture().
|
| int | esp_sdr_rx_capture_decimated (enum esp_sdr_rate rate, size_t count, unsigned int m, struct esp_sdr_iq16 *out, size_t max_out, size_t *n_out, uint64_t *first_ns) |
| | Capture a burst and decimate it with a third order CIC filter.
|
| int | esp_sdr_rx_capture_folded (enum esp_sdr_rate rate, size_t count, unsigned int n, struct esp_sdr_iq16 *out, size_t max_out, size_t *n_out, uint64_t *first_ns) |
| | Capture a burst and fold its spectrum by n: a power estimation mode.
|
| uint32_t | esp_sdr_rx_rate_hz (enum esp_sdr_rate rate) |
| static int16_t | esp_sdr_rx_i (uint32_t word) |
| static int16_t | esp_sdr_rx_q (uint32_t word) |
| size_t | esp_sdr_rx_pack_iq8 (const uint32_t *words, size_t count, uint8_t *out) |
| | Pack raw words to signed 8-bit I then Q (upper 8 of 10 bits).
|
| size_t | esp_sdr_rx_pack_iq10 (const uint32_t *words, size_t count, uint8_t *out) |
| | Pack raw words to the upstream packed 10-bit format.
|
| int esp_sdr_rx_capture_decimated |
( |
enum esp_sdr_rate | rate, |
|
|
size_t | count, |
|
|
unsigned int | m, |
|
|
struct esp_sdr_iq16 * | out, |
|
|
size_t | max_out, |
|
|
size_t * | n_out, |
|
|
uint64_t * | first_ns ) |
Capture a burst and decimate it with a third order CIC filter.
Captures count samples like esp_sdr_rx_capture(), then (still holding the radio lock) decimates by m into out, I and Q in the usual order. The first 3 outputs (filter settling) are dropped, so up to count / m - 3 samples come out. The CIC needs no multiplies per input sample but droops towards the band edge: -2.7 dB at a quarter of the output rate, -9.3 dB at 0.45 of it. Needs CONFIG_ESP_SDR_RX_DECIM.
- Parameters
-
| rate | Native sample rate. |
| count | Complex samples, ESP_SDR_SAMPLES_MIN to ESP_SDR_SAMPLES_MAX. |
| m | Decimation factor, ESP_SDR_RX_DECIM_MIN to ESP_SDR_RX_DECIM_MAX. |
| out | Output samples, full scale +-32767. |
| max_out | Capacity of out. |
| n_out | Set to the number of samples written. |
| first_ns | Set to the time of the first output sample (k_cycle_get_64() clock, ns). |
- Return values
-
| 0 | on success. |
| -EINVAL | for an unsupported rate, count or factor. |
| -EAGAIN | if esp_sdr_init() has not run. |
| -ETIMEDOUT | if the capture engine did not finish. |
| int esp_sdr_rx_capture_folded |
( |
enum esp_sdr_rate | rate, |
|
|
size_t | count, |
|
|
unsigned int | n, |
|
|
struct esp_sdr_iq16 * | out, |
|
|
size_t | max_out, |
|
|
size_t * | n_out, |
|
|
uint64_t * | first_ns ) |
Capture a burst and fold its spectrum by n: a power estimation mode.
Captures count samples like esp_sdr_rx_capture(), then (still holding the radio lock) sums n time-shifted blocks of count / n samples each, averaged back to the raw 10-bit scale, into out. This is decimation in frequency rather than in time: a tone originally at offset f reappears at f mod (rate / n), summed with every other tone an integer multiple of rate / n away, instead of being low-pass filtered out. The whole original band's power is represented at 1/n the data rate, so it suits a wideband power/occupancy survey; it does not suit recovering an individual signal, since two sources that land in the same fold group add instead of one of them surviving cleanly. Needs CONFIG_ESP_SDR_RX_DECIM.
- Parameters
-
| rate | Native sample rate. |
| count | Complex samples, ESP_SDR_SAMPLES_MIN to ESP_SDR_SAMPLES_MAX. |
| n | Fold factor, ESP_SDR_RX_FOLD_MIN to ESP_SDR_RX_FOLD_MAX. |
| out | Output samples, full scale +-511 (raw 10-bit, averaged not summed). |
| max_out | Capacity of out. |
| n_out | Set to the number of samples written (count / n). |
| first_ns | Set to the time of the first input sample in the burst. |
- Return values
-
| 0 | on success. |
| -EINVAL | for an unsupported rate, count or factor. |
| -EAGAIN | if esp_sdr_init() has not run. |
| -ETIMEDOUT | if the capture engine did not finish. |