USRP Hardware Driver and USRP Manual  Version: 3.11.0.HEAD-0-gdca39145
UHD and USRP Manual
usrp.h
Go to the documentation of this file.
1 //
2 // Copyright 2015-2016 Ettus Research LLC
3 //
4 // SPDX-License-Identifier: GPL-3.0
5 //
6 
7 #ifndef INCLUDED_UHD_USRP_H
8 #define INCLUDED_UHD_USRP_H
9 
10 #include <uhd/config.h>
11 #include <uhd/error.h>
12 #include <uhd/types/metadata.h>
13 #include <uhd/types/ranges.h>
14 #include <uhd/types/sensors.h>
16 #include <uhd/types/tune_request.h>
17 #include <uhd/types/tune_result.h>
18 #include <uhd/types/usrp_info.h>
19 #include <uhd/usrp/mboard_eeprom.h>
20 #include <uhd/usrp/dboard_eeprom.h>
21 #include <uhd/usrp/subdev_spec.h>
22 /* version.hpp is safe to include in C: */
23 #include <uhd/version.hpp> /* Provides UHD_VERSION */
24 
25 #include <stdbool.h>
26 #include <stdlib.h>
27 #include <stdint.h>
28 #include <time.h>
29 
31 typedef struct {
32  size_t bitwidth;
33  bool readable;
34  bool writable;
36 
37 /*
38  * Streamers
39  */
40 
42 
45 typedef struct {
47  char* cpu_format;
49  char* otw_format;
51  char* args;
53  size_t* channel_list;
57 
59 
62 typedef enum {
72 
74 
77 typedef struct {
81  size_t num_samps;
83  bool stream_now;
89 
90 struct uhd_rx_streamer;
91 struct uhd_tx_streamer;
92 
94 
97 typedef struct uhd_rx_streamer* uhd_rx_streamer_handle;
98 
100 
103 typedef struct uhd_tx_streamer* uhd_tx_streamer_handle;
104 
105 #ifdef __cplusplus
106 extern "C" {
107 #endif
108 
109 /*
110  * RX Streamer
111  */
112 
114 
120 );
121 
123 
129 );
130 
134  size_t *num_channels_out
135 );
136 
140  size_t *max_num_samps_out
141 );
142 
144 
157  void** buffs,
158  size_t samps_per_buff,
160  double timeout,
161  bool one_packet,
162  size_t *items_recvd
163 );
164 
166 
171  const uhd_stream_cmd_t *stream_cmd
172 );
173 
175 
185  char* error_out,
186  size_t strbuffer_len
187 );
188 
189 /*
190  * TX Streamer
191  */
192 
194 
200 );
201 
203 
209 );
210 
214  size_t *num_channels_out
215 );
216 
220  size_t *max_num_samps_out
221 );
222 
224 
236  const void **buffs,
237  size_t samps_per_buff,
239  double timeout,
240  size_t *items_sent
241 );
242 
244 
250  double timeout,
251  bool *valid
252 );
253 
255 
265  char* error_out,
266  size_t strbuffer_len
267 );
268 
269 #ifdef __cplusplus
270 }
271 #endif
272 
273 /****************************************************************************
274  * Public Datatypes for USRP / streamer handling.
275  ***************************************************************************/
276 struct uhd_usrp;
277 
279 /*
280  * See uhd::usrp::multi_usrp for more details.
281  *
282  * NOTE: You must pass this handle into uhd_usrp_make before using it.
283  */
284 typedef struct uhd_usrp* uhd_usrp_handle;
285 
286 /****************************************************************************
287  * USRP Make / Free API calls
288  ***************************************************************************/
289 #ifdef __cplusplus
290 extern "C" {
291 #endif
292 
294 
298  const char* args,
299  uhd_string_vector_handle *strings_out
300 );
301 
303 
308  uhd_usrp_handle *h,
309  const char *args
310 );
311 
313 
318  uhd_usrp_handle *h
319 );
320 
323  uhd_usrp_handle h,
324  char* error_out,
325  size_t strbuffer_len
326 );
327 
330  uhd_usrp_handle h,
331  uhd_stream_args_t *stream_args,
333 );
334 
337  uhd_usrp_handle h,
338  uhd_stream_args_t *stream_args,
340 );
341 
342 /****************************************************************************
343  * multi_usrp API calls
344  ***************************************************************************/
345 
347 
351  uhd_usrp_handle h,
352  size_t chan,
353  uhd_usrp_rx_info_t *info_out
354 );
355 
357 
361  uhd_usrp_handle h,
362  size_t chan,
363  uhd_usrp_tx_info_t *info_out
364 );
365 
366 /****************************************************************************
367  * Motherboard methods
368  ***************************************************************************/
369 
371 
375  uhd_usrp_handle h,
376  double rate,
377  size_t mboard
378 );
379 
381 
385  uhd_usrp_handle h,
386  size_t mboard,
387  double *clock_rate_out
388 );
389 
391 
395  uhd_usrp_handle h,
396  char* pp_string_out,
397  size_t strbuffer_len
398 );
399 
401 
405  uhd_usrp_handle h,
406  size_t mboard,
407  char* mboard_name_out,
408  size_t strbuffer_len
409 );
410 
412 
416  uhd_usrp_handle h,
417  size_t mboard,
418  time_t *full_secs_out,
419  double *frac_secs_out
420 );
421 
423 
427  uhd_usrp_handle h,
428  size_t mboard,
429  time_t *full_secs_out,
430  double *frac_secs_out
431 );
432 
434 
438  uhd_usrp_handle h,
439  time_t full_secs,
440  double frac_secs,
441  size_t mboard
442 );
443 
445 
449  uhd_usrp_handle h,
450  time_t full_secs,
451  double frac_secs,
452  size_t mboard
453 );
454 
456 
460  uhd_usrp_handle h,
461  time_t full_secs,
462  double frac_secs
463 );
464 
467  uhd_usrp_handle h,
468  bool *result_out
469 );
470 
472 
476  uhd_usrp_handle h,
477  time_t full_secs,
478  double frac_secs,
479  size_t mboard
480 );
481 
484  uhd_usrp_handle h,
485  size_t mboard
486 );
487 
489 
493  uhd_usrp_handle h,
494  const char* time_source,
495  size_t mboard
496 );
497 
499 
503  uhd_usrp_handle h,
504  size_t mboard,
505  char* time_source_out,
506  size_t strbuffer_len
507 );
508 
511  uhd_usrp_handle h,
512  size_t mboard,
513  uhd_string_vector_handle *time_sources_out
514 );
515 
517 
521  uhd_usrp_handle h,
522  const char* clock_source,
523  size_t mboard
524 );
525 
527 
531  uhd_usrp_handle h,
532  size_t mboard,
533  char* clock_source_out,
534  size_t strbuffer_len
535 );
536 
539  uhd_usrp_handle h,
540  size_t mboard,
541  uhd_string_vector_handle *clock_sources_out
542 );
543 
545 
549  uhd_usrp_handle h,
550  bool enb,
551  size_t mboard
552 );
553 
555 
559  uhd_usrp_handle h,
560  bool enb,
561  size_t mboard
562 );
563 
566  uhd_usrp_handle h,
567  size_t *num_mboards_out
568 );
569 
572  uhd_usrp_handle h,
573  const char* name,
574  size_t mboard,
575  uhd_sensor_value_handle *sensor_value_out
576 );
577 
580  uhd_usrp_handle h,
581  size_t mboard,
582  uhd_string_vector_handle *mboard_sensor_names_out
583 );
584 
586 
590  uhd_usrp_handle h,
591  uint8_t addr,
592  uint32_t data,
593  size_t mboard
594 );
595 
596 /****************************************************************************
597  * EEPROM access methods
598  ***************************************************************************/
599 
602  uhd_usrp_handle h,
603  uhd_mboard_eeprom_handle mb_eeprom,
604  size_t mboard
605 );
606 
609  uhd_usrp_handle h,
610  uhd_mboard_eeprom_handle mb_eeprom,
611  size_t mboard
612 );
613 
616  uhd_usrp_handle h,
617  uhd_dboard_eeprom_handle db_eeprom,
618  const char* unit,
619  const char* slot,
620  size_t mboard
621 );
622 
625  uhd_usrp_handle h,
626  uhd_dboard_eeprom_handle db_eeprom,
627  const char* unit,
628  const char* slot,
629  size_t mboard
630 );
631 
632 /****************************************************************************
633  * RX methods
634  ***************************************************************************/
635 
637 
641  uhd_usrp_handle h,
642  uhd_subdev_spec_handle subdev_spec,
643  size_t mboard
644 );
645 
648  uhd_usrp_handle h,
649  size_t mboard,
650  uhd_subdev_spec_handle subdev_spec_out
651 );
652 
655  uhd_usrp_handle h,
656  size_t *num_channels_out
657 );
658 
661  uhd_usrp_handle h,
662  size_t chan,
663  char* rx_subdev_name_out,
664  size_t strbuffer_len
665 );
666 
669  uhd_usrp_handle h,
670  double rate,
671  size_t chan
672 );
673 
676  uhd_usrp_handle h,
677  size_t chan,
678  double *rate_out
679 );
680 
683  uhd_usrp_handle h,
684  size_t chan,
685  uhd_meta_range_handle rates_out
686 );
687 
690  uhd_usrp_handle h,
691  uhd_tune_request_t *tune_request,
692  size_t chan,
693  uhd_tune_result_t *tune_result
694 );
695 
698  uhd_usrp_handle h,
699  size_t chan,
700  double *freq_out
701 );
702 
704 
708  uhd_usrp_handle h,
709  size_t chan,
710  uhd_meta_range_handle freq_range_out
711 );
712 
715  uhd_usrp_handle h,
716  size_t chan,
717  uhd_meta_range_handle freq_range_out
718 );
719 
721 UHD_UNUSED(static const char* UHD_USRP_ALL_LOS) = "all";
722 
724 /*
725  * See uhd::usrp::multi_usrp::get_rx_lo_names() for more details.
726  */
728  uhd_usrp_handle h,
729  size_t chan,
730  uhd_string_vector_handle *rx_lo_names_out
731 );
732 
734 /*
735  * See uhd::usrp::multi_usrp::set_rx_lo_source() for more details.
736  */
738  uhd_usrp_handle h,
739  const char* src,
740  const char* name,
741  size_t chan
742 );
743 
746  uhd_usrp_handle h,
747  const char* name,
748  size_t chan,
749  char* rx_lo_source_out,
750  size_t strbuffer_len
751 );
752 
755  uhd_usrp_handle h,
756  const char* name,
757  size_t chan,
758  uhd_string_vector_handle *rx_lo_sources_out
759 );
760 
762 /*
763  * See uhd::usrp::multi_usrp::set_rx_lo_enabled() for more details.
764  */
766  uhd_usrp_handle h,
767  bool enabled,
768  const char* name,
769  size_t chan
770 );
771 
774  uhd_usrp_handle h,
775  const char* name,
776  size_t chan,
777  bool* result_out
778 );
779 
782  uhd_usrp_handle h,
783  double freq,
784  const char* name,
785  size_t chan,
786  double* coerced_freq_out
787 );
788 
791  uhd_usrp_handle h,
792  const char* name,
793  size_t chan,
794  double* rx_lo_freq_out
795 );
796 
799  uhd_usrp_handle h,
800  double gain,
801  size_t chan,
802  const char *gain_name
803 );
804 
806 
810  uhd_usrp_handle h,
811  double gain,
812  size_t chan
813 );
814 
816 
820  uhd_usrp_handle h,
821  bool enable,
822  size_t chan
823 );
824 
827  uhd_usrp_handle h,
828  size_t chan,
829  const char *gain_name,
830  double *gain_out
831 );
832 
834 
838  uhd_usrp_handle h,
839  size_t chan,
840  double *gain_out
841 );
842 
845  uhd_usrp_handle h,
846  const char* name,
847  size_t chan,
848  uhd_meta_range_handle gain_range_out
849 );
850 
853  uhd_usrp_handle h,
854  size_t chan,
855  uhd_string_vector_handle *gain_names_out
856 );
857 
860  uhd_usrp_handle h,
861  const char* ant,
862  size_t chan
863 );
864 
867  uhd_usrp_handle h,
868  size_t chan,
869  char* ant_out,
870  size_t strbuffer_len
871 );
872 
875  uhd_usrp_handle h,
876  size_t chan,
877  uhd_string_vector_handle *antennas_out
878 );
879 
882  uhd_usrp_handle h,
883  size_t chan,
884  uhd_string_vector_handle *sensor_names_out
885 );
886 
889  uhd_usrp_handle h,
890  double bandwidth,
891  size_t chan
892 );
893 
896  uhd_usrp_handle h,
897  size_t chan,
898  double *bandwidth_out
899 );
900 
903  uhd_usrp_handle h,
904  size_t chan,
905  uhd_meta_range_handle bandwidth_range_out
906 );
907 
910  uhd_usrp_handle h,
911  const char* name,
912  size_t chan,
913  uhd_sensor_value_handle *sensor_value_out
914 );
915 
917 
921  uhd_usrp_handle h,
922  bool enb,
923  size_t chan
924 );
925 
928  uhd_usrp_handle h,
929  bool enb,
930  size_t chan
931 );
932 
933 /****************************************************************************
934  * TX methods
935  ***************************************************************************/
936 
938 
942  uhd_usrp_handle h,
943  uhd_subdev_spec_handle subdev_spec,
944  size_t mboard
945 );
946 
949  uhd_usrp_handle h,
950  size_t mboard,
951  uhd_subdev_spec_handle subdev_spec_out
952 );
953 
956  uhd_usrp_handle h,
957  size_t *num_channels_out
958 );
959 
962  uhd_usrp_handle h,
963  size_t chan,
964  char* tx_subdev_name_out,
965  size_t strbuffer_len
966 );
967 
970  uhd_usrp_handle h,
971  double rate,
972  size_t chan
973 );
974 
977  uhd_usrp_handle h,
978  size_t chan,
979  double *rate_out
980 );
981 
984  uhd_usrp_handle h,
985  size_t chan,
986  uhd_meta_range_handle rates_out
987 );
988 
991  uhd_usrp_handle h,
992  uhd_tune_request_t *tune_request,
993  size_t chan,
994  uhd_tune_result_t *tune_result
995 );
996 
999  uhd_usrp_handle h,
1000  size_t chan,
1001  double *freq_out
1002 );
1003 
1005 
1009  uhd_usrp_handle h,
1010  size_t chan,
1011  uhd_meta_range_handle freq_range_out
1012 );
1013 
1016  uhd_usrp_handle h,
1017  size_t chan,
1018  uhd_meta_range_handle freq_range_out
1019 );
1020 
1023  uhd_usrp_handle h,
1024  double gain,
1025  size_t chan,
1026  const char *gain_name
1027 );
1028 
1030 
1034  uhd_usrp_handle h,
1035  double gain,
1036  size_t chan
1037 );
1038 
1041  uhd_usrp_handle h,
1042  const char* name,
1043  size_t chan,
1044  uhd_meta_range_handle gain_range_out
1045 );
1046 
1049  uhd_usrp_handle h,
1050  size_t chan,
1051  const char *gain_name,
1052  double *gain_out
1053 );
1054 
1056 
1060  uhd_usrp_handle h,
1061  size_t chan,
1062  double *gain_out
1063 );
1064 
1067  uhd_usrp_handle h,
1068  size_t chan,
1069  uhd_string_vector_handle *gain_names_out
1070 );
1071 
1074  uhd_usrp_handle h,
1075  const char* ant,
1076  size_t chan
1077 );
1078 
1081  uhd_usrp_handle h,
1082  size_t chan,
1083  char* ant_out,
1084  size_t strbuffer_len
1085 );
1086 
1089  uhd_usrp_handle h,
1090  size_t chan,
1091  uhd_string_vector_handle *antennas_out
1092 );
1093 
1096  uhd_usrp_handle h,
1097  double bandwidth,
1098  size_t chan
1099 );
1100 
1103  uhd_usrp_handle h,
1104  size_t chan,
1105  double *bandwidth_out
1106 );
1107 
1110  uhd_usrp_handle h,
1111  size_t chan,
1112  uhd_meta_range_handle bandwidth_range_out
1113 );
1114 
1117  uhd_usrp_handle h,
1118  const char* name,
1119  size_t chan,
1120  uhd_sensor_value_handle *sensor_value_out
1121 );
1122 
1125  uhd_usrp_handle h,
1126  size_t chan,
1127  uhd_string_vector_handle *sensor_names_out
1128 );
1129 
1130 /****************************************************************************
1131  * GPIO methods
1132  ***************************************************************************/
1133 
1136  uhd_usrp_handle h,
1137  size_t mboard,
1138  uhd_string_vector_handle *gpio_banks_out
1139 );
1140 
1142 
1146  uhd_usrp_handle h,
1147  const char* bank,
1148  const char* attr,
1149  uint32_t value,
1150  uint32_t mask,
1151  size_t mboard
1152 );
1153 
1155 
1159  uhd_usrp_handle h,
1160  const char* bank,
1161  const char* attr,
1162  size_t mboard,
1163  uint32_t *attr_out
1164 );
1165 
1168  uhd_usrp_handle h,
1169  size_t mboard,
1170  uhd_string_vector_handle *registers_out
1171 );
1172 
1175  uhd_usrp_handle h,
1176  const char* path,
1177  size_t mboard,
1178  uhd_usrp_register_info_t *register_info_out
1179 );
1180 
1183  uhd_usrp_handle h,
1184  const char* path,
1185  uint32_t field,
1186  uint64_t value,
1187  size_t mboard
1188 );
1189 
1192  uhd_usrp_handle h,
1193  const char* path,
1194  uint32_t field,
1195  size_t mboard,
1196  uint64_t *value_out
1197 );
1198 
1199 #ifdef __cplusplus
1200 }
1201 #endif
1202 
1203 #endif /* INCLUDED_UHD_USRP_H */
Stream samples indefinitely.
Definition: usrp.h:64
UHD_API uhd_error uhd_usrp_set_tx_freq(uhd_usrp_handle h, uhd_tune_request_t *tune_request, size_t chan, uhd_tune_result_t *tune_result)
Set the given channel&#39;s center TX frequency.
UHD_API uhd_error uhd_usrp_set_clock_source(uhd_usrp_handle h, const char *clock_source, size_t mboard)
Set the given device&#39;s clock source.
UHD_API uhd_error uhd_usrp_set_tx_antenna(uhd_usrp_handle h, const char *ant, size_t chan)
Set the TX antenna for the given channel.
UHD_API uhd_error uhd_usrp_get_time_source(uhd_usrp_handle h, size_t mboard, char *time_source_out, size_t strbuffer_len)
Get the time source for the given device.
bool stream_now
Stream now?
Definition: usrp.h:83
UHD_API uhd_error uhd_usrp_set_rx_agc(uhd_usrp_handle h, bool enable, size_t chan)
Enable or disable the given channel&#39;s RX AGC module.
struct uhd_rx_metadata_t * uhd_rx_metadata_handle
RX metadata interface for describing sent IF data.
Definition: metadata.h:51
UHD_API uhd_error uhd_usrp_enumerate_registers(uhd_usrp_handle h, size_t mboard, uhd_string_vector_handle *registers_out)
Enumerate the full paths of USRP registers available for read/write.
UHD_API uhd_error uhd_usrp_set_gpio_attr(uhd_usrp_handle h, const char *bank, const char *attr, uint32_t value, uint32_t mask, size_t mboard)
Set a GPIO attribute for a given GPIO bank.
UHD_API uhd_error uhd_usrp_set_rx_lo_freq(uhd_usrp_handle h, double freq, const char *name, size_t chan, double *coerced_freq_out)
Set the RX LO frequency.
UHD_API uhd_error uhd_usrp_get_time_now(uhd_usrp_handle h, size_t mboard, time_t *full_secs_out, double *frac_secs_out)
Get the USRP device&#39;s current internal time.
UHD_API uhd_error uhd_usrp_set_tx_rate(uhd_usrp_handle h, double rate, size_t chan)
Set the given RX channel&#39;s sample rate (in Sps)
UHD_API uhd_error uhd_usrp_get_rx_antenna(uhd_usrp_handle h, size_t chan, char *ant_out, size_t strbuffer_len)
Get the RX antenna for the given channel.
UHD_API uhd_error uhd_usrp_get_rx_antennas(uhd_usrp_handle h, size_t chan, uhd_string_vector_handle *antennas_out)
Get a list of RX antennas associated with the given channels.
A struct of parameters to construct a stream.
Definition: usrp.h:45
UHD_API uhd_error uhd_usrp_get_tx_sensor_names(uhd_usrp_handle h, size_t chan, uhd_string_vector_handle *sensor_names_out)
Get a list of TX sensors associated with the given channels.
UHD_API uhd_error uhd_usrp_get_rx_stream(uhd_usrp_handle h, uhd_stream_args_t *stream_args, uhd_rx_streamer_handle h_out)
Create RX streamer from a USRP handle and given stream args.
bool readable
Definition: usrp.h:33
UHD_API uhd_error uhd_usrp_get_tx_gain_range(uhd_usrp_handle h, const char *name, size_t chan, uhd_meta_range_handle gain_range_out)
Get all possible gain ranges for the given channel and name.
UHD_API uhd_error uhd_usrp_get_rx_lo_export_enabled(uhd_usrp_handle h, const char *name, size_t chan, bool *result_out)
Returns true if the currently selected LO is being exported.
uhd_stream_mode_t stream_mode
How streaming is issued to the device.
Definition: usrp.h:79
UHD_API uhd_error uhd_usrp_set_time_source(uhd_usrp_handle h, const char *time_source, size_t mboard)
Set the time source for the given device.
struct uhd_meta_range_t * uhd_meta_range_handle
C-level interface for dealing with a list of ranges.
Definition: ranges.h:44
UHD_API uhd_error uhd_usrp_get_tx_antenna(uhd_usrp_handle h, size_t chan, char *ant_out, size_t strbuffer_len)
Get the TX antenna for the given channel.
UHD_API uhd_error uhd_usrp_get_gpio_attr(uhd_usrp_handle h, const char *bank, const char *attr, size_t mboard, uint32_t *attr_out)
Get a GPIO attribute on a particular GPIO bank.
UHD_API uhd_error uhd_usrp_get_tx_subdev_name(uhd_usrp_handle h, size_t chan, char *tx_subdev_name_out, size_t strbuffer_len)
Get the name for the RX frontend.
UHD_API uhd_error uhd_usrp_set_mboard_eeprom(uhd_usrp_handle h, uhd_mboard_eeprom_handle mb_eeprom, size_t mboard)
Set values in the given motherboard&#39;s EEPROM.
UHD_API uhd_error uhd_usrp_set_user_register(uhd_usrp_handle h, uint8_t addr, uint32_t data, size_t mboard)
Perform a write on a user configuration register bus.
double time_spec_frac_secs
If not now, then fractional seconds into future to stream.
Definition: usrp.h:87
bool writable
Definition: usrp.h:34
struct uhd_tx_metadata_t * uhd_tx_metadata_handle
TX metadata interface for describing received IF data.
Definition: metadata.h:60
struct uhd_usrp * uhd_usrp_handle
C-level interface for working with a USRP device.
Definition: usrp.h:284
UHD_API uhd_error uhd_usrp_set_normalized_rx_gain(uhd_usrp_handle h, double gain, size_t chan)
Set the normalized RX gain [0.0, 1.0] for the given channel.
UHD_API uhd_error uhd_tx_streamer_last_error(uhd_tx_streamer_handle h, char *error_out, size_t strbuffer_len)
Get the last error reported by the TX streamer.
UHD_API uhd_error uhd_usrp_get_num_mboards(uhd_usrp_handle h, size_t *num_mboards_out)
Get the number of devices associated with the given USRP handle.
UHD_API uhd_error uhd_usrp_get_mboard_sensor(uhd_usrp_handle h, const char *name, size_t mboard, uhd_sensor_value_handle *sensor_value_out)
Get the value associated with the given sensor name.
UHD_API uhd_error uhd_usrp_get_time_synchronized(uhd_usrp_handle h, bool *result_out)
Are all motherboard times synchronized?
UHD_API uhd_error uhd_usrp_get_tx_antennas(uhd_usrp_handle h, size_t chan, uhd_string_vector_handle *antennas_out)
Get a list of tx antennas associated with the given channels.
UHD_API uhd_error uhd_tx_streamer_num_channels(uhd_tx_streamer_handle h, size_t *num_channels_out)
Get the number of channels associated with this streamer.
UHD_API uhd_error uhd_rx_streamer_make(uhd_rx_streamer_handle *h)
Create an RX streamer handle.
UHD_API uhd_error uhd_usrp_set_time_now(uhd_usrp_handle h, time_t full_secs, double frac_secs, size_t mboard)
Set the USRP device&#39;s time.
struct uhd_mboard_eeprom_t * uhd_mboard_eeprom_handle
A C-level interface for interacting with a USRP motherboard&#39;s EEPROM.
Definition: mboard_eeprom.h:34
UHD_API uhd_error uhd_usrp_make(uhd_usrp_handle *h, const char *args)
Create a USRP handle.
Stores RF and DSP tuned frequencies.
Definition: tune_result.h:18
UHD_UNUSED(static const char *UHD_USRP_ALL_LOS)
A wildcard for all LO names.
End continuous streaming.
Definition: usrp.h:66
UHD_API uhd_error uhd_usrp_set_rx_lo_source(uhd_usrp_handle h, const char *src, const char *name, size_t chan)
Set the LO source for the USRP device.
size_t bitwidth
Definition: usrp.h:32
char * cpu_format
Format of host memory.
Definition: usrp.h:47
UHD_API uhd_error uhd_usrp_set_normalized_tx_gain(uhd_usrp_handle h, double gain, size_t chan)
Set the normalized TX gain [0.0, 1.0] for the given channel.
Register info.
Definition: usrp.h:31
char * args
Other stream args.
Definition: usrp.h:51
UHD_API uhd_error uhd_usrp_get_rx_sensor(uhd_usrp_handle h, const char *name, size_t chan, uhd_sensor_value_handle *sensor_value_out)
Get the value for the given RX sensor.
UHD_API uhd_error uhd_usrp_get_rx_lo_sources(uhd_usrp_handle h, const char *name, size_t chan, uhd_string_vector_handle *rx_lo_sources_out)
Get a list of possible LO sources.
UHD_API uhd_error uhd_rx_streamer_recv(uhd_rx_streamer_handle h, void **buffs, size_t samps_per_buff, uhd_rx_metadata_handle *md, double timeout, bool one_packet, size_t *items_recvd)
Receive buffers containing samples into the given RX streamer.
UHD_API uhd_error uhd_usrp_get_tx_bandwidth(uhd_usrp_handle h, size_t chan, double *bandwidth_out)
Get the bandwidth for the given channel&#39;s TX frontend.
UHD_API uhd_error uhd_usrp_get_rx_bandwidth(uhd_usrp_handle h, size_t chan, double *bandwidth_out)
Get the bandwidth for the given channel&#39;s RX frontend.
UHD_API uhd_error uhd_usrp_get_tx_num_channels(uhd_usrp_handle h, size_t *num_channels_out)
Get the number of TX channels for the given handle.
UHD_API uhd_error uhd_usrp_get_register_info(uhd_usrp_handle h, const char *path, size_t mboard, uhd_usrp_register_info_t *register_info_out)
Get more information about a low-level device register.
UHD_API uhd_error uhd_usrp_get_tx_bandwidth_range(uhd_usrp_handle h, size_t chan, uhd_meta_range_handle bandwidth_range_out)
Get all possible bandwidth ranges for the given channel&#39;s TX frontend.
UHD_API uhd_error uhd_usrp_set_rx_dc_offset_enabled(uhd_usrp_handle h, bool enb, size_t chan)
Enable or disable RX DC offset correction for the given channel.
UHD_API uhd_error uhd_usrp_get_tx_sensor(uhd_usrp_handle h, const char *name, size_t chan, uhd_sensor_value_handle *sensor_value_out)
Get the value for the given TX sensor.
UHD_API uhd_error uhd_usrp_get_rx_freq_range(uhd_usrp_handle h, size_t chan, uhd_meta_range_handle freq_range_out)
Get all possible center frequency ranges for the given channel.
Stream some number of samples and finish.
Definition: usrp.h:68
UHD_API uhd_error uhd_usrp_get_tx_gain(uhd_usrp_handle h, size_t chan, const char *gain_name, double *gain_out)
Get the given channel&#39;s RX gain.
UHD_API uhd_error uhd_usrp_get_fe_rx_freq_range(uhd_usrp_handle h, size_t chan, uhd_meta_range_handle freq_range_out)
Get all possible RF frequency ranges for the given channel&#39;s RX RF frontend.
UHD_API uhd_error uhd_usrp_get_gpio_banks(uhd_usrp_handle h, size_t mboard, uhd_string_vector_handle *gpio_banks_out)
Get a list of GPIO banks associated with the given channels.
UHD_API uhd_error uhd_usrp_set_tx_gain(uhd_usrp_handle h, double gain, size_t chan, const char *gain_name)
Set the TX gain for the given channel and name.
UHD_API uhd_error uhd_usrp_get_pp_string(uhd_usrp_handle h, char *pp_string_out, size_t strbuffer_len)
Get a pretty-print representation of the USRP device.
UHD_API uhd_error uhd_usrp_set_rx_lo_export_enabled(uhd_usrp_handle h, bool enabled, const char *name, size_t chan)
Set whether the LO used by the USRP device is exported.
UHD_API uhd_error uhd_usrp_get_tx_stream(uhd_usrp_handle h, uhd_stream_args_t *stream_args, uhd_tx_streamer_handle h_out)
Create TX streamer from a USRP handle and given stream args.
UHD_API uhd_error uhd_tx_streamer_make(uhd_tx_streamer_handle *h)
Create an TX streamer handle.
UHD_API uhd_error uhd_usrp_get_rx_sensor_names(uhd_usrp_handle h, size_t chan, uhd_string_vector_handle *sensor_names_out)
Get a list of RX sensors associated with the given channels.
UHD_API uhd_error uhd_usrp_get_rx_freq(uhd_usrp_handle h, size_t chan, double *freq_out)
Get the given channel&#39;s center RX frequency.
UHD_API uhd_error uhd_rx_streamer_max_num_samps(uhd_rx_streamer_handle h, size_t *max_num_samps_out)
Get the max number of samples per buffer per packet.
struct uhd_async_metadata_t * uhd_async_metadata_handle
Interface for describing transmit-related events.
Definition: metadata.h:69
UHD_API uhd_error uhd_usrp_get_tx_freq(uhd_usrp_handle h, size_t chan, double *freq_out)
Get the given channel&#39;s center TX frequency.
UHD_API uhd_error uhd_usrp_get_rx_num_channels(uhd_usrp_handle h, size_t *num_channels_out)
Get the number of RX channels for the given handle.
uhd_error
UHD error codes.
Definition: error.h:20
UHD_API uhd_error uhd_usrp_clear_command_time(uhd_usrp_handle h, size_t mboard)
Clear the command time so that commands are sent ASAP.
UHD_API uhd_error uhd_usrp_get_rx_gain_names(uhd_usrp_handle h, size_t chan, uhd_string_vector_handle *gain_names_out)
Get a list of RX gain names for the given channel.
USRP RX info.
Definition: usrp_info.h:17
struct uhd_dboard_eeprom_t * uhd_dboard_eeprom_handle
A C-level interface for interacting with a daughterboard EEPROM.
Definition: dboard_eeprom.h:34
Define how device streams to host.
Definition: usrp.h:77
UHD_API uhd_error uhd_usrp_get_dboard_eeprom(uhd_usrp_handle h, uhd_dboard_eeprom_handle db_eeprom, const char *unit, const char *slot, size_t mboard)
Get a handle for the given device&#39;s daughterboard EEPROM.
UHD_API uhd_error uhd_usrp_set_time_unknown_pps(uhd_usrp_handle h, time_t full_secs, double frac_secs)
Synchronize the time across all motherboards.
UHD_API uhd_error uhd_usrp_set_command_time(uhd_usrp_handle h, time_t full_secs, double frac_secs, size_t mboard)
Set the time at which timed commands will take place.
UHD_API uhd_error uhd_usrp_get_time_sources(uhd_usrp_handle h, size_t mboard, uhd_string_vector_handle *time_sources_out)
Get a list of time sources for the given device.
UHD_API uhd_error uhd_usrp_set_tx_subdev_spec(uhd_usrp_handle h, uhd_subdev_spec_handle subdev_spec, size_t mboard)
Map the given device&#39;s TX frontend to a channel.
UHD_API uhd_error uhd_usrp_get_rx_info(uhd_usrp_handle h, size_t chan, uhd_usrp_rx_info_t *info_out)
Get RX info from the USRP device.
UHD_API uhd_error uhd_usrp_get_tx_subdev_spec(uhd_usrp_handle h, size_t mboard, uhd_subdev_spec_handle subdev_spec_out)
Get the TX frontend specification for the given device.
UHD_API uhd_error uhd_usrp_get_tx_rate(uhd_usrp_handle h, size_t chan, double *rate_out)
Get the given RX channel&#39;s sample rate (in Sps)
UHD_API uhd_error uhd_usrp_get_time_last_pps(uhd_usrp_handle h, size_t mboard, time_t *full_secs_out, double *frac_secs_out)
Get the time when this device&#39;s last PPS pulse occurred.
UHD_API uhd_error uhd_usrp_set_tx_bandwidth(uhd_usrp_handle h, double bandwidth, size_t chan)
Set the bandwidth for the given channel&#39;s TX frontend.
UHD_API uhd_error uhd_usrp_set_rx_iq_balance_enabled(uhd_usrp_handle h, bool enb, size_t chan)
Enable or disable RX IQ imbalance correction for the given channel.
UHD_API uhd_error uhd_tx_streamer_free(uhd_tx_streamer_handle *h)
Free an TX streamer handle.
UHD_API uhd_error uhd_rx_streamer_issue_stream_cmd(uhd_rx_streamer_handle h, const uhd_stream_cmd_t *stream_cmd)
Issue the given stream command.
UHD_API uhd_error uhd_usrp_set_rx_gain(uhd_usrp_handle h, double gain, size_t chan, const char *gain_name)
Set the RX gain for the given channel and name.
UHD_API uhd_error uhd_usrp_free(uhd_usrp_handle *h)
Safely destroy the USRP object underlying the handle.
UHD_API uhd_error uhd_usrp_get_fe_tx_freq_range(uhd_usrp_handle h, size_t chan, uhd_meta_range_handle freq_range_out)
Get all possible RF frequency ranges for the given channel&#39;s TX RF frontend.
UHD_API uhd_error uhd_usrp_read_register(uhd_usrp_handle h, const char *path, uint32_t field, size_t mboard, uint64_t *value_out)
Read a low-level register field from a device register in the USRP hardware.
UHD_API uhd_error uhd_usrp_set_master_clock_rate(uhd_usrp_handle h, double rate, size_t mboard)
Set the master clock rate.
UHD_API uhd_error uhd_usrp_get_rx_subdev_name(uhd_usrp_handle h, size_t chan, char *rx_subdev_name_out, size_t strbuffer_len)
Get the name for the RX frontend.
UHD_API uhd_error uhd_usrp_get_tx_info(uhd_usrp_handle h, size_t chan, uhd_usrp_tx_info_t *info_out)
Get TX info from the USRP device.
uhd_stream_mode_t
How streaming is issued to the device.
Definition: usrp.h:62
UHD_API uhd_error uhd_usrp_get_rx_lo_freq(uhd_usrp_handle h, const char *name, size_t chan, double *rx_lo_freq_out)
Get the current RX LO frequency.
UHD_API uhd_error uhd_rx_streamer_last_error(uhd_rx_streamer_handle h, char *error_out, size_t strbuffer_len)
Get the last error reported by the RX streamer.
struct uhd_rx_streamer * uhd_rx_streamer_handle
C-level interface for working with an RX streamer.
Definition: usrp.h:97
UHD_API uhd_error uhd_usrp_set_time_source_out(uhd_usrp_handle h, bool enb, size_t mboard)
Enable or disable sending the time source to an output connector.
UHD_API uhd_error uhd_usrp_get_tx_freq_range(uhd_usrp_handle h, size_t chan, uhd_meta_range_handle freq_range_out)
Get all possible center frequency ranges for the given channel.
UHD_API uhd_error uhd_usrp_set_rx_subdev_spec(uhd_usrp_handle h, uhd_subdev_spec_handle subdev_spec, size_t mboard)
Map the given device&#39;s RX frontend to a channel.
UHD_API uhd_error uhd_usrp_last_error(uhd_usrp_handle h, char *error_out, size_t strbuffer_len)
Get the last error reported by the USRP handle.
UHD_API uhd_error uhd_usrp_get_rx_lo_source(uhd_usrp_handle h, const char *name, size_t chan, char *rx_lo_source_out, size_t strbuffer_len)
Get the currently set LO source.
UHD_API uhd_error uhd_usrp_get_rx_rates(uhd_usrp_handle h, size_t chan, uhd_meta_range_handle rates_out)
Get a range of possible RX rates for the given channel.
uhd_string_vector_t * uhd_string_vector_handle
Definition: string_vector.h:32
USRP TX info.
Definition: usrp_info.h:40
#define UHD_API
Definition: config.h:62
UHD_INLINE data_t mask(const soft_reg_field_t field)
Definition: soft_register.hpp:86
UHD_API uhd_error uhd_usrp_get_rx_gain_range(uhd_usrp_handle h, const char *name, size_t chan, uhd_meta_range_handle gain_range_out)
Get all possible gain ranges for the given channel and name.
UHD_API uhd_error uhd_usrp_write_register(uhd_usrp_handle h, const char *path, uint32_t field, uint64_t value, size_t mboard)
Write a low-level register field for a device register in the USRP hardware.
Instructs implementation how to tune the RF chain.
Definition: tune_request.h:28
UHD_API uhd_error uhd_tx_streamer_max_num_samps(uhd_tx_streamer_handle h, size_t *max_num_samps_out)
Get the max number of samples per buffer per packet.
UHD_API uhd_error uhd_usrp_get_rx_gain(uhd_usrp_handle h, size_t chan, const char *gain_name, double *gain_out)
Get the given channel&#39;s RX gain.
Stream some number of samples but expect more.
Definition: usrp.h:70
struct uhd_sensor_value_t * uhd_sensor_value_handle
C-level interface for a UHD sensor.
Definition: sensors.h:33
UHD_API uhd_error uhd_usrp_set_rx_rate(uhd_usrp_handle h, double rate, size_t chan)
Set the given RX channel&#39;s sample rate (in Sps)
size_t * channel_list
Array that lists channels.
Definition: usrp.h:53
UHD_API uhd_error uhd_usrp_get_mboard_sensor_names(uhd_usrp_handle h, size_t mboard, uhd_string_vector_handle *mboard_sensor_names_out)
Get a list of motherboard sensors for the given device.
UHD_API uhd_error uhd_tx_streamer_send(uhd_tx_streamer_handle h, const void **buffs, size_t samps_per_buff, uhd_tx_metadata_handle *md, double timeout, size_t *items_sent)
Send buffers containing samples described by the metadata.
int n_channels
Number of channels.
Definition: usrp.h:55
UHD_API uhd_error uhd_usrp_get_tx_rates(uhd_usrp_handle h, size_t chan, uhd_meta_range_handle rates_out)
Get a range of possible RX rates for the given channel.
UHD_API uhd_error uhd_usrp_set_clock_source_out(uhd_usrp_handle h, bool enb, size_t mboard)
Enable or disable sending the clock source to an output connector.
UHD_API uhd_error uhd_usrp_get_tx_gain_names(uhd_usrp_handle h, size_t chan, uhd_string_vector_handle *gain_names_out)
Get a list of TX gain names for the given channel.
UHD_API uhd_error uhd_tx_streamer_recv_async_msg(uhd_tx_streamer_handle h, uhd_async_metadata_handle *md, double timeout, bool *valid)
Receive an asynchronous message from this streamer.
UHD_API uhd_error uhd_usrp_get_mboard_name(uhd_usrp_handle h, size_t mboard, char *mboard_name_out, size_t strbuffer_len)
Get the motherboard name for the given device.
UHD_API uhd_error uhd_usrp_set_rx_antenna(uhd_usrp_handle h, const char *ant, size_t chan)
Set the RX antenna for the given channel.
UHD_API uhd_error uhd_rx_streamer_num_channels(uhd_rx_streamer_handle h, size_t *num_channels_out)
Get the number of channels associated with this streamer.
struct uhd_subdev_spec_t * uhd_subdev_spec_handle
A C-level interface for working with a list of subdevice specifications.
Definition: subdev_spec.h:44
UHD_API uhd_error uhd_usrp_get_rx_lo_names(uhd_usrp_handle h, size_t chan, uhd_string_vector_handle *rx_lo_names_out)
Get a list of possible LO stage names.
UHD_API uhd_error uhd_usrp_set_rx_freq(uhd_usrp_handle h, uhd_tune_request_t *tune_request, size_t chan, uhd_tune_result_t *tune_result)
Set the given channel&#39;s center RX frequency.
UHD_API uhd_error uhd_usrp_get_normalized_rx_gain(uhd_usrp_handle h, size_t chan, double *gain_out)
Get the given channel&#39;s normalized RX gain [0.0, 1.0].
size_t num_samps
Number of samples.
Definition: usrp.h:81
UHD_API uhd_error uhd_usrp_get_rx_subdev_spec(uhd_usrp_handle h, size_t mboard, uhd_subdev_spec_handle subdev_spec_out)
Get the RX frontend specification for the given device.
UHD_API uhd_error uhd_usrp_get_clock_sources(uhd_usrp_handle h, size_t mboard, uhd_string_vector_handle *clock_sources_out)
Get a list of clock sources for the given device.
UHD_API uhd_error uhd_usrp_get_normalized_tx_gain(uhd_usrp_handle h, size_t chan, double *gain_out)
Get the given channel&#39;s normalized TX gain [0.0, 1.0].
UHD_API uhd_error uhd_usrp_set_rx_bandwidth(uhd_usrp_handle h, double bandwidth, size_t chan)
Set the bandwidth for the given channel&#39;s RX frontend.
UHD_API uhd_error uhd_usrp_set_time_next_pps(uhd_usrp_handle h, time_t full_secs, double frac_secs, size_t mboard)
Set the USRP device&#39;s time to the given value upon the next PPS detection.
struct uhd_tx_streamer * uhd_tx_streamer_handle
C-level interface for working with a TX streamer.
Definition: usrp.h:103
UHD_API uhd_error uhd_usrp_get_rx_rate(uhd_usrp_handle h, size_t chan, double *rate_out)
Get the given RX channel&#39;s sample rate (in Sps)
UHD_API uhd_error uhd_usrp_get_clock_source(uhd_usrp_handle h, size_t mboard, char *clock_source_out, size_t strbuffer_len)
Get the given device&#39;s clock source.
UHD_API uhd_error uhd_usrp_get_rx_bandwidth_range(uhd_usrp_handle h, size_t chan, uhd_meta_range_handle bandwidth_range_out)
Get all possible bandwidth ranges for the given channel&#39;s RX frontend.
UHD_API uhd_error uhd_usrp_find(const char *args, uhd_string_vector_handle *strings_out)
Find all connected USRP devices.
UHD_API uhd_error uhd_usrp_get_mboard_eeprom(uhd_usrp_handle h, uhd_mboard_eeprom_handle mb_eeprom, size_t mboard)
Get a handle for the given motherboard&#39;s EEPROM.
UHD_API uhd_error uhd_usrp_get_master_clock_rate(uhd_usrp_handle h, size_t mboard, double *clock_rate_out)
Get the master clock rate.
UHD_API uhd_error uhd_usrp_set_dboard_eeprom(uhd_usrp_handle h, uhd_dboard_eeprom_handle db_eeprom, const char *unit, const char *slot, size_t mboard)
Set values in the given daughterboard&#39;s EEPROM.
char * otw_format
Over-the-wire format.
Definition: usrp.h:49
time_t time_spec_full_secs
If not now, then full seconds into future to stream.
Definition: usrp.h:85
UHD_API uhd_error uhd_rx_streamer_free(uhd_rx_streamer_handle *h)
Free an RX streamer handle.