USRP Hardware Driver and USRP Manual  Version: 003.010.002.HEAD-0-gbd6e21dc
UHD and USRP Manual
usrp.h
Go to the documentation of this file.
1 //
2 // Copyright 2015-2016 Ettus Research LLC
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 //
17 
18 #ifndef INCLUDED_UHD_USRP_H
19 #define INCLUDED_UHD_USRP_H
20 
21 #include <uhd/config.h>
22 #include <uhd/error.h>
23 #include <uhd/types/metadata.h>
24 #include <uhd/types/ranges.h>
25 #include <uhd/types/sensors.h>
27 #include <uhd/types/tune_request.h>
28 #include <uhd/types/tune_result.h>
29 #include <uhd/types/usrp_info.h>
30 #include <uhd/usrp/mboard_eeprom.h>
31 #include <uhd/usrp/dboard_eeprom.h>
32 #include <uhd/usrp/subdev_spec.h>
33 /* version.hpp is safe to include in C: */
34 #include <uhd/version.hpp> /* Provides UHD_VERSION */
35 
36 #include <stdbool.h>
37 #include <stdlib.h>
38 #include <stdint.h>
39 #include <time.h>
40 
42 typedef struct {
43  size_t bitwidth;
44  bool readable;
45  bool writable;
47 
48 /*
49  * Streamers
50  */
51 
53 
56 typedef struct {
58  char* cpu_format;
60  char* otw_format;
62  char* args;
64  size_t* channel_list;
68 
70 
73 typedef enum {
83 
85 
88 typedef struct {
92  size_t num_samps;
94  bool stream_now;
100 
101 struct uhd_rx_streamer;
102 struct uhd_tx_streamer;
103 
105 
108 typedef struct uhd_rx_streamer* uhd_rx_streamer_handle;
109 
111 
114 typedef struct uhd_tx_streamer* uhd_tx_streamer_handle;
115 
116 #ifdef __cplusplus
117 extern "C" {
118 #endif
119 
120 /*
121  * RX Streamer
122  */
123 
125 
131 );
132 
134 
140 );
141 
145  size_t *num_channels_out
146 );
147 
151  size_t *max_num_samps_out
152 );
153 
155 
168  void** buffs,
169  size_t samps_per_buff,
171  double timeout,
172  bool one_packet,
173  size_t *items_recvd
174 );
175 
177 
182  const uhd_stream_cmd_t *stream_cmd
183 );
184 
186 
196  char* error_out,
197  size_t strbuffer_len
198 );
199 
200 /*
201  * TX Streamer
202  */
203 
205 
211 );
212 
214 
220 );
221 
225  size_t *num_channels_out
226 );
227 
231  size_t *max_num_samps_out
232 );
233 
235 
247  const void **buffs,
248  size_t samps_per_buff,
250  double timeout,
251  size_t *items_sent
252 );
253 
255 
261  double timeout,
262  bool *valid
263 );
264 
266 
276  char* error_out,
277  size_t strbuffer_len
278 );
279 
280 #ifdef __cplusplus
281 }
282 #endif
283 
284 /****************************************************************************
285  * Public Datatypes for USRP / streamer handling.
286  ***************************************************************************/
287 struct uhd_usrp;
288 
290 /*
291  * See uhd::usrp::multi_usrp for more details.
292  *
293  * NOTE: You must pass this handle into uhd_usrp_make before using it.
294  */
295 typedef struct uhd_usrp* uhd_usrp_handle;
296 
297 /****************************************************************************
298  * USRP Make / Free API calls
299  ***************************************************************************/
300 #ifdef __cplusplus
301 extern "C" {
302 #endif
303 
305 
309  const char* args,
310  uhd_string_vector_handle *strings_out
311 );
312 
314 
319  uhd_usrp_handle *h,
320  const char *args
321 );
322 
324 
329  uhd_usrp_handle *h
330 );
331 
334  uhd_usrp_handle h,
335  char* error_out,
336  size_t strbuffer_len
337 );
338 
341  uhd_usrp_handle h,
342  uhd_stream_args_t *stream_args,
344 );
345 
348  uhd_usrp_handle h,
349  uhd_stream_args_t *stream_args,
351 );
352 
353 /****************************************************************************
354  * multi_usrp API calls
355  ***************************************************************************/
356 
358 
362  uhd_usrp_handle h,
363  size_t chan,
364  uhd_usrp_rx_info_t *info_out
365 );
366 
368 
372  uhd_usrp_handle h,
373  size_t chan,
374  uhd_usrp_tx_info_t *info_out
375 );
376 
377 /****************************************************************************
378  * Motherboard methods
379  ***************************************************************************/
380 
382 
386  uhd_usrp_handle h,
387  double rate,
388  size_t mboard
389 );
390 
392 
396  uhd_usrp_handle h,
397  size_t mboard,
398  double *clock_rate_out
399 );
400 
402 
406  uhd_usrp_handle h,
407  char* pp_string_out,
408  size_t strbuffer_len
409 );
410 
412 
416  uhd_usrp_handle h,
417  size_t mboard,
418  char* mboard_name_out,
419  size_t strbuffer_len
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  size_t mboard,
440  time_t *full_secs_out,
441  double *frac_secs_out
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  size_t mboard
464 );
465 
467 
471  uhd_usrp_handle h,
472  time_t full_secs,
473  double frac_secs
474 );
475 
478  uhd_usrp_handle h,
479  bool *result_out
480 );
481 
483 
487  uhd_usrp_handle h,
488  time_t full_secs,
489  double frac_secs,
490  size_t mboard
491 );
492 
495  uhd_usrp_handle h,
496  size_t mboard
497 );
498 
500 
504  uhd_usrp_handle h,
505  const char* time_source,
506  size_t mboard
507 );
508 
510 
514  uhd_usrp_handle h,
515  size_t mboard,
516  char* time_source_out,
517  size_t strbuffer_len
518 );
519 
522  uhd_usrp_handle h,
523  size_t mboard,
524  uhd_string_vector_handle *time_sources_out
525 );
526 
528 
532  uhd_usrp_handle h,
533  const char* clock_source,
534  size_t mboard
535 );
536 
538 
542  uhd_usrp_handle h,
543  size_t mboard,
544  char* clock_source_out,
545  size_t strbuffer_len
546 );
547 
550  uhd_usrp_handle h,
551  size_t mboard,
552  uhd_string_vector_handle *clock_sources_out
553 );
554 
556 
560  uhd_usrp_handle h,
561  bool enb,
562  size_t mboard
563 );
564 
566 
570  uhd_usrp_handle h,
571  bool enb,
572  size_t mboard
573 );
574 
577  uhd_usrp_handle h,
578  size_t *num_mboards_out
579 );
580 
583  uhd_usrp_handle h,
584  const char* name,
585  size_t mboard,
586  uhd_sensor_value_handle *sensor_value_out
587 );
588 
591  uhd_usrp_handle h,
592  size_t mboard,
593  uhd_string_vector_handle *mboard_sensor_names_out
594 );
595 
597 
601  uhd_usrp_handle h,
602  uint8_t addr,
603  uint32_t data,
604  size_t mboard
605 );
606 
607 /****************************************************************************
608  * EEPROM access methods
609  ***************************************************************************/
610 
613  uhd_usrp_handle h,
614  uhd_mboard_eeprom_handle mb_eeprom,
615  size_t mboard
616 );
617 
620  uhd_usrp_handle h,
621  uhd_mboard_eeprom_handle mb_eeprom,
622  size_t mboard
623 );
624 
627  uhd_usrp_handle h,
628  uhd_dboard_eeprom_handle db_eeprom,
629  const char* unit,
630  const char* slot,
631  size_t mboard
632 );
633 
636  uhd_usrp_handle h,
637  uhd_dboard_eeprom_handle db_eeprom,
638  const char* unit,
639  const char* slot,
640  size_t mboard
641 );
642 
643 /****************************************************************************
644  * RX methods
645  ***************************************************************************/
646 
648 
652  uhd_usrp_handle h,
653  uhd_subdev_spec_handle subdev_spec,
654  size_t mboard
655 );
656 
659  uhd_usrp_handle h,
660  size_t mboard,
661  uhd_subdev_spec_handle subdev_spec_out
662 );
663 
666  uhd_usrp_handle h,
667  size_t *num_channels_out
668 );
669 
672  uhd_usrp_handle h,
673  size_t chan,
674  char* rx_subdev_name_out,
675  size_t strbuffer_len
676 );
677 
680  uhd_usrp_handle h,
681  double rate,
682  size_t chan
683 );
684 
687  uhd_usrp_handle h,
688  size_t chan,
689  double *rate_out
690 );
691 
694  uhd_usrp_handle h,
695  size_t chan,
696  uhd_meta_range_handle rates_out
697 );
698 
701  uhd_usrp_handle h,
702  uhd_tune_request_t *tune_request,
703  size_t chan,
704  uhd_tune_result_t *tune_result
705 );
706 
709  uhd_usrp_handle h,
710  size_t chan,
711  double *freq_out
712 );
713 
715 
719  uhd_usrp_handle h,
720  size_t chan,
721  uhd_meta_range_handle freq_range_out
722 );
723 
726  uhd_usrp_handle h,
727  size_t chan,
728  uhd_meta_range_handle freq_range_out
729 );
730 
732 UHD_UNUSED(static const char* UHD_USRP_ALL_LOS) = "all";
733 
735 /*
736  * See uhd::usrp::multi_usrp::get_rx_lo_names() for more details.
737  */
739  uhd_usrp_handle h,
740  size_t chan,
741  uhd_string_vector_handle *rx_lo_names_out
742 );
743 
745 /*
746  * See uhd::usrp::multi_usrp::set_rx_lo_source() for more details.
747  */
749  uhd_usrp_handle h,
750  const char* src,
751  const char* name,
752  size_t chan
753 );
754 
757  uhd_usrp_handle h,
758  const char* name,
759  size_t chan,
760  char* rx_lo_source_out,
761  size_t strbuffer_len
762 );
763 
766  uhd_usrp_handle h,
767  const char* name,
768  size_t chan,
769  uhd_string_vector_handle *rx_lo_sources_out
770 );
771 
773 /*
774  * See uhd::usrp::multi_usrp::set_rx_lo_enabled() for more details.
775  */
777  uhd_usrp_handle h,
778  bool enabled,
779  const char* name,
780  size_t chan
781 );
782 
785  uhd_usrp_handle h,
786  const char* name,
787  size_t chan,
788  bool* result_out
789 );
790 
793  uhd_usrp_handle h,
794  double freq,
795  const char* name,
796  size_t chan,
797  double* coerced_freq_out
798 );
799 
802  uhd_usrp_handle h,
803  const char* name,
804  size_t chan,
805  double* rx_lo_freq_out
806 );
807 
810  uhd_usrp_handle h,
811  double gain,
812  size_t chan,
813  const char *gain_name
814 );
815 
817 
821  uhd_usrp_handle h,
822  double gain,
823  size_t chan
824 );
825 
827 
831  uhd_usrp_handle h,
832  bool enable,
833  size_t chan
834 );
835 
838  uhd_usrp_handle h,
839  size_t chan,
840  const char *gain_name,
841  double *gain_out
842 );
843 
845 
849  uhd_usrp_handle h,
850  size_t chan,
851  double *gain_out
852 );
853 
856  uhd_usrp_handle h,
857  const char* name,
858  size_t chan,
859  uhd_meta_range_handle gain_range_out
860 );
861 
864  uhd_usrp_handle h,
865  size_t chan,
866  uhd_string_vector_handle *gain_names_out
867 );
868 
871  uhd_usrp_handle h,
872  const char* ant,
873  size_t chan
874 );
875 
878  uhd_usrp_handle h,
879  size_t chan,
880  char* ant_out,
881  size_t strbuffer_len
882 );
883 
886  uhd_usrp_handle h,
887  size_t chan,
888  uhd_string_vector_handle *antennas_out
889 );
890 
893  uhd_usrp_handle h,
894  size_t chan,
895  uhd_string_vector_handle *sensor_names_out
896 );
897 
900  uhd_usrp_handle h,
901  double bandwidth,
902  size_t chan
903 );
904 
907  uhd_usrp_handle h,
908  size_t chan,
909  double *bandwidth_out
910 );
911 
914  uhd_usrp_handle h,
915  size_t chan,
916  uhd_meta_range_handle bandwidth_range_out
917 );
918 
921  uhd_usrp_handle h,
922  const char* name,
923  size_t chan,
924  uhd_sensor_value_handle *sensor_value_out
925 );
926 
928 
932  uhd_usrp_handle h,
933  bool enb,
934  size_t chan
935 );
936 
939  uhd_usrp_handle h,
940  bool enb,
941  size_t chan
942 );
943 
944 /****************************************************************************
945  * TX methods
946  ***************************************************************************/
947 
949 
953  uhd_usrp_handle h,
954  uhd_subdev_spec_handle subdev_spec,
955  size_t mboard
956 );
957 
960  uhd_usrp_handle h,
961  size_t mboard,
962  uhd_subdev_spec_handle subdev_spec_out
963 );
964 
967  uhd_usrp_handle h,
968  size_t *num_channels_out
969 );
970 
973  uhd_usrp_handle h,
974  size_t chan,
975  char* tx_subdev_name_out,
976  size_t strbuffer_len
977 );
978 
981  uhd_usrp_handle h,
982  double rate,
983  size_t chan
984 );
985 
988  uhd_usrp_handle h,
989  size_t chan,
990  double *rate_out
991 );
992 
995  uhd_usrp_handle h,
996  size_t chan,
997  uhd_meta_range_handle rates_out
998 );
999 
1002  uhd_usrp_handle h,
1003  uhd_tune_request_t *tune_request,
1004  size_t chan,
1005  uhd_tune_result_t *tune_result
1006 );
1007 
1010  uhd_usrp_handle h,
1011  size_t chan,
1012  double *freq_out
1013 );
1014 
1016 
1020  uhd_usrp_handle h,
1021  size_t chan,
1022  uhd_meta_range_handle freq_range_out
1023 );
1024 
1027  uhd_usrp_handle h,
1028  size_t chan,
1029  uhd_meta_range_handle freq_range_out
1030 );
1031 
1034  uhd_usrp_handle h,
1035  double gain,
1036  size_t chan,
1037  const char *gain_name
1038 );
1039 
1041 
1045  uhd_usrp_handle h,
1046  double gain,
1047  size_t chan
1048 );
1049 
1052  uhd_usrp_handle h,
1053  const char* name,
1054  size_t chan,
1055  uhd_meta_range_handle gain_range_out
1056 );
1057 
1060  uhd_usrp_handle h,
1061  size_t chan,
1062  const char *gain_name,
1063  double *gain_out
1064 );
1065 
1067 
1071  uhd_usrp_handle h,
1072  size_t chan,
1073  double *gain_out
1074 );
1075 
1078  uhd_usrp_handle h,
1079  size_t chan,
1080  uhd_string_vector_handle *gain_names_out
1081 );
1082 
1085  uhd_usrp_handle h,
1086  const char* ant,
1087  size_t chan
1088 );
1089 
1092  uhd_usrp_handle h,
1093  size_t chan,
1094  char* ant_out,
1095  size_t strbuffer_len
1096 );
1097 
1100  uhd_usrp_handle h,
1101  size_t chan,
1102  uhd_string_vector_handle *antennas_out
1103 );
1104 
1107  uhd_usrp_handle h,
1108  double bandwidth,
1109  size_t chan
1110 );
1111 
1114  uhd_usrp_handle h,
1115  size_t chan,
1116  double *bandwidth_out
1117 );
1118 
1121  uhd_usrp_handle h,
1122  size_t chan,
1123  uhd_meta_range_handle bandwidth_range_out
1124 );
1125 
1128  uhd_usrp_handle h,
1129  const char* name,
1130  size_t chan,
1131  uhd_sensor_value_handle *sensor_value_out
1132 );
1133 
1136  uhd_usrp_handle h,
1137  size_t chan,
1138  uhd_string_vector_handle *sensor_names_out
1139 );
1140 
1142 
1146  uhd_usrp_handle h,
1147  bool enb,
1148  size_t chan
1149 );
1150 
1153  uhd_usrp_handle h,
1154  bool enb,
1155  size_t chan
1156 );
1157 
1158 /****************************************************************************
1159  * GPIO methods
1160  ***************************************************************************/
1161 
1164  uhd_usrp_handle h,
1165  size_t mboard,
1166  uhd_string_vector_handle *gpio_banks_out
1167 );
1168 
1170 
1174  uhd_usrp_handle h,
1175  const char* bank,
1176  const char* attr,
1177  uint32_t value,
1178  uint32_t mask,
1179  size_t mboard
1180 );
1181 
1183 
1187  uhd_usrp_handle h,
1188  const char* bank,
1189  const char* attr,
1190  size_t mboard,
1191  uint32_t *attr_out
1192 );
1193 
1196  uhd_usrp_handle h,
1197  size_t mboard,
1198  uhd_string_vector_handle *registers_out
1199 );
1200 
1203  uhd_usrp_handle h,
1204  const char* path,
1205  size_t mboard,
1206  uhd_usrp_register_info_t *register_info_out
1207 );
1208 
1211  uhd_usrp_handle h,
1212  const char* path,
1213  uint32_t field,
1214  uint64_t value,
1215  size_t mboard
1216 );
1217 
1220  uhd_usrp_handle h,
1221  const char* path,
1222  uint32_t field,
1223  size_t mboard,
1224  uint64_t *value_out
1225 );
1226 
1227 #ifdef __cplusplus
1228 }
1229 #endif
1230 
1231 #endif /* INCLUDED_UHD_USRP_H */
Stream samples indefinitely.
Definition: usrp.h:75
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:94
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:62
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:56
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:44
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:90
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:55
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.
UHD_API uhd_error uhd_usrp_set_tx_dc_offset_enabled(uhd_usrp_handle h, bool enb, size_t chan)
Enable or disable TX DC offset correction for the given channel.
double time_spec_frac_secs
If not now, then fractional seconds into future to stream.
Definition: usrp.h:98
bool writable
Definition: usrp.h:45
struct uhd_tx_metadata_t * uhd_tx_metadata_handle
TX metadata interface for describing received IF data.
Definition: metadata.h:71
struct uhd_usrp * uhd_usrp_handle
C-level interface for working with a USRP device.
Definition: usrp.h:295
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:45
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:29
UHD_UNUSED(static const char *UHD_USRP_ALL_LOS)
A wildcard for all LO names.
End continuous streaming.
Definition: usrp.h:77
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:43
char * cpu_format
Format of host memory.
Definition: usrp.h:58
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:42
char * args
Other stream args.
Definition: usrp.h:62
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:79
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:80
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:31
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:28
struct uhd_dboard_eeprom_t * uhd_dboard_eeprom_handle
A C-level interface for interacting with a daughterboard EEPROM.
Definition: dboard_eeprom.h:45
Define how device streams to host.
Definition: usrp.h:88
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_API uhd_error uhd_usrp_set_tx_iq_balance_enabled(uhd_usrp_handle h, bool enb, size_t chan)
Enable or disable TX IQ imbalance correction for the given channel.
uhd_stream_mode_t
How streaming is issued to the device.
Definition: usrp.h:73
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:108
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:43
USRP TX info.
Definition: usrp_info.h:51
#define UHD_API
Definition: config.h:73
UHD_INLINE data_t mask(const soft_reg_field_t field)
Definition: soft_register.hpp:98
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:39
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:81
struct uhd_sensor_value_t * uhd_sensor_value_handle
C-level interface for a UHD sensor.
Definition: sensors.h:44
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:64
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:66
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:55
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:92
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:114
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:60
time_t time_spec_full_secs
If not now, then full seconds into future to stream.
Definition: usrp.h:96
UHD_API uhd_error uhd_rx_streamer_free(uhd_rx_streamer_handle *h)
Free an RX streamer handle.