USRP Hardware Driver and USRP Manual  Version: 3.13.0.HEAD-0-gf114cfa0
UHD and USRP Manual
usrp.h
Go to the documentation of this file.
1 //
2 // Copyright 2015-2016 Ettus Research LLC
3 // Copyright 2018 Ettus Research, a National Instruments Company
4 //
5 // SPDX-License-Identifier: GPL-3.0-or-later
6 //
7 
8 #ifndef INCLUDED_UHD_USRP_H
9 #define INCLUDED_UHD_USRP_H
10 
11 #include <uhd/config.h>
12 #include <uhd/error.h>
13 #include <uhd/types/metadata.h>
14 #include <uhd/types/ranges.h>
15 #include <uhd/types/sensors.h>
17 #include <uhd/types/tune_request.h>
18 #include <uhd/types/tune_result.h>
19 #include <uhd/types/usrp_info.h>
20 #include <uhd/usrp/mboard_eeprom.h>
21 #include <uhd/usrp/dboard_eeprom.h>
22 #include <uhd/usrp/subdev_spec.h>
23 /* version.hpp is safe to include in C: */
24 #include <uhd/version.hpp> /* Provides UHD_VERSION */
25 
26 #include <stdbool.h>
27 #include <stdlib.h>
28 #include <stdint.h>
29 #include <time.h>
30 
32 typedef struct {
33  size_t bitwidth;
34  bool readable;
35  bool writable;
37 
38 /*
39  * Streamers
40  */
41 
43 
46 typedef struct {
48  char* cpu_format;
50  char* otw_format;
52  char* args;
54  size_t* channel_list;
58 
60 
63 typedef enum {
73 
75 
78 typedef struct {
82  size_t num_samps;
84  bool stream_now;
90 
91 struct uhd_rx_streamer;
92 struct uhd_tx_streamer;
93 
95 
98 typedef struct uhd_rx_streamer* uhd_rx_streamer_handle;
99 
101 
104 typedef struct uhd_tx_streamer* uhd_tx_streamer_handle;
105 
106 #ifdef __cplusplus
107 extern "C" {
108 #endif
109 
110 /*
111  * RX Streamer
112  */
113 
115 
121 );
122 
124 
130 );
131 
135  size_t *num_channels_out
136 );
137 
141  size_t *max_num_samps_out
142 );
143 
145 
158  void** buffs,
159  size_t samps_per_buff,
161  double timeout,
162  bool one_packet,
163  size_t *items_recvd
164 );
165 
167 
172  const uhd_stream_cmd_t *stream_cmd
173 );
174 
176 
186  char* error_out,
187  size_t strbuffer_len
188 );
189 
190 /*
191  * TX Streamer
192  */
193 
195 
201 );
202 
204 
210 );
211 
215  size_t *num_channels_out
216 );
217 
221  size_t *max_num_samps_out
222 );
223 
225 
237  const void **buffs,
238  size_t samps_per_buff,
240  double timeout,
241  size_t *items_sent
242 );
243 
245 
251  double timeout,
252  bool *valid
253 );
254 
256 
266  char* error_out,
267  size_t strbuffer_len
268 );
269 
270 #ifdef __cplusplus
271 }
272 #endif
273 
274 /****************************************************************************
275  * Public Datatypes for USRP / streamer handling.
276  ***************************************************************************/
277 struct uhd_usrp;
278 
280 /*
281  * See uhd::usrp::multi_usrp for more details.
282  *
283  * NOTE: You must pass this handle into uhd_usrp_make before using it.
284  */
285 typedef struct uhd_usrp* uhd_usrp_handle;
286 
287 /****************************************************************************
288  * USRP Make / Free API calls
289  ***************************************************************************/
290 #ifdef __cplusplus
291 extern "C" {
292 #endif
293 
295 
299  const char* args,
300  uhd_string_vector_handle *strings_out
301 );
302 
304 
309  uhd_usrp_handle *h,
310  const char *args
311 );
312 
314 
319  uhd_usrp_handle *h
320 );
321 
324  uhd_usrp_handle h,
325  char* error_out,
326  size_t strbuffer_len
327 );
328 
331  uhd_usrp_handle h,
332  uhd_stream_args_t *stream_args,
334 );
335 
338  uhd_usrp_handle h,
339  uhd_stream_args_t *stream_args,
341 );
342 
343 /****************************************************************************
344  * multi_usrp API calls
345  ***************************************************************************/
346 
348 
352  uhd_usrp_handle h,
353  size_t chan,
354  uhd_usrp_rx_info_t *info_out
355 );
356 
358 
362  uhd_usrp_handle h,
363  size_t chan,
364  uhd_usrp_tx_info_t *info_out
365 );
366 
367 /****************************************************************************
368  * Motherboard methods
369  ***************************************************************************/
370 
372 
376  uhd_usrp_handle h,
377  double rate,
378  size_t mboard
379 );
380 
382 
386  uhd_usrp_handle h,
387  size_t mboard,
388  double *clock_rate_out
389 );
390 
392 
396  uhd_usrp_handle h,
397  char* pp_string_out,
398  size_t strbuffer_len
399 );
400 
402 
406  uhd_usrp_handle h,
407  size_t mboard,
408  char* mboard_name_out,
409  size_t strbuffer_len
410 );
411 
413 
417  uhd_usrp_handle h,
418  size_t mboard,
419  time_t *full_secs_out,
420  double *frac_secs_out
421 );
422 
424 
428  uhd_usrp_handle h,
429  size_t mboard,
430  time_t *full_secs_out,
431  double *frac_secs_out
432 );
433 
435 
439  uhd_usrp_handle h,
440  time_t full_secs,
441  double frac_secs,
442  size_t mboard
443 );
444 
446 
450  uhd_usrp_handle h,
451  time_t full_secs,
452  double frac_secs,
453  size_t mboard
454 );
455 
457 
461  uhd_usrp_handle h,
462  time_t full_secs,
463  double frac_secs
464 );
465 
468  uhd_usrp_handle h,
469  bool *result_out
470 );
471 
473 
477  uhd_usrp_handle h,
478  time_t full_secs,
479  double frac_secs,
480  size_t mboard
481 );
482 
485  uhd_usrp_handle h,
486  size_t mboard
487 );
488 
490 
494  uhd_usrp_handle h,
495  const char* time_source,
496  size_t mboard
497 );
498 
500 
504  uhd_usrp_handle h,
505  size_t mboard,
506  char* time_source_out,
507  size_t strbuffer_len
508 );
509 
512  uhd_usrp_handle h,
513  size_t mboard,
514  uhd_string_vector_handle *time_sources_out
515 );
516 
518 
522  uhd_usrp_handle h,
523  const char* clock_source,
524  size_t mboard
525 );
526 
528 
532  uhd_usrp_handle h,
533  size_t mboard,
534  char* clock_source_out,
535  size_t strbuffer_len
536 );
537 
540  uhd_usrp_handle h,
541  size_t mboard,
542  uhd_string_vector_handle *clock_sources_out
543 );
544 
546 
550  uhd_usrp_handle h,
551  bool enb,
552  size_t mboard
553 );
554 
556 
560  uhd_usrp_handle h,
561  bool enb,
562  size_t mboard
563 );
564 
567  uhd_usrp_handle h,
568  size_t *num_mboards_out
569 );
570 
573  uhd_usrp_handle h,
574  const char* name,
575  size_t mboard,
576  uhd_sensor_value_handle *sensor_value_out
577 );
578 
581  uhd_usrp_handle h,
582  size_t mboard,
583  uhd_string_vector_handle *mboard_sensor_names_out
584 );
585 
587 
591  uhd_usrp_handle h,
592  uint8_t addr,
593  uint32_t data,
594  size_t mboard
595 );
596 
597 /****************************************************************************
598  * EEPROM access methods
599  ***************************************************************************/
600 
603  uhd_usrp_handle h,
604  uhd_mboard_eeprom_handle mb_eeprom,
605  size_t mboard
606 );
607 
610  uhd_usrp_handle h,
611  uhd_mboard_eeprom_handle mb_eeprom,
612  size_t mboard
613 );
614 
617  uhd_usrp_handle h,
618  uhd_dboard_eeprom_handle db_eeprom,
619  const char* unit,
620  const char* slot,
621  size_t mboard
622 );
623 
626  uhd_usrp_handle h,
627  uhd_dboard_eeprom_handle db_eeprom,
628  const char* unit,
629  const char* slot,
630  size_t mboard
631 );
632 
633 /****************************************************************************
634  * RX methods
635  ***************************************************************************/
636 
638 
642  uhd_usrp_handle h,
643  uhd_subdev_spec_handle subdev_spec,
644  size_t mboard
645 );
646 
649  uhd_usrp_handle h,
650  size_t mboard,
651  uhd_subdev_spec_handle subdev_spec_out
652 );
653 
656  uhd_usrp_handle h,
657  size_t *num_channels_out
658 );
659 
662  uhd_usrp_handle h,
663  size_t chan,
664  char* rx_subdev_name_out,
665  size_t strbuffer_len
666 );
667 
670  uhd_usrp_handle h,
671  double rate,
672  size_t chan
673 );
674 
677  uhd_usrp_handle h,
678  size_t chan,
679  double *rate_out
680 );
681 
684  uhd_usrp_handle h,
685  size_t chan,
686  uhd_meta_range_handle rates_out
687 );
688 
691  uhd_usrp_handle h,
692  uhd_tune_request_t *tune_request,
693  size_t chan,
694  uhd_tune_result_t *tune_result
695 );
696 
699  uhd_usrp_handle h,
700  size_t chan,
701  double *freq_out
702 );
703 
705 
709  uhd_usrp_handle h,
710  size_t chan,
711  uhd_meta_range_handle freq_range_out
712 );
713 
716  uhd_usrp_handle h,
717  size_t chan,
718  uhd_meta_range_handle freq_range_out
719 );
720 
722 UHD_UNUSED(static const char* UHD_USRP_ALL_LOS) = "all";
723 
725 /*
726  * See uhd::usrp::multi_usrp::get_rx_lo_names() for more details.
727  */
729  uhd_usrp_handle h,
730  size_t chan,
731  uhd_string_vector_handle *rx_lo_names_out
732 );
733 
735 /*
736  * See uhd::usrp::multi_usrp::set_rx_lo_source() for more details.
737  */
739  uhd_usrp_handle h,
740  const char* src,
741  const char* name,
742  size_t chan
743 );
744 
747  uhd_usrp_handle h,
748  const char* name,
749  size_t chan,
750  char* rx_lo_source_out,
751  size_t strbuffer_len
752 );
753 
756  uhd_usrp_handle h,
757  const char* name,
758  size_t chan,
759  uhd_string_vector_handle *rx_lo_sources_out
760 );
761 
763 /*
764  * See uhd::usrp::multi_usrp::set_rx_lo_enabled() for more details.
765  */
767  uhd_usrp_handle h,
768  bool enabled,
769  const char* name,
770  size_t chan
771 );
772 
775  uhd_usrp_handle h,
776  const char* name,
777  size_t chan,
778  bool* result_out
779 );
780 
783  uhd_usrp_handle h,
784  double freq,
785  const char* name,
786  size_t chan,
787  double* coerced_freq_out
788 );
789 
792  uhd_usrp_handle h,
793  const char* name,
794  size_t chan,
795  double* rx_lo_freq_out
796 );
797 
800  uhd_usrp_handle h,
801  double gain,
802  size_t chan,
803  const char *gain_name
804 );
805 
807 
811  uhd_usrp_handle h,
812  double gain,
813  size_t chan
814 );
815 
817 
821  uhd_usrp_handle h,
822  bool enable,
823  size_t chan
824 );
825 
828  uhd_usrp_handle h,
829  size_t chan,
830  const char *gain_name,
831  double *gain_out
832 );
833 
835 
839  uhd_usrp_handle h,
840  size_t chan,
841  double *gain_out
842 );
843 
846  uhd_usrp_handle h,
847  const char* name,
848  size_t chan,
849  uhd_meta_range_handle gain_range_out
850 );
851 
854  uhd_usrp_handle h,
855  size_t chan,
856  uhd_string_vector_handle *gain_names_out
857 );
858 
861  uhd_usrp_handle h,
862  const char* ant,
863  size_t chan
864 );
865 
868  uhd_usrp_handle h,
869  size_t chan,
870  char* ant_out,
871  size_t strbuffer_len
872 );
873 
876  uhd_usrp_handle h,
877  size_t chan,
878  uhd_string_vector_handle *antennas_out
879 );
880 
883  uhd_usrp_handle h,
884  size_t chan,
885  uhd_string_vector_handle *sensor_names_out
886 );
887 
890  uhd_usrp_handle h,
891  double bandwidth,
892  size_t chan
893 );
894 
897  uhd_usrp_handle h,
898  size_t chan,
899  double *bandwidth_out
900 );
901 
904  uhd_usrp_handle h,
905  size_t chan,
906  uhd_meta_range_handle bandwidth_range_out
907 );
908 
911  uhd_usrp_handle h,
912  const char* name,
913  size_t chan,
914  uhd_sensor_value_handle *sensor_value_out
915 );
916 
918 
922  uhd_usrp_handle h,
923  bool enb,
924  size_t chan
925 );
926 
929  uhd_usrp_handle h,
930  bool enb,
931  size_t chan
932 );
933 
934 /****************************************************************************
935  * TX methods
936  ***************************************************************************/
937 
939 
943  uhd_usrp_handle h,
944  uhd_subdev_spec_handle subdev_spec,
945  size_t mboard
946 );
947 
950  uhd_usrp_handle h,
951  size_t mboard,
952  uhd_subdev_spec_handle subdev_spec_out
953 );
954 
957  uhd_usrp_handle h,
958  size_t *num_channels_out
959 );
960 
963  uhd_usrp_handle h,
964  size_t chan,
965  char* tx_subdev_name_out,
966  size_t strbuffer_len
967 );
968 
971  uhd_usrp_handle h,
972  double rate,
973  size_t chan
974 );
975 
978  uhd_usrp_handle h,
979  size_t chan,
980  double *rate_out
981 );
982 
985  uhd_usrp_handle h,
986  size_t chan,
987  uhd_meta_range_handle rates_out
988 );
989 
992  uhd_usrp_handle h,
993  uhd_tune_request_t *tune_request,
994  size_t chan,
995  uhd_tune_result_t *tune_result
996 );
997 
1000  uhd_usrp_handle h,
1001  size_t chan,
1002  double *freq_out
1003 );
1004 
1006 
1010  uhd_usrp_handle h,
1011  size_t chan,
1012  uhd_meta_range_handle freq_range_out
1013 );
1014 
1017  uhd_usrp_handle h,
1018  size_t chan,
1019  uhd_meta_range_handle freq_range_out
1020 );
1021 
1024  uhd_usrp_handle h,
1025  double gain,
1026  size_t chan,
1027  const char *gain_name
1028 );
1029 
1031 
1035  uhd_usrp_handle h,
1036  double gain,
1037  size_t chan
1038 );
1039 
1042  uhd_usrp_handle h,
1043  const char* name,
1044  size_t chan,
1045  uhd_meta_range_handle gain_range_out
1046 );
1047 
1050  uhd_usrp_handle h,
1051  size_t chan,
1052  const char *gain_name,
1053  double *gain_out
1054 );
1055 
1057 
1061  uhd_usrp_handle h,
1062  size_t chan,
1063  double *gain_out
1064 );
1065 
1068  uhd_usrp_handle h,
1069  size_t chan,
1070  uhd_string_vector_handle *gain_names_out
1071 );
1072 
1075  uhd_usrp_handle h,
1076  const char* ant,
1077  size_t chan
1078 );
1079 
1082  uhd_usrp_handle h,
1083  size_t chan,
1084  char* ant_out,
1085  size_t strbuffer_len
1086 );
1087 
1090  uhd_usrp_handle h,
1091  size_t chan,
1092  uhd_string_vector_handle *antennas_out
1093 );
1094 
1097  uhd_usrp_handle h,
1098  double bandwidth,
1099  size_t chan
1100 );
1101 
1104  uhd_usrp_handle h,
1105  size_t chan,
1106  double *bandwidth_out
1107 );
1108 
1111  uhd_usrp_handle h,
1112  size_t chan,
1113  uhd_meta_range_handle bandwidth_range_out
1114 );
1115 
1118  uhd_usrp_handle h,
1119  const char* name,
1120  size_t chan,
1121  uhd_sensor_value_handle *sensor_value_out
1122 );
1123 
1126  uhd_usrp_handle h,
1127  size_t chan,
1128  uhd_string_vector_handle *sensor_names_out
1129 );
1130 
1131 /****************************************************************************
1132  * GPIO methods
1133  ***************************************************************************/
1134 
1137  uhd_usrp_handle h,
1138  size_t mboard,
1139  uhd_string_vector_handle *gpio_banks_out
1140 );
1141 
1143 
1147  uhd_usrp_handle h,
1148  const char* bank,
1149  const char* attr,
1150  uint32_t value,
1151  uint32_t mask,
1152  size_t mboard
1153 );
1154 
1156 
1160  uhd_usrp_handle h,
1161  const char* bank,
1162  const char* attr,
1163  size_t mboard,
1164  uint32_t *attr_out
1165 );
1166 
1169  uhd_usrp_handle h,
1170  size_t mboard,
1171  uhd_string_vector_handle *registers_out
1172 );
1173 
1176  uhd_usrp_handle h,
1177  const char* path,
1178  size_t mboard,
1179  uhd_usrp_register_info_t *register_info_out
1180 );
1181 
1184  uhd_usrp_handle h,
1185  const char* path,
1186  uint32_t field,
1187  uint64_t value,
1188  size_t mboard
1189 );
1190 
1193  uhd_usrp_handle h,
1194  const char* path,
1195  uint32_t field,
1196  size_t mboard,
1197  uint64_t *value_out
1198 );
1199 
1200 #ifdef __cplusplus
1201 }
1202 #endif
1203 
1204 #endif /* INCLUDED_UHD_USRP_H */
Stream samples indefinitely.
Definition: usrp.h:65
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:84
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:52
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:46
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:34
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:80
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:45
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:88
bool writable
Definition: usrp.h:35
struct uhd_tx_metadata_t * uhd_tx_metadata_handle
TX metadata interface for describing received IF data.
Definition: metadata.h:61
struct uhd_usrp * uhd_usrp_handle
C-level interface for working with a USRP device.
Definition: usrp.h:285
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:35
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:19
UHD_UNUSED(static const char *UHD_USRP_ALL_LOS)
A wildcard for all LO names.
End continuous streaming.
Definition: usrp.h:67
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:33
char * cpu_format
Format of host memory.
Definition: usrp.h:48
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:32
char * args
Other stream args.
Definition: usrp.h:52
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:69
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:70
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:21
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:18
struct uhd_dboard_eeprom_t * uhd_dboard_eeprom_handle
A C-level interface for interacting with a daughterboard EEPROM.
Definition: dboard_eeprom.h:35
Define how device streams to host.
Definition: usrp.h:78
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:63
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:98
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:33
USRP TX info.
Definition: usrp_info.h:41
#define UHD_API
Definition: config.h:63
UHD_INLINE data_t mask(const soft_reg_field_t field)
Definition: soft_register.hpp:87
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:29
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:71
struct uhd_sensor_value_t * uhd_sensor_value_handle
C-level interface for a UHD sensor.
Definition: sensors.h:34
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:54
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:56
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:45
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:82
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:104
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:50
time_t time_spec_full_secs
If not now, then full seconds into future to stream.
Definition: usrp.h:86
UHD_API uhd_error uhd_rx_streamer_free(uhd_rx_streamer_handle *h)
Free an RX streamer handle.