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.h
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: GPL-3.0-or-later
3 */
4
14
15#ifndef ESP_SDR_ESP_SDR_H_
16#define ESP_SDR_ESP_SDR_H_
17
18#include <stdbool.h>
19#include <stddef.h>
20#include <stdint.h>
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
30
39#define ESP_SDR_FREQ_MIN_MHZ 100U
40#define ESP_SDR_FREQ_MAX_MHZ 6000U
41
43#define ESP_SDR_SAMPLES_MIN 256U
44#define ESP_SDR_SAMPLES_MAX 16380U
45
47#if defined(CONFIG_ESP_SDR_BANK1)
48#define ESP_SDR_BANKS 2
49#else
50#define ESP_SDR_BANKS 1
51#endif
52
58#ifndef ESP_SDR_HIGH_RAM
59#define ESP_SDR_HIGH_RAM __attribute__((section(".esp_sdr_high")))
60#endif
61
67#ifndef ESP_SDR_HIGH_BUF_DEFINE
68#define ESP_SDR_HIGH_BUF_DEFINE(type, name, dims, align) \
69 static type name dims __aligned(align) ESP_SDR_HIGH_RAM
70#endif
71
73#ifndef ESP_SDR_HIGH_STACK_DEFINE
74#define ESP_SDR_HIGH_STACK_DEFINE(name, size) \
75 static Z_KERNEL_STACK_DEFINE_IN(name, size, ESP_SDR_HIGH_RAM)
76#endif
77
85 ESP_SDR_RATE_80MSPS = 0,
86 ESP_SDR_RATE_40MSPS = 1,
87 ESP_SDR_RATE_20MSPS = 2,
88 ESP_SDR_RATE_10MSPS = 3,
89 ESP_SDR_RATE_8MSPS = 4,
90 ESP_SDR_RATE_4MSPS = 5,
91 ESP_SDR_RATE_16MSPS = 6,
92};
93
96 int16_t i;
97 int16_t q;
98};
99
110int esp_sdr_init(void);
111
127int esp_sdr_set_freq(uint32_t mhz);
128
130uint32_t esp_sdr_get_freq(void);
131
141int esp_sdr_set_freq_offset(int32_t khz);
142
153int esp_sdr_set_channel_bw(unsigned int cbw);
154
158 uint32_t dac_sessions, gain_refreshed, gain_apply_us;
159};
160
163
170int esp_sdr_bbtop_read(unsigned int reg);
171void esp_sdr_bbtop_write(unsigned int reg, unsigned int val);
172
185int esp_sdr_set_turnaround(uint32_t settle_us, bool retune);
186
188
189#ifdef __cplusplus
190}
191#endif
192
193#include <esp_sdr/esp_sdr_rx.h>
194#include <esp_sdr/esp_sdr_tx.h>
195
196#endif /* ESP_SDR_ESP_SDR_H_ */
ESP-SDR receive: gain, analog low-pass, burst and decimated capture.
ESP-SDR transmit: power steps, one-shot DAC playback and sweeps, and the streaming interface with its...
int esp_sdr_set_freq_offset(int32_t khz)
Set a PLL offset in kHz and retune.
int esp_sdr_init(void)
Bring the radio up and tune it to the default frequency.
void esp_sdr_get_stats(struct esp_sdr_stats *stats)
int esp_sdr_bbtop_read(unsigned int reg)
Read or write a register of the analog baseband (I2C block 0x67), for characterization.
int esp_sdr_set_channel_bw(unsigned int cbw)
Set the channel bandwidth flag of the vendor tuning call (experimental).
uint32_t esp_sdr_get_freq(void)
int esp_sdr_set_turnaround(uint32_t settle_us, bool retune)
Set the front end turnaround between transmit and receive.
esp_sdr_rate
Definition esp_sdr.h:84
int esp_sdr_set_freq(uint32_t mhz)
Tune the LO, shared by receive and transmit.
Definition esp_sdr.h:95
Definition esp_sdr.h:156
uint32_t dac_sessions
Definition esp_sdr.h:158