1
- // vim: set ft=doxygen:
2
1
/*! \page page_uhd UHD Interface
3
2
4
3
\section Introduction
@@ -22,15 +21,61 @@ by using:
22
21
\endcode
23
22
24
23
25
- \section External Documentation
24
+ \section uhd_external_docs External Documentation
26
25
27
- Ettus Research keeps the comprehensive documentation to the underlying UHD driver, which can be found:
26
+ Ettus Research maintains the comprehensive documentation to the underlying UHD driver, which can be found at :
28
27
29
- http://files.ettus.com/uhd_docs/manual/html/
28
+ http://files.ettus.com/uhd_docs/manual/html/
30
29
31
30
The UHD Doxygen page is located at:
32
31
33
- http://files.ettus.com/uhd_docs/doxygen/html/index.html
32
+ http://files.ettus.com/uhd_docs/doxygen/html/index.html
33
+
34
+
35
+ \section uhd_command_syntax Command Syntax
36
+
37
+ The UHD sink and source can be controlled by a message port. These message ports
38
+ take commands, which are PMTs formatted as such:
39
+
40
+ (command, value, [channel])
41
+
42
+ A command PMT is either a pair or a tuple. If it's a tuple, it must have either 2 or 3 elements.
43
+ Any other type of PMT will throw an error.
44
+
45
+ The `command` part is a string, which defines the command. `value` is a PMT whose format depends
46
+ on the command issued. Finally, `channel` is an integer PMT value that specifies which channel
47
+ this command shall be specified on. If this value is omitted, then it either applies this command
48
+ to all channels or channel zero, depending on which command is used.
49
+
50
+ Example:
51
+ \code{.cpp}
52
+ pmt::pmt_t command = pmt::cons( // We make a pair, but pmt::make_tuple() is also valid!
53
+ pmt::mp("freq"), // Use the 'freq' command, which sets the frequency
54
+ pmt::mp(1.1e9) // Set the frequency to 1.1 GHz
55
+ );
56
+ \endcode
57
+
58
+ This PMT would set the frequency to 1.1 GHz on all channels. We make use of the pmt::mp() function
59
+ which automatically sets the PMT types. Assume we only want to set the frequency on channel 1
60
+ (i.e. the second channel). In this case, we must construct a tuple:
61
+ \code{.cpp}
62
+ pmt::pmt_t command = pmt::make_tuple(
63
+ pmt::mp("freq"), // Use the 'freq' command, which sets the frequency
64
+ pmt::mp(1.1e9) // Set the frequency to 1.1 GHz
65
+ pmt::mp(1) // Select channel 1
66
+ );
67
+ \endcode
68
+
69
+
70
+ \subsection uhd_command_syntax_cmds Common commands
71
+
72
+ The following commands are understood by both UHD Source and Sink:
73
+
74
+ Command name | Value Type | Description
75
+ -------------|------------|-------------------------------------------------------------
76
+ `freq` | double | Sets the Tx or Rx frequency. Defaults to all channels.
77
+ `lo_offset` | double | Sets an LO offset. Defaults to all channels.
78
+ `gain` | double | Sets the Tx or Rx gain (in dB). Defaults to all channels.
34
79
35
80
36
81
\section Configuring a UHD object
@@ -100,3 +145,4 @@ resampler to take care of the difference.
100
145
\endcode
101
146
102
147
*/
148
+ // vim: set ft=doxygen:
0 commit comments