Skip to content

Commit 1fb307d

Browse files
committed
Merge remote-tracking branch 'mbant/uhd/msg_format' into qt_the_things
2 parents d83f037 + 12523cd commit 1fb307d

11 files changed

+1669
-204
lines changed

gr-uhd/doc/uhd.dox

+51-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// vim: set ft=doxygen:
21
/*! \page page_uhd UHD Interface
32

43
\section Introduction
@@ -22,15 +21,61 @@ by using:
2221
\endcode
2322

2423

25-
\section External Documentation
24+
\section uhd_external_docs External Documentation
2625

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:
2827

29-
http://files.ettus.com/uhd_docs/manual/html/
28+
http://files.ettus.com/uhd_docs/manual/html/
3029

3130
The UHD Doxygen page is located at:
3231

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.
3479

3580

3681
\section Configuring a UHD object
@@ -100,3 +145,4 @@ resampler to take care of the difference.
100145
\endcode
101146

102147
*/
148+
// vim: set ft=doxygen:

0 commit comments

Comments
 (0)