USRP Hardware Driver and USRP Manual  Version: 003.010.001.HEAD-0-g929e3b32
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 
34 #include <stdbool.h>
35 #include <stdlib.h>
36 #include <stdint.h>
37 #include <time.h>
38 
40 typedef struct {
41  size_t bitwidth;
42  bool readable;
43  bool writable;
45 
46 /*
47  * Streamers
48  */
49 
51 
54 typedef struct {
56  char* cpu_format;
58  char* otw_format;
60  char* args;
62  size_t* channel_list;
66 
68 
71 typedef enum {
81 
83 
86 typedef struct {
90  size_t num_samps;
92  bool stream_now;
98 
99 struct uhd_rx_streamer;
100 struct uhd_tx_streamer;
101 
103 
106 typedef struct uhd_rx_streamer* uhd_rx_streamer_handle;
107 
109 
112 typedef struct uhd_tx_streamer* uhd_tx_streamer_handle;
113 
114 #ifdef __cplusplus
115 extern "C" {
116 #endif
117 
118 /*
119  * RX Streamer
120  */
121 
123 
129 );
130 
132 
138 );
139 
143  size_t *num_channels_out
144 );
145 
149  size_t *max_num_samps_out
150 );
151 
153 
166  void** buffs,
167  size_t samps_per_buff,
169  double timeout,
170  bool one_packet,
171  size_t *items_recvd
172 );
173 
175 
180  const uhd_stream_cmd_t *stream_cmd
181 );
182 
184 
194  char* error_out,
195  size_t strbuffer_len
196 );
197 
198 /*
199  * TX Streamer
200  */
201 
203 
209 );
210 
212 
218 );
219 
223  size_t *num_channels_out
224 );
225 
229  size_t *max_num_samps_out
230 );
231 
233 
245  const void **buffs,
246  size_t samps_per_buff,
248  double timeout,
249  size_t *items_sent
250 );
251 
253 
259  double timeout,
260  bool *valid
261 );
262 
264 
274  char* error_out,
275  size_t strbuffer_len
276 );
277 
278 #ifdef __cplusplus
279 }
280 #endif
281 
282 /****************************************************************************
283  * Public Datatypes for USRP / streamer handling.
284  ***************************************************************************/
285 struct uhd_usrp;
286 
288 /*
289  * See uhd::usrp::multi_usrp for more details.
290  *
291  * NOTE: You must pass this handle into uhd_usrp_make before using it.
292  */
293 typedef struct uhd_usrp* uhd_usrp_handle;
294 
295 /****************************************************************************
296  * USRP Make / Free API calls
297  ***************************************************************************/
298 #ifdef __cplusplus
299 extern "C" {
300 #endif
301 
303 
307  const char* args,
308  uhd_string_vector_handle *strings_out
309 );
310 
312 
317  uhd_usrp_handle *h,
318  const char *args
319 );
320 
322 
327  uhd_usrp_handle *h
328 );
329 
332  uhd_usrp_handle h,
333  char* error_out,
334  size_t strbuffer_len
335 );
336 
339  uhd_usrp_handle h,
340  uhd_stream_args_t *stream_args,
342 );
343 
346  uhd_usrp_handle h,
347  uhd_stream_args_t *stream_args,
349 );
350 
351 /****************************************************************************
352  * multi_usrp API calls
353  ***************************************************************************/
354 
356 
360  uhd_usrp_handle h,
361  size_t chan,
362  uhd_usrp_rx_info_t *info_out
363 );
364 
366 
370  uhd_usrp_handle h,
371  size_t chan,
372  uhd_usrp_tx_info_t *info_out
373 );
374 
375 /****************************************************************************
376  * Motherboard methods
377  ***************************************************************************/
378 
380 
384  uhd_usrp_handle h,
385  double rate,
386  size_t mboard
387 );
388 
390 
394  uhd_usrp_handle h,
395  size_t mboard,
396  double *clock_rate_out
397 );
398 
400 
404  uhd_usrp_handle h,
405  char* pp_string_out,
406  size_t strbuffer_len
407 );
408 
410 
414  uhd_usrp_handle h,
415  size_t mboard,
416  char* mboard_name_out,
417  size_t strbuffer_len
418 );
419 
421 
425  uhd_usrp_handle h,
426  size_t mboard,
427  time_t *full_secs_out,
428  double *frac_secs_out
429 );
430 
432 
436  uhd_usrp_handle h,
437  size_t mboard,
438  time_t *full_secs_out,
439  double *frac_secs_out
440 );
441 
443 
447  uhd_usrp_handle h,
448  time_t full_secs,
449  double frac_secs,
450  size_t mboard
451 );
452 
454 
458  uhd_usrp_handle h,
459  time_t full_secs,
460  double frac_secs,
461  size_t mboard
462 );
463 
465 
469  uhd_usrp_handle h,
470  time_t full_secs,
471  double frac_secs
472 );
473 
476  uhd_usrp_handle h,
477  bool *result_out
478 );
479 
481 
485  uhd_usrp_handle h,
486  time_t full_secs,
487  double frac_secs,
488  size_t mboard
489 );
490 
493  uhd_usrp_handle h,
494  size_t mboard
495 );
496 
498 
502  uhd_usrp_handle h,
503  const char* time_source,
504  size_t mboard
505 );
506 
508 
512  uhd_usrp_handle h,
513  size_t mboard,
514  char* time_source_out,
515  size_t strbuffer_len
516 );
517 
520  uhd_usrp_handle h,
521  size_t mboard,
522  uhd_string_vector_handle *time_sources_out
523 );
524 
526 
530  uhd_usrp_handle h,
531  const char* clock_source,
532  size_t mboard
533 );
534 
536 
540  uhd_usrp_handle h,
541  size_t mboard,
542  char* clock_source_out,
543  size_t strbuffer_len
544 );
545 
548  uhd_usrp_handle h,
549  size_t mboard,
550  uhd_string_vector_handle *clock_sources_out
551 );
552 
554 
558  uhd_usrp_handle h,
559  bool enb,
560  size_t mboard
561 );
562 
564 
568  uhd_usrp_handle h,
569  bool enb,
570  size_t mboard
571 );
572 
575  uhd_usrp_handle h,
576  size_t *num_mboards_out
577 );
578 
581  uhd_usrp_handle h,
582  const char* name,
583  size_t mboard,
584  uhd_sensor_value_handle *sensor_value_out
585 );
586 
589  uhd_usrp_handle h,
590  size_t mboard,
591  uhd_string_vector_handle *mboard_sensor_names_out
592 );
593 
595 
599  uhd_usrp_handle h,
600  uint8_t addr,
601  uint32_t data,
602  size_t mboard
603 );
604 
605 /****************************************************************************
606  * EEPROM access methods
607  ***************************************************************************/
608 
611  uhd_usrp_handle h,
612  uhd_mboard_eeprom_handle mb_eeprom,
613  size_t mboard
614 );
615 
618  uhd_usrp_handle h,
619  uhd_mboard_eeprom_handle mb_eeprom,
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 
634  uhd_usrp_handle h,
635  uhd_dboard_eeprom_handle db_eeprom,
636  const char* unit,
637  const char* slot,
638  size_t mboard
639 );
640 
641 /****************************************************************************
642  * RX methods
643  ***************************************************************************/
644 
646 
650  uhd_usrp_handle h,
651  uhd_subdev_spec_handle subdev_spec,
652  size_t mboard
653 );
654 
657  uhd_usrp_handle h,
658  size_t mboard,
659  uhd_subdev_spec_handle subdev_spec_out
660 );
661 
664  uhd_usrp_handle h,
665  size_t *num_channels_out
666 );
667 
670  uhd_usrp_handle h,
671  size_t chan,
672  char* rx_subdev_name_out,
673  size_t strbuffer_len
674 );
675 
678  uhd_usrp_handle h,
679  double rate,
680  size_t chan
681 );
682 
685  uhd_usrp_handle h,
686  size_t chan,
687  double *rate_out
688 );
689 
692  uhd_usrp_handle h,
693  size_t chan,
694  uhd_meta_range_handle rates_out
695 );
696 
699  uhd_usrp_handle h,
700  uhd_tune_request_t *tune_request,
701  size_t chan,
702  uhd_tune_result_t *tune_result
703 );
704 
707  uhd_usrp_handle h,
708  size_t chan,
709  double *freq_out
710 );
711 
713 
717  uhd_usrp_handle h,
718  size_t chan,
719  uhd_meta_range_handle freq_range_out
720 );
721 
724  uhd_usrp_handle h,
725  size_t chan,
726  uhd_meta_range_handle freq_range_out
727 );
728 
730 UHD_UNUSED(static const char* UHD_USRP_ALL_LOS) = "all";
731 
733 /*
734  * See uhd::usrp::multi_usrp::get_rx_lo_names() for more details.
735  */
737  uhd_usrp_handle h,
738  size_t chan,
739  uhd_string_vector_handle *rx_lo_names_out
740 );
741 
743 /*
744  * See uhd::usrp::multi_usrp::set_rx_lo_source() for more details.
745  */
747  uhd_usrp_handle h,
748  const char* src,
749  const char* name,
750  size_t chan
751 );
752 
755  uhd_usrp_handle h,
756  const char* name,
757  size_t chan,
758  char* rx_lo_source_out,
759  size_t strbuffer_len
760 );
761 
764  uhd_usrp_handle h,
765  const char* name,
766  size_t chan,
767  uhd_string_vector_handle *rx_lo_sources_out
768 );
769 
771 /*
772  * See uhd::usrp::multi_usrp::set_rx_lo_enabled() for more details.
773  */
775  uhd_usrp_handle h,
776  bool enabled,
777  const char* name,
778  size_t chan
779 );
780 
783  uhd_usrp_handle h,
784  const char* name,
785  size_t chan,
786  bool* result_out
787 );
788 
791  uhd_usrp_handle h,
792  double freq,
793  const char* name,
794  size_t chan,
795  double* coerced_freq_out
796 );
797 
800  uhd_usrp_handle h,
801  const char* name,
802  size_t chan,
803  double* rx_lo_freq_out
804 );
805 
808  uhd_usrp_handle h,
809  double gain,
810  size_t chan,
811  const char *gain_name
812 );
813 
815 
819  uhd_usrp_handle h,
820  double gain,
821  size_t chan
822 );
823 
825 
829  uhd_usrp_handle h,
830  bool enable,
831  size_t chan
832 );
833 
836  uhd_usrp_handle h,
837  size_t chan,
838  const char *gain_name,
839  double *gain_out
840 );
841 
843 
847  uhd_usrp_handle h,
848  size_t chan,
849  double *gain_out
850 );
851 
854  uhd_usrp_handle h,
855  const char* name,
856  size_t chan,
857  uhd_meta_range_handle gain_range_out
858 );
859 
862  uhd_usrp_handle h,
863  size_t chan,
864  uhd_string_vector_handle *gain_names_out
865 );
866 
869  uhd_usrp_handle h,
870  const char* ant,
871  size_t chan
872 );
873 
876  uhd_usrp_handle h,
877  size_t chan,
878  char* ant_out,
879  size_t strbuffer_len
880 );
881 
884  uhd_usrp_handle h,
885  size_t chan,
886  uhd_string_vector_handle *antennas_out
887 );
888 
891  uhd_usrp_handle h,
892  size_t chan,
893  uhd_string_vector_handle *sensor_names_out
894 );
895 
898  uhd_usrp_handle h,
899  double bandwidth,
900  size_t chan
901 );
902 
905  uhd_usrp_handle h,
906  size_t chan,
907  double *bandwidth_out
908 );
909 
912  uhd_usrp_handle h,
913  size_t chan,
914  uhd_meta_range_handle bandwidth_range_out
915 );
916 
919  uhd_usrp_handle h,
920  const char* name,
921  size_t chan,
922  uhd_sensor_value_handle *sensor_value_out
923 );
924 
926 
930  uhd_usrp_handle h,
931  bool enb,
932  size_t chan
933 );
934 
937  uhd_usrp_handle h,
938  bool enb,
939  size_t chan
940 );
941 
942 /****************************************************************************
943  * TX methods
944  ***************************************************************************/
945 
947 
951  uhd_usrp_handle h,
952  uhd_subdev_spec_handle subdev_spec,
953  size_t mboard
954 );
955 
958  uhd_usrp_handle h,
959  size_t mboard,
960  uhd_subdev_spec_handle subdev_spec_out
961 );
962 
965  uhd_usrp_handle h,
966  size_t *num_channels_out
967 );
968 
971  uhd_usrp_handle h,
972  size_t chan,
973  char* tx_subdev_name_out,
974  size_t strbuffer_len
975 );
976 
979  uhd_usrp_handle h,
980  double rate,
981  size_t chan
982 );
983 
986  uhd_usrp_handle h,
987  size_t chan,
988  double *rate_out
989 );
990 
993  uhd_usrp_handle h,
994  size_t chan,
995  uhd_meta_range_handle rates_out
996 );
997 
1000  uhd_usrp_handle h,
1001  uhd_tune_request_t *tune_request,
1002  size_t chan,
1003  uhd_tune_result_t *tune_result
1004 );
1005 
1008  uhd_usrp_handle h,
1009  size_t chan,
1010  double *freq_out
1011 );
1012 
1014 
1018  uhd_usrp_handle h,
1019  size_t chan,
1020  uhd_meta_range_handle freq_range_out
1021 );
1022 
1025  uhd_usrp_handle h,
1026  size_t chan,
1027  uhd_meta_range_handle freq_range_out
1028 );
1029 
1032  uhd_usrp_handle h,
1033  double gain,
1034  size_t chan,
1035  const char *gain_name
1036 );
1037 
1039 
1043  uhd_usrp_handle h,
1044  double gain,
1045  size_t chan
1046 );
1047 
1050  uhd_usrp_handle h,
1051  const char* name,
1052  size_t chan,
1053  uhd_meta_range_handle gain_range_out
1054 );
1055 
1058  uhd_usrp_handle h,
1059  size_t chan,
1060  const char *gain_name,
1061  double *gain_out
1062 );
1063 
1065 
1069  uhd_usrp_handle h,
1070  size_t chan,
1071  double *gain_out
1072 );
1073 
1076  uhd_usrp_handle h,
1077  size_t chan,
1078  uhd_string_vector_handle *gain_names_out
1079 );
1080 
1083  uhd_usrp_handle h,
1084  const char* ant,
1085  size_t chan
1086 );
1087 
1090  uhd_usrp_handle h,
1091  size_t chan,
1092  char* ant_out,
1093  size_t strbuffer_len
1094 );
1095 
1098  uhd_usrp_handle h,
1099  size_t chan,
1100  uhd_string_vector_handle *antennas_out
1101 );
1102 
1105  uhd_usrp_handle h,
1106  double bandwidth,
1107  size_t chan
1108 );
1109 
1112  uhd_usrp_handle h,
1113  size_t chan,
1114  double *bandwidth_out
1115 );
1116 
1119  uhd_usrp_handle h,
1120  size_t chan,
1121  uhd_meta_range_handle bandwidth_range_out
1122 );
1123 
1126  uhd_usrp_handle h,
1127  const char* name,
1128  size_t chan,
1129  uhd_sensor_value_handle *sensor_value_out
1130 );
1131 
1134  uhd_usrp_handle h,
1135  size_t chan,
1136  uhd_string_vector_handle *sensor_names_out
1137 );
1138 
1140 
1144  uhd_usrp_handle h,
1145  bool enb,
1146  size_t chan
1147 );
1148 
1151  uhd_usrp_handle h,
1152  bool enb,
1153  size_t chan
1154 );
1155 
1156 /****************************************************************************
1157  * GPIO methods
1158  ***************************************************************************/
1159 
1162  uhd_usrp_handle h,
1163  size_t mboard,
1164  uhd_string_vector_handle *gpio_banks_out
1165 );
1166 
1168 
1172  uhd_usrp_handle h,
1173  const char* bank,
1174  const char* attr,
1175  uint32_t value,
1176  uint32_t mask,
1177  size_t mboard
1178 );
1179 
1181 
1185  uhd_usrp_handle h,
1186  const char* bank,
1187  const char* attr,
1188  size_t mboard,
1189  uint32_t *attr_out
1190 );
1191 
1194  uhd_usrp_handle h,
1195  size_t mboard,
1196  uhd_string_vector_handle *registers_out
1197 );
1198 
1201  uhd_usrp_handle h,
1202  const char* path,
1203  size_t mboard,
1204  uhd_usrp_register_info_t *register_info_out
1205 );
1206 
1209  uhd_usrp_handle h,
1210  const char* path,
1211  uint32_t field,
1212  uint64_t value,
1213  size_t mboard
1214 );
1215 
1218  uhd_usrp_handle h,
1219  const char* path,
1220  uint32_t field,
1221  size_t mboard,
1222  uint64_t *value_out
1223 );
1224 
1225 #ifdef __cplusplus
1226 }
1227 #endif
1228 
1229 #endif /* INCLUDED_UHD_USRP_H */
Stream samples indefinitely.
Definition: usrp.h:73
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:92
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:54
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:42
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:88
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:96
bool writable
Definition: usrp.h:43
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:293
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:75
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:41
char * cpu_format
Format of host memory.
Definition: usrp.h:56
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:40
char * args
Other stream args.
Definition: usrp.h:60
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:77
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:86
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:71
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:106
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:79
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:62
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:64
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:90
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:112
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:58
time_t time_spec_full_secs
If not now, then full seconds into future to stream.
Definition: usrp.h:94
UHD_API uhd_error uhd_rx_streamer_free(uhd_rx_streamer_handle *h)
Free an RX streamer handle.