SDDC_Driver
Loading...
Searching...
No Matches
libsddc.h
1/*
2 * This file is part of SDDC_Driver.
3 *
4 * Copyright (C) 2020 - Fraco Venturi
5 * Copyright (C) 2020 - Howard Su
6 * Copyright (C) 2025 - RenardSpark
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22#ifndef __H_LIBSDDC
23#define __H_LIBSDDC
24
25#include <stdint.h>
26#include <stdbool.h>
27#include "types.h"
28#include "../Interface.h"
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34// --- Types --- //
35typedef void (*sddc_read_async_cb_t)(uint32_t data_size, const sddc_complex_t *data,
36 void *context);
37
39
40typedef struct sddc_device_t {
41 char product[32];
42 char serial_number[32];
44// --- //
45
46// --- Static functions --- //
47uint16_t sddc_get_device_count();
48sddc_err_t sddc_get_device(uint8_t dev_index, struct sddc_device_t *dev);
49// --- //
50
51// ----- libsddc ----- //
52
53
54
55
56// Init and destroy
57libsddc_handler_t sddc_create();
58sddc_err_t sddc_init(libsddc_handler_t, uint8_t dev_index);
59void sddc_destroy(libsddc_handler_t);
60
61
62
63
64sddc_err_t sddc_set_stream_callback(
66 sddc_read_async_cb_t callback,
67 void *callback_context);
68
69
70
71
72
73
74
75// --- Streaming --- //
76sddc_err_t sddc_start_streaming(libsddc_handler_t t);
77sddc_err_t sddc_stop_streaming(libsddc_handler_t t);
78
79// --- Hardware infos --- //
80RadioModel sddc_get_model(libsddc_handler_t t);
81const char* sddc_get_model_name(libsddc_handler_t t);
82uint16_t sddc_get_firmware(libsddc_handler_t t);
83// --- //
84
85// --- RF mode --- //
86sddc_rf_mode_t sddc_get_best_rf_mode(libsddc_handler_t t);
87sddc_rf_mode_t sddc_get_rf_mode(libsddc_handler_t t);
88sddc_err_t sddc_set_rf_mode(libsddc_handler_t t, sddc_rf_mode_t rf_mode);
89// --- //
90
91// --- ADC --- //
92uint32_t sddc_get_adc_sample_rate(libsddc_handler_t t);
93sddc_err_t sddc_set_adc_sample_rate(libsddc_handler_t t, uint32_t samplefreq);
94// --- //
95
96// --- Bias tee --- //
97bool sddc_get_biast_hf ();
98sddc_err_t sddc_set_biast_hv (bool new_state);
99bool sddc_get_biast_vhf();
100sddc_err_t sddc_set_biast_vhf(bool new_state);
101
102// --- RF/IF adjustments --- //
103int sddc_get_rf_gain_steps(libsddc_handler_t t, const float** steps);
104sddc_err_t sddc_set_rf_gain(libsddc_handler_t t, float gain);
105int sddc_get_if_gain_steps(libsddc_handler_t t, const float** steps);
106sddc_err_t sddc_set_if_gain(libsddc_handler_t t, float gain);
107
108// --- Tuner --- //
109uint32_t sddc_set_center_frequency(libsddc_handler_t t, uint32_t freq);
110
111// --- Misc --- //
112bool sddc_get_dither();
113sddc_err_t sddc_set_dither(libsddc_handler_t t, bool new_state);
114bool sddc_get_pga(libsddc_handler_t t);
115sddc_err_t sddc_set_pga(libsddc_handler_t t, bool new_state);
116bool sddc_get_rand(libsddc_handler_t t);
117sddc_err_t sddc_set_rand(libsddc_handler_t t, bool new_state);
118// --- //
119
120// --- LEDs --- //
121sddc_err_t sddc_set_led(libsddc_handler_t t, sddc_leds_t led, bool on);
122// --- //
123
124// --- r2iq only --- //
125sddc_err_t sddc_set_decimation(libsddc_handler_t t, uint8_t decimate);
126// --- //
127
128#ifdef __cplusplus
129}
130#endif
131
132#endif /* __LIBSDDC_H */
Definition libsddc.cpp:30
Definition libsddc.h:40