libbladeRF  2.2.1
Nuand bladeRF library
libbladeRF.h
Go to the documentation of this file.
1 
22 #ifndef LIBBLADERF_H_
23 #define LIBBLADERF_H_
24 
25 #include <inttypes.h>
26 #include <stdint.h>
27 #include <stdlib.h>
28 
54 #define LIBBLADERF_API_VERSION (0x02020100)
55 
56 #ifdef __cplusplus
57 extern "C" {
58 #else
59 
67 #include <stdbool.h>
68 #endif
69 
70 // clang-format off
71 #if defined _WIN32 || defined __CYGWIN__
72 # include <windows.h>
73 # define CALL_CONV __cdecl
74 # ifdef __GNUC__
75 # define API_EXPORT __attribute__ ((dllexport))
76 # else
77 # define API_EXPORT __declspec(dllexport)
78 # endif
79 #elif defined _DOXYGEN_ONLY_ || defined MATLAB_LINUX_THUNK_BUILD_
80 
82 # define API_EXPORT
83 
85 # define CALL_CONV
86 #else
87 # define API_EXPORT __attribute__ ((visibility ("default")))
88 # define CALL_CONV
89 #endif
90 // clang-format on
91 
107 struct bladerf;
108 
112 typedef enum {
120 
122 #define BLADERF_DESCRIPTION_LENGTH 33
123 
125 #define BLADERF_SERIAL_LENGTH 33
126 
134  uint8_t usb_bus;
135  uint8_t usb_addr;
136  unsigned int instance;
141 };
142 
201 int CALL_CONV bladerf_open(struct bladerf **device,
202  const char *device_identifier);
203 
215 void CALL_CONV bladerf_close(struct bladerf *device);
216 
239 int CALL_CONV bladerf_open_with_devinfo(struct bladerf **device,
240  struct bladerf_devinfo *devinfo);
241 
252 
260 
271 
283 int CALL_CONV bladerf_get_devinfo(struct bladerf *dev,
284  struct bladerf_devinfo *info);
285 
299 int CALL_CONV bladerf_get_devinfo_from_str(const char *devstr,
300  struct bladerf_devinfo *info);
301 
311  const struct bladerf_devinfo *b);
312 
324 bool CALL_CONV bladerf_devstr_matches(const char *dev_str,
325  struct bladerf_devinfo *info);
326 
336 
351 void CALL_CONV bladerf_set_usb_reset_on_open(bool enabled);
352 
370  int64_t min;
371  int64_t max;
372  int64_t step;
373  float scale;
374 };
375 
381 };
382 
387  uint16_t major;
388  uint16_t minor;
389  uint16_t patch;
390  const char *describe;
395 };
396 
400 typedef enum {
407 
412 typedef enum {
413  BLADERF_DEVICE_SPEED_UNKNOWN,
414  BLADERF_DEVICE_SPEED_HIGH,
415  BLADERF_DEVICE_SPEED_SUPER
417 
424 typedef enum {
429 
445 int CALL_CONV bladerf_get_serial(struct bladerf *dev, char *serial);
446 
470 int CALL_CONV bladerf_get_serial_struct(struct bladerf *dev,
471  struct bladerf_serial *serial);
472 
483 int CALL_CONV bladerf_get_fpga_size(struct bladerf *dev,
484  bladerf_fpga_size *size);
485 
496 int CALL_CONV bladerf_get_fpga_bytes(struct bladerf *dev, size_t *size);
497 
512 int CALL_CONV bladerf_get_flash_size(struct bladerf *dev,
513  uint32_t *size,
514  bool *is_guess);
515 
526 int CALL_CONV bladerf_fw_version(struct bladerf *dev,
527  struct bladerf_version *version);
528 
538 int CALL_CONV bladerf_is_fpga_configured(struct bladerf *dev);
539 
549 int CALL_CONV bladerf_fpga_version(struct bladerf *dev,
550  struct bladerf_version *version);
551 
567 int CALL_CONV bladerf_get_fpga_source(struct bladerf *dev,
568  bladerf_fpga_source *source);
569 
578 bladerf_dev_speed CALL_CONV bladerf_device_speed(struct bladerf *dev);
579 
589 const char *CALL_CONV bladerf_get_board_name(struct bladerf *dev);
590 
624 typedef int bladerf_channel;
625 
639 #define BLADERF_CHANNEL_RX(ch) (bladerf_channel)(((ch) << 1) | 0x0)
640 
654 #define BLADERF_CHANNEL_TX(ch) (bladerf_channel)(((ch) << 1) | 0x1)
655 
659 #define BLADERF_CHANNEL_INVALID (bladerf_channel)(-1)
660 
662 #define BLADERF_DIRECTION_MASK (0x1)
663 
666 /* Backwards compatible mapping to `bladerf_module`. */
667 typedef bladerf_channel bladerf_module;
668 #define BLADERF_MODULE_INVALID BLADERF_CHANNEL_INVALID
669 #define BLADERF_MODULE_RX BLADERF_CHANNEL_RX(0)
670 #define BLADERF_MODULE_TX BLADERF_CHANNEL_TX(0)
671 
676 #define BLADERF_CHANNEL_IS_TX(ch) (ch & BLADERF_TX)
677 
681 typedef enum {
685 
689 typedef enum {
695 
705 size_t CALL_CONV bladerf_get_channel_count(struct bladerf *dev,
706  bladerf_direction dir);
707 
723 typedef int bladerf_gain;
724 
735 typedef enum {
745 
751 
758 
765 
773 
775 #define BLADERF_GAIN_AUTOMATIC BLADERF_GAIN_DEFAULT
776 
777 #define BLADERF_GAIN_MANUAL BLADERF_GAIN_MGC
778 
783  const char *name;
784  bladerf_gain_mode mode;
785 };
786 
813 int CALL_CONV bladerf_set_gain(struct bladerf *dev,
814  bladerf_channel ch,
815  bladerf_gain gain);
816 
827 int CALL_CONV bladerf_get_gain(struct bladerf *dev,
828  bladerf_channel ch,
829  bladerf_gain *gain);
830 
850 int CALL_CONV bladerf_set_gain_mode(struct bladerf *dev,
851  bladerf_channel ch,
852  bladerf_gain_mode mode);
853 
868 int CALL_CONV bladerf_get_gain_mode(struct bladerf *dev,
869  bladerf_channel ch,
870  bladerf_gain_mode *mode);
871 
891 int CALL_CONV bladerf_get_gain_modes(struct bladerf *dev,
892  bladerf_channel ch,
893  const struct bladerf_gain_modes **modes);
894 
908 int CALL_CONV bladerf_get_gain_range(struct bladerf *dev,
909  bladerf_channel ch,
910  const struct bladerf_range **range);
911 
925 int CALL_CONV bladerf_set_gain_stage(struct bladerf *dev,
926  bladerf_channel ch,
927  const char *stage,
928  bladerf_gain gain);
929 
943 int CALL_CONV bladerf_get_gain_stage(struct bladerf *dev,
944  bladerf_channel ch,
945  const char *stage,
946  bladerf_gain *gain);
947 
965 int CALL_CONV bladerf_get_gain_stage_range(struct bladerf *dev,
966  bladerf_channel ch,
967  const char *stage,
968  const struct bladerf_range **range);
969 
985 int CALL_CONV bladerf_get_gain_stages(struct bladerf *dev,
986  bladerf_channel ch,
987  const char **stages,
988  size_t count);
989 
1006 typedef unsigned int bladerf_sample_rate;
1007 
1017  uint64_t integer;
1018  uint64_t num;
1019  uint64_t den;
1021 };
1022 
1040 API_EXPORT
1041 int CALL_CONV bladerf_set_sample_rate(struct bladerf *dev,
1042  bladerf_channel ch,
1043  bladerf_sample_rate rate,
1044  bladerf_sample_rate *actual);
1045 
1060 API_EXPORT
1061 int CALL_CONV
1062  bladerf_set_rational_sample_rate(struct bladerf *dev,
1063  bladerf_channel ch,
1064  struct bladerf_rational_rate *rate,
1065  struct bladerf_rational_rate *actual);
1075 API_EXPORT
1076 int CALL_CONV bladerf_get_sample_rate(struct bladerf *dev,
1077  bladerf_channel ch,
1078  bladerf_sample_rate *rate);
1079 
1089 API_EXPORT
1090 int CALL_CONV bladerf_get_sample_rate_range(struct bladerf *dev,
1091  bladerf_channel ch,
1092  const struct bladerf_range **range);
1093 
1103 API_EXPORT
1104 int CALL_CONV
1105  bladerf_get_rational_sample_rate(struct bladerf *dev,
1106  bladerf_channel ch,
1107  struct bladerf_rational_rate *rate);
1108 
1126 typedef unsigned int bladerf_bandwidth;
1127 
1146 API_EXPORT
1147 int CALL_CONV bladerf_set_bandwidth(struct bladerf *dev,
1148  bladerf_channel ch,
1149  bladerf_bandwidth bandwidth,
1150  bladerf_bandwidth *actual);
1151 
1161 API_EXPORT
1162 int CALL_CONV bladerf_get_bandwidth(struct bladerf *dev,
1163  bladerf_channel ch,
1164  bladerf_bandwidth *bandwidth);
1165 
1175 API_EXPORT
1176 int CALL_CONV bladerf_get_bandwidth_range(struct bladerf *dev,
1177  bladerf_channel ch,
1178  const struct bladerf_range **range);
1179 
1204 typedef uint64_t bladerf_frequency;
1205 
1207 #define BLADERF_PRIuFREQ PRIu64
1208 
1209 #define BLADERF_PRIxFREQ PRIx64
1210 
1211 #define BLADERF_SCNuFREQ SCNu64
1212 
1213 #define BLADERF_SCNxFREQ SCNx64
1214 
1233 API_EXPORT
1234 int CALL_CONV bladerf_select_band(struct bladerf *dev,
1235  bladerf_channel ch,
1236  bladerf_frequency frequency);
1237 
1261 API_EXPORT
1262 int CALL_CONV bladerf_set_frequency(struct bladerf *dev,
1263  bladerf_channel ch,
1264  bladerf_frequency frequency);
1274 API_EXPORT
1275 int CALL_CONV bladerf_get_frequency(struct bladerf *dev,
1276  bladerf_channel ch,
1277  bladerf_frequency *frequency);
1278 
1288 API_EXPORT
1289 int CALL_CONV bladerf_get_frequency_range(struct bladerf *dev,
1290  bladerf_channel ch,
1291  const struct bladerf_range **range);
1292 
1313 typedef enum {
1316 
1319 
1322 
1325 
1328 
1331 
1337 
1343 
1349 
1353 
1358  const char *name;
1359  bladerf_loopback mode;
1360 };
1361 
1377 API_EXPORT
1379  struct bladerf *dev, const struct bladerf_loopback_modes **modes);
1380 
1390  struct bladerf *dev, bladerf_loopback mode);
1391 
1405 API_EXPORT
1406 int CALL_CONV bladerf_set_loopback(struct bladerf *dev, bladerf_loopback lb);
1407 
1416 API_EXPORT
1417 int CALL_CONV bladerf_get_loopback(struct bladerf *dev, bladerf_loopback *lb);
1418 
1542 typedef enum {
1545 
1551 
1557 
1565 
1581 typedef enum {
1596 
1605  bladerf_channel channel;
1606  bladerf_trigger_role role;
1607  bladerf_trigger_signal signal;
1608  uint64_t options;
1610 };
1611 
1627 API_EXPORT
1628 int CALL_CONV bladerf_trigger_init(struct bladerf *dev,
1629  bladerf_channel ch,
1630  bladerf_trigger_signal signal,
1631  struct bladerf_trigger *trigger);
1632 
1653 API_EXPORT
1654 int CALL_CONV bladerf_trigger_arm(struct bladerf *dev,
1655  const struct bladerf_trigger *trigger,
1656  bool arm,
1657  uint64_t resv1,
1658  uint64_t resv2);
1659 
1671 API_EXPORT
1672 int CALL_CONV bladerf_trigger_fire(struct bladerf *dev,
1673  const struct bladerf_trigger *trigger);
1674 
1694 API_EXPORT
1695 int CALL_CONV bladerf_trigger_state(struct bladerf *dev,
1696  const struct bladerf_trigger *trigger,
1697  bool *is_armed,
1698  bool *has_fired,
1699  bool *fire_requested,
1700  uint64_t *resv1,
1701  uint64_t *resv2);
1702 
1719 typedef enum {
1722 
1725 
1732 
1739 
1740  /* RX_MUX setting 0x3 is reserved for future use */
1741 
1744 } bladerf_rx_mux;
1745 
1747 /* Backwards compatible mapping for `bladerf_rx_mux`. */
1748 #define BLADERF_RX_MUX_BASEBAND_LMS BLADERF_RX_MUX_BASEBAND
1749 
1759 API_EXPORT
1760 int CALL_CONV bladerf_set_rx_mux(struct bladerf *dev, bladerf_rx_mux mux);
1761 
1770 API_EXPORT
1771 int CALL_CONV bladerf_get_rx_mux(struct bladerf *dev, bladerf_rx_mux *mode);
1772 
1793 typedef uint64_t bladerf_timestamp;
1794 
1799 #define BLADERF_RETUNE_NOW (bladerf_timestamp)0
1800 
1811  union {
1812  /* bladeRF1 quick tune parameters */
1813  struct {
1814  uint8_t freqsel;
1815  uint8_t vcocap;
1816  uint16_t nint;
1817  uint32_t nfrac;
1818  uint8_t flags;
1819  uint8_t xb_gpio;
1820  };
1821  /* bladeRF2 quick tune parameters */
1822  struct {
1823  uint16_t nios_profile;
1824  uint8_t rffe_profile;
1825  uint8_t port;
1826  uint8_t spdt;
1827  };
1828  };
1829 };
1830 
1860 API_EXPORT
1861 int CALL_CONV bladerf_schedule_retune(struct bladerf *dev,
1862  bladerf_channel ch,
1863  bladerf_timestamp timestamp,
1864  bladerf_frequency frequency,
1865  struct bladerf_quick_tune *quick_tune);
1866 
1879 API_EXPORT
1880 int CALL_CONV bladerf_cancel_scheduled_retunes(struct bladerf *dev,
1881  bladerf_channel ch);
1882 
1903 API_EXPORT
1904 int CALL_CONV bladerf_get_quick_tune(struct bladerf *dev,
1905  bladerf_channel ch,
1906  struct bladerf_quick_tune *quick_tune);
1907 
1929 
1939 typedef enum {
1945 
1951 
1957 
1964 
1966 /* Backwards compatible mapping to `bladerf_correction`. */
1967 #define BLADERF_CORR_LMS_DCOFF_I BLADERF_CORR_DCOFF_I
1968 #define BLADERF_CORR_LMS_DCOFF_Q BLADERF_CORR_DCOFF_Q
1969 #define BLADERF_CORR_FPGA_PHASE BLADERF_CORR_PHASE
1970 #define BLADERF_CORR_FPGA_GAIN BLADERF_CORR_GAIN
1971 
1986 API_EXPORT
1987 int CALL_CONV bladerf_set_correction(struct bladerf *dev,
1988  bladerf_channel ch,
1989  bladerf_correction corr,
1990  bladerf_correction_value value);
1991 
2002 API_EXPORT
2003 int CALL_CONV bladerf_get_correction(struct bladerf *dev,
2004  bladerf_channel ch,
2005  bladerf_correction corr,
2006  bladerf_correction_value *value);
2007 
2021 #define BLADERF_PRIuTS PRIu64
2022 
2023 #define BLADERF_PRIxTS PRIx64
2024 
2025 #define BLADERF_SCNuTS SCNu64
2026 
2027 #define BLADERF_SCNxTS SCNx64
2028 
2040 typedef enum {
2097 
2133 } bladerf_format;
2134 
2141 /*
2142  * Metadata status bits
2143  *
2144  * These are used in conjunction with the bladerf_metadata structure's `status`
2145  * field.
2146  */
2147 
2154 #define BLADERF_META_STATUS_OVERRUN (1 << 0)
2155 
2164 #define BLADERF_META_STATUS_UNDERRUN (1 << 1)
2165 
2166 /*
2167  * Metadata flags
2168  *
2169  * These are used in conjunction with the bladerf_metadata structure's `flags`
2170  * field.
2171  */
2172 
2187 #define BLADERF_META_FLAG_TX_BURST_START (1 << 0)
2188 
2215 #define BLADERF_META_FLAG_TX_BURST_END (1 << 1)
2216 
2225 #define BLADERF_META_FLAG_TX_NOW (1 << 2)
2226 
2245 #define BLADERF_META_FLAG_TX_UPDATE_TIMESTAMP (1 << 3)
2246 
2252 #define BLADERF_META_FLAG_RX_NOW (1 << 31)
2253 
2258 #define BLADERF_META_FLAG_RX_HW_UNDERFLOW (1 << 0)
2259 
2264 #define BLADERF_META_FLAG_RX_HW_MINIEXP1 (1 << 16)
2265 
2270 #define BLADERF_META_FLAG_RX_HW_MINIEXP2 (1 << 17)
2271 
2284  bladerf_timestamp timestamp;
2285 
2298  uint32_t flags;
2299 
2307  uint32_t status;
2308 
2322  unsigned int actual_count;
2323 
2328  uint8_t reserved[32];
2329 };
2330 
2377 API_EXPORT
2379  bladerf_format format,
2380  unsigned int buffer_size,
2381  void *samples);
2382 
2405 API_EXPORT
2407  bladerf_format format,
2408  unsigned int buffer_size,
2409  void *samples);
2410 
2433 API_EXPORT
2434 int CALL_CONV bladerf_enable_module(struct bladerf *dev,
2435  bladerf_channel ch,
2436  bool enable);
2437 
2479 API_EXPORT
2480 int CALL_CONV bladerf_get_timestamp(struct bladerf *dev,
2481  bladerf_direction dir,
2482  bladerf_timestamp *timestamp);
2483 
2553 API_EXPORT
2554 int CALL_CONV bladerf_sync_config(struct bladerf *dev,
2555  bladerf_channel_layout layout,
2556  bladerf_format format,
2557  unsigned int num_buffers,
2558  unsigned int buffer_size,
2559  unsigned int num_transfers,
2560  unsigned int stream_timeout);
2561 
2595 API_EXPORT
2596 int CALL_CONV bladerf_sync_tx(struct bladerf *dev,
2597  const void *samples,
2598  unsigned int num_samples,
2599  struct bladerf_metadata *metadata,
2600  unsigned int timeout_ms);
2601 
2635 API_EXPORT
2636 int CALL_CONV bladerf_sync_rx(struct bladerf *dev,
2637  void *samples,
2638  unsigned int num_samples,
2639  struct bladerf_metadata *metadata,
2640  unsigned int timeout_ms);
2641 
2642 
2665 #define BLADERF_STREAM_SHUTDOWN (NULL)
2666 
2672 #define BLADERF_STREAM_NO_DATA ((void *)(-1))
2673 
2675 struct bladerf_stream;
2676 
2724 typedef void *(*bladerf_stream_cb)(struct bladerf *dev,
2725  struct bladerf_stream *stream,
2726  struct bladerf_metadata *meta,
2727  void *samples,
2728  size_t num_samples,
2729  void *user_data);
2730 
2793 API_EXPORT
2794 int CALL_CONV bladerf_init_stream(struct bladerf_stream **stream,
2795  struct bladerf *dev,
2796  bladerf_stream_cb callback,
2797  void ***buffers,
2798  size_t num_buffers,
2799  bladerf_format format,
2800  size_t samples_per_buffer,
2801  size_t num_transfers,
2802  void *user_data);
2803 
2824 API_EXPORT
2825 int CALL_CONV bladerf_stream(struct bladerf_stream *stream,
2826  bladerf_channel_layout layout);
2827 
2855 API_EXPORT
2857  void *buffer,
2858  unsigned int timeout_ms);
2859 
2877 API_EXPORT
2879  void *buffer);
2880 
2881 
2893 API_EXPORT
2894 void CALL_CONV bladerf_deinit_stream(struct bladerf_stream *stream);
2895 
2905 API_EXPORT
2906 int CALL_CONV bladerf_set_stream_timeout(struct bladerf *dev,
2907  bladerf_direction dir,
2908  unsigned int timeout);
2909 
2920 API_EXPORT
2921 int CALL_CONV bladerf_get_stream_timeout(struct bladerf *dev,
2922  bladerf_direction dir,
2923  unsigned int *timeout);
2924 
2954 API_EXPORT
2955 int CALL_CONV bladerf_flash_firmware(struct bladerf *dev, const char *firmware);
2956 
2967 API_EXPORT
2968 int CALL_CONV bladerf_load_fpga(struct bladerf *dev, const char *fpga);
2969 
2980 API_EXPORT
2981 int CALL_CONV bladerf_flash_fpga(struct bladerf *dev, const char *fpga_image);
2982 
2990 API_EXPORT
2991 int CALL_CONV bladerf_erase_stored_fpga(struct bladerf *dev);
2992 
3000 API_EXPORT
3001 int CALL_CONV bladerf_device_reset(struct bladerf *dev);
3002 
3012 API_EXPORT
3013 int CALL_CONV bladerf_get_fw_log(struct bladerf *dev, const char *filename);
3014 
3025 API_EXPORT
3026 int CALL_CONV bladerf_jump_to_bootloader(struct bladerf *dev);
3027 
3043 API_EXPORT
3045 
3069 API_EXPORT
3070 int CALL_CONV bladerf_load_fw_from_bootloader(const char *device_identifier,
3072  uint8_t bus,
3073  uint8_t addr,
3074  const char *file);
3075 
3090 typedef enum {
3104 
3106 #define BLADERF_IMAGE_MAGIC_LEN 7
3107 
3109 #define BLADERF_IMAGE_CHECKSUM_LEN 32
3110 
3112 #define BLADERF_IMAGE_RESERVED_LEN 128
3113 
3133  char magic[BLADERF_IMAGE_MAGIC_LEN + 1];
3134 
3139  uint8_t checksum[BLADERF_IMAGE_CHECKSUM_LEN];
3140 
3146  struct bladerf_version version;
3147 
3149  uint64_t timestamp;
3150 
3160 
3165 
3169  bladerf_image_type type;
3170 
3175  uint32_t address;
3176 
3178  uint32_t length;
3179 
3181  uint8_t *data;
3182 };
3183 
3207 API_EXPORT
3208 struct bladerf_image *CALL_CONV bladerf_alloc_image(struct bladerf *dev,
3209  bladerf_image_type type,
3210  uint32_t address,
3211  uint32_t length);
3212 
3226 API_EXPORT
3228  struct bladerf *dev, bladerf_fpga_size fpga_size, uint16_t vctcxo_trim);
3229 
3237 API_EXPORT
3238 void CALL_CONV bladerf_free_image(struct bladerf_image *image);
3239 
3255 API_EXPORT
3256 int CALL_CONV bladerf_image_write(struct bladerf *dev,
3257  struct bladerf_image *image,
3258  const char *file);
3259 
3281 API_EXPORT
3282 int CALL_CONV bladerf_image_read(struct bladerf_image *image, const char *file);
3283 
3315 typedef enum {
3318 
3321 
3324 
3328 
3337 API_EXPORT
3338 int CALL_CONV bladerf_set_vctcxo_tamer_mode(struct bladerf *dev,
3340 
3351 API_EXPORT
3352 int CALL_CONV bladerf_get_vctcxo_tamer_mode(struct bladerf *dev,
3354 
3375 API_EXPORT
3376 int CALL_CONV bladerf_get_vctcxo_trim(struct bladerf *dev, uint16_t *trim);
3377 
3388 API_EXPORT
3389 int CALL_CONV bladerf_trim_dac_write(struct bladerf *dev, uint16_t val);
3390 
3405 API_EXPORT
3406 int CALL_CONV bladerf_trim_dac_read(struct bladerf *dev, uint16_t *val);
3407 
3439 typedef enum {
3442 
3448 
3452 
3462 API_EXPORT
3463 int CALL_CONV bladerf_set_tuning_mode(struct bladerf *dev,
3464  bladerf_tuning_mode mode);
3465 
3474 API_EXPORT
3475 int CALL_CONV bladerf_get_tuning_mode(struct bladerf *dev,
3476  bladerf_tuning_mode *mode);
3477 
3500 #define BLADERF_TRIGGER_REG_ARM ((uint8_t)(1 << 0))
3501 
3511 #define BLADERF_TRIGGER_REG_FIRE ((uint8_t)(1 << 1))
3512 
3521 #define BLADERF_TRIGGER_REG_MASTER ((uint8_t)(1 << 2))
3522 
3529 #define BLADERF_TRIGGER_REG_LINE ((uint8_t)(1 << 3))
3530 
3543 API_EXPORT
3544 int CALL_CONV bladerf_read_trigger(struct bladerf *dev,
3545  bladerf_channel ch,
3546  bladerf_trigger_signal signal,
3547  uint8_t *val);
3548 
3560 API_EXPORT
3561 int CALL_CONV bladerf_write_trigger(struct bladerf *dev,
3562  bladerf_channel ch,
3563  bladerf_trigger_signal signal,
3564  uint8_t val);
3565 
3587 API_EXPORT
3588 int CALL_CONV bladerf_config_gpio_read(struct bladerf *dev, uint32_t *val);
3589 
3602 API_EXPORT
3603 int CALL_CONV bladerf_config_gpio_write(struct bladerf *dev, uint32_t val);
3604 
3640 API_EXPORT
3641 int CALL_CONV bladerf_erase_flash(struct bladerf *dev,
3642  uint32_t erase_block,
3643  uint32_t count);
3644 
3658 API_EXPORT
3659 int CALL_CONV bladerf_erase_flash_bytes(struct bladerf *dev,
3660  uint32_t address,
3661  uint32_t length);
3662 
3682 API_EXPORT
3683 int CALL_CONV bladerf_read_flash(struct bladerf *dev,
3684  uint8_t *buf,
3685  uint32_t page,
3686  uint32_t count);
3687 
3703 API_EXPORT
3704 int CALL_CONV bladerf_read_flash_bytes(struct bladerf *dev,
3705  uint8_t *buf,
3706  uint32_t address,
3707  uint32_t bytes);
3708 
3727 API_EXPORT
3728 int CALL_CONV bladerf_write_flash(struct bladerf *dev,
3729  const uint8_t *buf,
3730  uint32_t page,
3731  uint32_t count);
3732 
3747 API_EXPORT
3748 int CALL_CONV bladerf_write_flash_bytes(struct bladerf *dev,
3749  const uint8_t *buf,
3750  uint32_t address,
3751  uint32_t length);
3752 
3763 API_EXPORT
3764 int CALL_CONV bladerf_lock_otp(struct bladerf *dev);
3765 
3778 API_EXPORT
3779 int CALL_CONV bladerf_read_otp(struct bladerf *dev,
3780  uint8_t *buf);
3781 
3794 API_EXPORT
3795 int CALL_CONV bladerf_write_otp(struct bladerf *dev,
3796  uint8_t *buf);
3797 
3820 API_EXPORT
3821 int CALL_CONV bladerf_set_rf_port(struct bladerf *dev,
3822  bladerf_channel ch,
3823  const char *port);
3824 
3834 API_EXPORT
3835 int CALL_CONV bladerf_get_rf_port(struct bladerf *dev,
3836  bladerf_channel ch,
3837  const char **port);
3838 
3853 API_EXPORT
3854 int CALL_CONV bladerf_get_rf_ports(struct bladerf *dev,
3855  bladerf_channel ch,
3856  const char **ports,
3857  unsigned int count);
3858 
3884 typedef enum {
3892 } bladerf_xb;
3893 
3902 API_EXPORT
3903 int CALL_CONV bladerf_expansion_attach(struct bladerf *dev, bladerf_xb xb);
3904 
3913 API_EXPORT
3914 int CALL_CONV bladerf_expansion_get_attached(struct bladerf *dev,
3915  bladerf_xb *xb);
3916 
3933 typedef enum {
3942 
3951 API_EXPORT
3952 void CALL_CONV bladerf_log_set_verbosity(bladerf_log_level level);
3953 
3967 API_EXPORT
3969 
3988 // clang-format off
3989 #define BLADERF_ERR_UNEXPECTED (-1)
3990 #define BLADERF_ERR_RANGE (-2)
3991 #define BLADERF_ERR_INVAL (-3)
3992 #define BLADERF_ERR_MEM (-4)
3993 #define BLADERF_ERR_IO (-5)
3994 #define BLADERF_ERR_TIMEOUT (-6)
3995 #define BLADERF_ERR_NODEV (-7)
3996 #define BLADERF_ERR_UNSUPPORTED (-8)
3997 #define BLADERF_ERR_MISALIGNED (-9)
3998 #define BLADERF_ERR_CHECKSUM (-10)
3999 #define BLADERF_ERR_NO_FILE (-11)
4000 #define BLADERF_ERR_UPDATE_FPGA (-12)
4001 #define BLADERF_ERR_UPDATE_FW (-13)
4002 #define BLADERF_ERR_TIME_PAST (-14)
4003 #define BLADERF_ERR_QUEUE_FULL (-15)
4005 #define BLADERF_ERR_FPGA_OP (-16)
4006 #define BLADERF_ERR_PERMISSION (-17)
4008 #define BLADERF_ERR_WOULD_BLOCK (-18)
4013 #define BLADERF_ERR_NOT_INIT (-19)
4015 // clang-format on
4016 
4024 API_EXPORT
4025 const char *CALL_CONV bladerf_strerror(int error);
4026 
4029 #include <bladeRF1.h>
4030 #include <bladeRF2.h>
4031 
4032 #ifdef __cplusplus
4033 }
4034 #endif
4035 
4036 #endif /* LIBBLADERF_H_ */
uint8_t * data
Definition: libbladeRF.h:3181
API_EXPORT int CALL_CONV bladerf_lock_otp(struct bladerf *dev)
API_EXPORT int CALL_CONV bladerf_set_rx_mux(struct bladerf *dev, bladerf_rx_mux mux)
API_EXPORT const char *CALL_CONV bladerf_backend_str(bladerf_backend backend)
API_EXPORT int CALL_CONV bladerf_image_read(struct bladerf_image *image, const char *file)
API_EXPORT int CALL_CONV bladerf_get_correction(struct bladerf *dev, bladerf_channel ch, bladerf_correction corr, bladerf_correction_value *value)
bladerf_gain_mode
Definition: libbladeRF.h:735
API_EXPORT int CALL_CONV bladerf_get_gain_mode(struct bladerf *dev, bladerf_channel ch, bladerf_gain_mode *mode)
API_EXPORT int CALL_CONV bladerf_get_fpga_size(struct bladerf *dev, bladerf_fpga_size *size)
API_EXPORT int CALL_CONV bladerf_get_rx_mux(struct bladerf *dev, bladerf_rx_mux *mode)
bladerf_channel channel
Definition: libbladeRF.h:1605
API_EXPORT int CALL_CONV bladerf_write_otp(struct bladerf *dev, uint8_t *buf)
API_EXPORT bool CALL_CONV bladerf_devinfo_matches(const struct bladerf_devinfo *a, const struct bladerf_devinfo *b)
unsigned int instance
Definition: libbladeRF.h:136
API_EXPORT int CALL_CONV bladerf_get_tuning_mode(struct bladerf *dev, bladerf_tuning_mode *mode)
API_EXPORT int CALL_CONV bladerf_load_fpga(struct bladerf *dev, const char *fpga)
API_EXPORT int CALL_CONV bladerf_read_otp(struct bladerf *dev, uint8_t *buf)
uint16_t minor
Definition: libbladeRF.h:388
API_EXPORT void CALL_CONV bladerf_log_set_verbosity(bladerf_log_level level)
API_EXPORT void CALL_CONV bladerf_deinit_stream(struct bladerf_stream *stream)
API_EXPORT void CALL_CONV bladerf_set_usb_reset_on_open(bool enabled)
API_EXPORT void CALL_CONV bladerf_version(struct bladerf_version *version)
API_EXPORT int CALL_CONV bladerf_get_gain_stage_range(struct bladerf *dev, bladerf_channel ch, const char *stage, const struct bladerf_range **range)
bladerf_loopback
Definition: libbladeRF.h:1313
API_EXPORT int CALL_CONV bladerf_erase_flash(struct bladerf *dev, uint32_t erase_block, uint32_t count)
API_EXPORT int CALL_CONV bladerf_interleave_stream_buffer(bladerf_channel_layout layout, bladerf_format format, unsigned int buffer_size, void *samples)
int bladerf_channel
Definition: libbladeRF.h:624
API_EXPORT int CALL_CONV bladerf_get_rf_ports(struct bladerf *dev, bladerf_channel ch, const char **ports, unsigned int count)
API_EXPORT int CALL_CONV bladerf_get_stream_timeout(struct bladerf *dev, bladerf_direction dir, unsigned int *timeout)
bladerf_trigger_signal signal
Definition: libbladeRF.h:1607
API_EXPORT int CALL_CONV bladerf_set_rational_sample_rate(struct bladerf *dev, bladerf_channel ch, struct bladerf_rational_rate *rate, struct bladerf_rational_rate *actual)
bladerf_rx_mux
Definition: libbladeRF.h:1719
API_EXPORT bool CALL_CONV bladerf_is_loopback_mode_supported(struct bladerf *dev, bladerf_loopback mode)
bladerf_tuning_mode
Definition: libbladeRF.h:3439
uint16_t major
Definition: libbladeRF.h:387
API_EXPORT bool CALL_CONV bladerf_devstr_matches(const char *dev_str, struct bladerf_devinfo *info)
API_EXPORT int CALL_CONV bladerf_get_loopback_modes(struct bladerf *dev, const struct bladerf_loopback_modes **modes)
bladerf_fpga_source
Definition: libbladeRF.h:424
API_EXPORT int CALL_CONV bladerf_is_fpga_configured(struct bladerf *dev)
uint64_t bladerf_timestamp
Definition: libbladeRF.h:1793
bladerf_loopback mode
Definition: libbladeRF.h:1359
uint16_t nios_profile
Definition: libbladeRF.h:1823
API_EXPORT int CALL_CONV bladerf_get_devinfo_from_str(const char *devstr, struct bladerf_devinfo *info)
uint64_t timestamp
Definition: libbladeRF.h:3149
API_EXPORT int CALL_CONV bladerf_trigger_arm(struct bladerf *dev, const struct bladerf_trigger *trigger, bool arm, uint64_t resv1, uint64_t resv2)
API_EXPORT int CALL_CONV bladerf_get_sample_rate_range(struct bladerf *dev, bladerf_channel ch, const struct bladerf_range **range)
API_EXPORT int CALL_CONV bladerf_get_rf_port(struct bladerf *dev, bladerf_channel ch, const char **port)
API_EXPORT bladerf_dev_speed CALL_CONV bladerf_device_speed(struct bladerf *dev)
API_EXPORT int CALL_CONV bladerf_get_device_list(struct bladerf_devinfo **devices)
void *(* bladerf_stream_cb)(struct bladerf *dev, struct bladerf_stream *stream, struct bladerf_metadata *meta, void *samples, size_t num_samples, void *user_data)
Definition: libbladeRF.h:2724
#define BLADERF_DESCRIPTION_LENGTH
Definition: libbladeRF.h:122
API_EXPORT int CALL_CONV bladerf_get_flash_size(struct bladerf *dev, uint32_t *size, bool *is_guess)
API_EXPORT int CALL_CONV bladerf_set_sample_rate(struct bladerf *dev, bladerf_channel ch, bladerf_sample_rate rate, bladerf_sample_rate *actual)
API_EXPORT const char *CALL_CONV bladerf_strerror(int error)
API_EXPORT int CALL_CONV bladerf_trigger_init(struct bladerf *dev, bladerf_channel ch, bladerf_trigger_signal signal, struct bladerf_trigger *trigger)
API_EXPORT int CALL_CONV bladerf_fpga_version(struct bladerf *dev, struct bladerf_version *version)
bladerf_xb
Definition: libbladeRF.h:3884
char manufacturer[BLADERF_DESCRIPTION_LENGTH]
Definition: libbladeRF.h:139
API_EXPORT int CALL_CONV bladerf_get_quick_tune(struct bladerf *dev, bladerf_channel ch, struct bladerf_quick_tune *quick_tune)
uint8_t usb_bus
Definition: libbladeRF.h:134
uint16_t patch
Definition: libbladeRF.h:389
bladerf_vctcxo_tamer_mode
Definition: libbladeRF.h:3315
uint64_t options
Definition: libbladeRF.h:1608
API_EXPORT int CALL_CONV bladerf_get_rational_sample_rate(struct bladerf *dev, bladerf_channel ch, struct bladerf_rational_rate *rate)
API_EXPORT int CALL_CONV bladerf_cancel_scheduled_retunes(struct bladerf *dev, bladerf_channel ch)
API_EXPORT int CALL_CONV bladerf_set_frequency(struct bladerf *dev, bladerf_channel ch, bladerf_frequency frequency)
API_EXPORT int CALL_CONV bladerf_sync_tx(struct bladerf *dev, const void *samples, unsigned int num_samples, struct bladerf_metadata *metadata, unsigned int timeout_ms)
API_EXPORT int CALL_CONV bladerf_erase_flash_bytes(struct bladerf *dev, uint32_t address, uint32_t length)
bladerf_direction
Definition: libbladeRF.h:681
unsigned int bladerf_sample_rate
Definition: libbladeRF.h:1006
API_EXPORT int CALL_CONV bladerf_config_gpio_write(struct bladerf *dev, uint32_t val)
API_EXPORT int CALL_CONV bladerf_get_bandwidth_range(struct bladerf *dev, bladerf_channel ch, const struct bladerf_range **range)
API_EXPORT int CALL_CONV bladerf_get_fpga_source(struct bladerf *dev, bladerf_fpga_source *source)
API_EXPORT int CALL_CONV bladerf_set_bandwidth(struct bladerf *dev, bladerf_channel ch, bladerf_bandwidth bandwidth, bladerf_bandwidth *actual)
API_EXPORT int CALL_CONV bladerf_read_flash(struct bladerf *dev, uint8_t *buf, uint32_t page, uint32_t count)
bladerf_image_type
Definition: libbladeRF.h:3090
API_EXPORT int CALL_CONV bladerf_image_write(struct bladerf *dev, struct bladerf_image *image, const char *file)
API_EXPORT int CALL_CONV bladerf_read_trigger(struct bladerf *dev, bladerf_channel ch, bladerf_trigger_signal signal, uint8_t *val)
API_EXPORT int CALL_CONV bladerf_trigger_fire(struct bladerf *dev, const struct bladerf_trigger *trigger)
API_EXPORT int CALL_CONV bladerf_jump_to_bootloader(struct bladerf *dev)
API_EXPORT int CALL_CONV bladerf_get_vctcxo_tamer_mode(struct bladerf *dev, bladerf_vctcxo_tamer_mode *mode)
API_EXPORT int CALL_CONV bladerf_read_flash_bytes(struct bladerf *dev, uint8_t *buf, uint32_t address, uint32_t bytes)
bladerf_fpga_size
Definition: libbladeRF.h:400
API_EXPORT int CALL_CONV bladerf_flash_firmware(struct bladerf *dev, const char *firmware)
API_EXPORT int CALL_CONV bladerf_set_gain_mode(struct bladerf *dev, bladerf_channel ch, bladerf_gain_mode mode)
uint64_t bladerf_frequency
Definition: libbladeRF.h:1204
API_EXPORT int CALL_CONV bladerf_flash_fpga(struct bladerf *dev, const char *fpga_image)
API_EXPORT int CALL_CONV bladerf_get_bootloader_list(struct bladerf_devinfo **list)
API_EXPORT int CALL_CONV bladerf_schedule_retune(struct bladerf *dev, bladerf_channel ch, bladerf_timestamp timestamp, bladerf_frequency frequency, struct bladerf_quick_tune *quick_tune)
bladerf_format
Definition: libbladeRF.h:2040
uint8_t usb_addr
Definition: libbladeRF.h:135
bladerf_backend
Definition: libbladeRF.h:112
API_EXPORT struct bladerf_image *CALL_CONV bladerf_alloc_cal_image(struct bladerf *dev, bladerf_fpga_size fpga_size, uint16_t vctcxo_trim)
unsigned int bladerf_bandwidth
Definition: libbladeRF.h:1126
API_EXPORT int CALL_CONV bladerf_set_loopback(struct bladerf *dev, bladerf_loopback lb)
API_EXPORT int CALL_CONV bladerf_set_gain(struct bladerf *dev, bladerf_channel ch, bladerf_gain gain)
API_EXPORT const char *CALL_CONV bladerf_get_board_name(struct bladerf *dev)
#define BLADERF_IMAGE_CHECKSUM_LEN
Definition: libbladeRF.h:3109
API_EXPORT int CALL_CONV bladerf_set_gain_stage(struct bladerf *dev, bladerf_channel ch, const char *stage, bladerf_gain gain)
API_EXPORT int CALL_CONV bladerf_device_reset(struct bladerf *dev)
API_EXPORT size_t CALL_CONV bladerf_get_channel_count(struct bladerf *dev, bladerf_direction dir)
API_EXPORT int CALL_CONV bladerf_set_vctcxo_tamer_mode(struct bladerf *dev, bladerf_vctcxo_tamer_mode mode)
API_EXPORT int CALL_CONV bladerf_submit_stream_buffer_nb(struct bladerf_stream *stream, void *buffer)
bladerf_log_level
Definition: libbladeRF.h:3933
API_EXPORT int CALL_CONV bladerf_get_gain_range(struct bladerf *dev, bladerf_channel ch, const struct bladerf_range **range)
API_EXPORT int CALL_CONV bladerf_open(struct bladerf **device, const char *device_identifier)
char product[BLADERF_DESCRIPTION_LENGTH]
Definition: libbladeRF.h:140
API_EXPORT int CALL_CONV bladerf_expansion_get_attached(struct bladerf *dev, bladerf_xb *xb)
API_EXPORT int CALL_CONV bladerf_init_stream(struct bladerf_stream **stream, struct bladerf *dev, bladerf_stream_cb callback, void ***buffers, size_t num_buffers, bladerf_format format, size_t samples_per_buffer, size_t num_transfers, void *user_data)
API_EXPORT int CALL_CONV bladerf_get_devinfo(struct bladerf *dev, struct bladerf_devinfo *info)
API_EXPORT void CALL_CONV bladerf_free_image(struct bladerf_image *image)
#define BLADERF_IMAGE_RESERVED_LEN
Definition: libbladeRF.h:3112
int16_t bladerf_correction_value
Definition: libbladeRF.h:1928
API_EXPORT int CALL_CONV bladerf_get_frequency_range(struct bladerf *dev, bladerf_channel ch, const struct bladerf_range **range)
API_EXPORT int CALL_CONV bladerf_stream(struct bladerf_stream *stream, bladerf_channel_layout layout)
API_EXPORT int CALL_CONV bladerf_fw_version(struct bladerf *dev, struct bladerf_version *version)
bladerf_trigger_signal
Definition: libbladeRF.h:1581
#define CALL_CONV
Definition: libbladeRF.h:85
API_EXPORT int CALL_CONV bladerf_write_trigger(struct bladerf *dev, bladerf_channel ch, bladerf_trigger_signal signal, uint8_t val)
API_EXPORT void CALL_CONV bladerf_init_devinfo(struct bladerf_devinfo *info)
API_EXPORT int CALL_CONV bladerf_get_vctcxo_trim(struct bladerf *dev, uint16_t *trim)
API_EXPORT int CALL_CONV bladerf_sync_config(struct bladerf *dev, bladerf_channel_layout layout, bladerf_format format, unsigned int num_buffers, unsigned int buffer_size, unsigned int num_transfers, unsigned int stream_timeout)
API_EXPORT int CALL_CONV bladerf_get_serial(struct bladerf *dev, char *serial)
API_EXPORT int CALL_CONV bladerf_erase_stored_fpga(struct bladerf *dev)
API_EXPORT int CALL_CONV bladerf_get_gain_stages(struct bladerf *dev, bladerf_channel ch, const char **stages, size_t count)
API_EXPORT int CALL_CONV bladerf_write_flash_bytes(struct bladerf *dev, const uint8_t *buf, uint32_t address, uint32_t length)
bladeRF2-specific API
API_EXPORT int CALL_CONV bladerf_get_gain(struct bladerf *dev, bladerf_channel ch, bladerf_gain *gain)
API_EXPORT int CALL_CONV bladerf_write_flash(struct bladerf *dev, const uint8_t *buf, uint32_t page, uint32_t count)
bladerf_backend backend
Definition: libbladeRF.h:131
unsigned int actual_count
Definition: libbladeRF.h:2322
API_EXPORT int CALL_CONV bladerf_trim_dac_read(struct bladerf *dev, uint16_t *val)
API_EXPORT int CALL_CONV bladerf_get_timestamp(struct bladerf *dev, bladerf_direction dir, bladerf_timestamp *timestamp)
API_EXPORT int CALL_CONV bladerf_select_band(struct bladerf *dev, bladerf_channel ch, bladerf_frequency frequency)
uint32_t address
Definition: libbladeRF.h:3175
API_EXPORT void CALL_CONV bladerf_free_device_list(struct bladerf_devinfo *devices)
bladeRF1-specific API
bladerf_gain_mode mode
Definition: libbladeRF.h:784
#define API_EXPORT
Definition: libbladeRF.h:82
const char * describe
Definition: libbladeRF.h:390
bladerf_timestamp timestamp
Definition: libbladeRF.h:2284
API_EXPORT struct bladerf_image *CALL_CONV bladerf_alloc_image(struct bladerf *dev, bladerf_image_type type, uint32_t address, uint32_t length)
API_EXPORT int CALL_CONV bladerf_get_gain_modes(struct bladerf *dev, bladerf_channel ch, const struct bladerf_gain_modes **modes)
API_EXPORT int CALL_CONV bladerf_get_sample_rate(struct bladerf *dev, bladerf_channel ch, bladerf_sample_rate *rate)
bladerf_trigger_role role
Definition: libbladeRF.h:1606
API_EXPORT int CALL_CONV bladerf_deinterleave_stream_buffer(bladerf_channel_layout layout, bladerf_format format, unsigned int buffer_size, void *samples)
API_EXPORT int CALL_CONV bladerf_get_fpga_bytes(struct bladerf *dev, size_t *size)
API_EXPORT int CALL_CONV bladerf_get_frequency(struct bladerf *dev, bladerf_channel ch, bladerf_frequency *frequency)
#define BLADERF_SERIAL_LENGTH
Definition: libbladeRF.h:125
API_EXPORT int CALL_CONV bladerf_config_gpio_read(struct bladerf *dev, uint32_t *val)
API_EXPORT int CALL_CONV bladerf_set_stream_timeout(struct bladerf *dev, bladerf_direction dir, unsigned int timeout)
int64_t min
Definition: libbladeRF.h:370
API_EXPORT int CALL_CONV bladerf_open_with_devinfo(struct bladerf **device, struct bladerf_devinfo *devinfo)
int64_t max
Definition: libbladeRF.h:371
const char * name
Definition: libbladeRF.h:783
API_EXPORT int CALL_CONV bladerf_enable_module(struct bladerf *dev, bladerf_channel ch, bool enable)
API_EXPORT int CALL_CONV bladerf_set_tuning_mode(struct bladerf *dev, bladerf_tuning_mode mode)
API_EXPORT int CALL_CONV bladerf_get_bandwidth(struct bladerf *dev, bladerf_channel ch, bladerf_bandwidth *bandwidth)
bladerf_dev_speed
Definition: libbladeRF.h:412
bladerf_trigger_role
Definition: libbladeRF.h:1542
API_EXPORT void CALL_CONV bladerf_close(struct bladerf *device)
struct bladerf_version version
Definition: libbladeRF.h:3146
API_EXPORT int CALL_CONV bladerf_get_loopback(struct bladerf *dev, bladerf_loopback *lb)
API_EXPORT int CALL_CONV bladerf_trigger_state(struct bladerf *dev, const struct bladerf_trigger *trigger, bool *is_armed, bool *has_fired, bool *fire_requested, uint64_t *resv1, uint64_t *resv2)
bladerf_correction
Definition: libbladeRF.h:1939
bladerf_image_type type
Definition: libbladeRF.h:3169
API_EXPORT int CALL_CONV bladerf_load_fw_from_bootloader(const char *device_identifier, bladerf_backend backend, uint8_t bus, uint8_t addr, const char *file)
int64_t step
Definition: libbladeRF.h:372
API_EXPORT int CALL_CONV bladerf_submit_stream_buffer(struct bladerf_stream *stream, void *buffer, unsigned int timeout_ms)
bladerf_channel_layout
Definition: libbladeRF.h:689
char serial[BLADERF_SERIAL_LENGTH]
Definition: libbladeRF.h:133
API_EXPORT int CALL_CONV bladerf_set_correction(struct bladerf *dev, bladerf_channel ch, bladerf_correction corr, bladerf_correction_value value)
API_EXPORT int CALL_CONV bladerf_set_rf_port(struct bladerf *dev, bladerf_channel ch, const char *port)
uint32_t length
Definition: libbladeRF.h:3178
API_EXPORT int CALL_CONV bladerf_sync_rx(struct bladerf *dev, void *samples, unsigned int num_samples, struct bladerf_metadata *metadata, unsigned int timeout_ms)
int bladerf_gain
Definition: libbladeRF.h:723
API_EXPORT int CALL_CONV bladerf_trim_dac_write(struct bladerf *dev, uint16_t val)
API_EXPORT int CALL_CONV bladerf_expansion_attach(struct bladerf *dev, bladerf_xb xb)
API_EXPORT int CALL_CONV bladerf_get_gain_stage(struct bladerf *dev, bladerf_channel ch, const char *stage, bladerf_gain *gain)
API_EXPORT int CALL_CONV bladerf_get_fw_log(struct bladerf *dev, const char *filename)
#define BLADERF_IMAGE_MAGIC_LEN
Definition: libbladeRF.h:3106
API_EXPORT int CALL_CONV bladerf_get_serial_struct(struct bladerf *dev, struct bladerf_serial *serial)