diff --git a/host/libraries/libbladeRF/doc/doxygen/mainpage.dox b/host/libraries/libbladeRF/doc/doxygen/mainpage.dox
index 609b02f6..b7ca939c 100644
--- a/host/libraries/libbladeRF/doc/doxygen/mainpage.dox
+++ b/host/libraries/libbladeRF/doc/doxygen/mainpage.dox
@@ -27,13 +27,13 @@ accessible knowledge base of common questions and answers to be developed.
Bugs, both in libbladeRF and this documentation, may be reported on the
GitHub issue tracker
-@attention libbladeRF 2.0.0 introduces breaking changes to the parameter lists
+@attention libbladeRF 2.0 introduces breaking changes to the parameter lists
for bladerf_get_frequency(), bladerf_stream(), and
bladerf_sync_config().
@attention Existing code using these functions @b must be updated to be
compatible with this version. See the
- \ref relnotes_2_0_0_api_freq_uint64 and
- \ref relnotes_2_0_0_api_stream sections of the \ref relnotes_2_0_0
+ \ref relnotes_2_0_api_freq_uint64 and
+ \ref relnotes_2_0_api_stream sections of the \ref relnotes_2_0
document for guidance.
+Required actions
+| API Component | Importance | Action |
+
+ | bladerf_sync_config() |
+ Required |
+
+ The `bladerf_module` argument has been replaced with
+ \ref bladerf_channel_layout.
+
+ Replace `BLADERF_MODULE_RX` with \ref BLADERF_RX_X1, and
+ `BLADERF_MODULE_TX` with \ref BLADERF_TX_X1.
+
+ \warning Applications using these functions must be modified to pass
+ in the correct type.
+
+ \note Existing `bladerf_module` values are valid for SISO applications,
+ but an explicit cast is usually required:
+```
+void configure_module_sync(bladerf_module module) {
+ // ...
+ status = bladerf_sync_config(dev, (bladerf_channel_layout)module, format, num_buffers, buffer_size, num_transfers, stream_timeout);
+ // ...
+}
+```
+ |
+
+| bladerf_stream() |
+
+ | bladerf_get_timestamp() |
+ Optional |
+
+ The `bladerf_module` argument has been replaced with
+ \ref bladerf_direction.
+
+ Replace `BLADERF_MODULE_RX` with \ref BLADERF_RX, and
+ `BLADERF_MODULE_TX` with \ref BLADERF_TX.
+
+ \note Existing `bladerf_module` values are still valid, and a cast
+ should not be necessary.
+ |
+
+| bladerf_set_stream_timeout() |
+| bladerf_get_stream_timeout() |
+
+ | bladerf_sync_tx() |
+ Informational |
+
+ The `samples` parameter is now a pointer to a `const`, to enforce
+ safety. This should not impact user code.
+ |
+
+
+
+\remarks
+\li Don't use the `BLADERF_MODULE_RX` and `BLADERF_MODULE_TX` values.
+\li Do feel free to re-implement bladerf_interleave_stream_buffer() and/or
+ bladerf_deinterleave_stream_buffer() in a more efficient fashion. These
+ are convenience functions written for clarity and portability, not
+ performance.
+
+\see \ref relnotes_2_0_ref_channels
+\see \ref BLADERF_FORMAT_SC16_Q11 describes the sample interleaving format.
+\see bladerf_interleave_stream_buffer() - Interleaves contiguous blocks of
+ samples in preparation for MIMO TX.
+\see bladerf_deinterleave_stream_buffer() - Deinterleaves samples into
+ contiguous blocks after MIMO RX.
+\see bladerf_get_channel_count() - Get the number of RX or TX channels
+ supported by the given device.
+
+\subsection relnotes_2_0_api_channel bladerf_module replaced by bladerf_channel
+
+In libbladeRF 1.x, `bladerf_module` was an enum with two valid choices:
+`BLADERF_MODULE_RX` and `BLADERF_MODULE_TX`. To support MIMO, this enum has
+been replaced with \ref bladerf_channel, and a pair of convenience macros have
+been defined to specify channels: BLADERF_CHANNEL_RX(ch) and
+BLADERF_CHANNEL_TX(ch).
+
+For backwards compatibility, `bladerf_module` is a typedef of
+\ref bladerf_channel, and the `BLADERF_MODULE_RX` and `BLADERF_MODULE_TX`
+identifiers are now macros for BLADERF_CHANNEL_RX(0) and BLADERF_CHANNEL_TX(0)
+respectively.
+
+Note that some `bladerf_module` instances have been replaced with
+\ref bladerf_direction and \ref bladerf_channel_layout depending on context.
+See the \ref relnotes_2_0_api_stream section elsewhere in this document.
+
+
+Required actions
+| API Component | Importance | Action |
+
+ | bladerf_enable_module() |
+
+ Required for full compatibility
+
+ \note This action is required to fully support devices with multiple
+ channels. Without these changes, only the first channel will be
+ available for use.
+ |
+
+ Replace `bladerf_module` with \ref bladerf_channel.
+
+ Replace `BLADERF_MODULE_RX` with BLADERF_CHANNEL_RX(0), or
+ generally, BLADERF_CHANNEL_RX(channel_number)
+
+ Replace `BLADERF_MODULE_TX` with BLADERF_CHANNEL_TX(0), or
+ generally, BLADERF_CHANNEL_TX(channel_number)
+ |
+
+| bladerf_set_gain() |
+| bladerf_set_gain_mode() |
+| bladerf_get_gain_mode() |
+| bladerf_set_sample_rate() |
+| bladerf_set_rational_sample_rate() |
+| bladerf_get_sample_rate() |
+| bladerf_get_rational_sample_rate() |
+| bladerf_set_bandwidth() |
+| bladerf_get_bandwidth() |
+| bladerf_set_lpf_mode() |
+| bladerf_get_lpf_mode() |
+| bladerf_select_band() |
+| bladerf_set_frequency() |
+| bladerf_schedule_retune() |
+| bladerf_cancel_scheduled_retunes() |
+| bladerf_get_frequency() |
+| bladerf_get_quick_tune() |
+| bladerf_trigger_init() |
+| bladerf_set_correction() |
+| bladerf_get_correction() |
+| bladerf_xb200_set_filterbank() |
+| bladerf_xb200_get_filterbank() |
+| bladerf_xb200_set_path() |
+| bladerf_xb200_get_path() |
+| bladerf_read_trigger() |
+| bladerf_write_trigger() |
+
+
+\remarks
+\li Don't use `BLADERF_MODULE_RX` or `BLADERF_MODULE_TX`.
+\li Don't assume the number of channels available.
+\li Do always check bladerf_get_channel_count() to determine how many channels
+ are available in a given direction.
+\li Do use the BLADERF_CHANNEL_RX(channel) and BLADERF_CHANNEL_TX(channel)
+ convenience macros.
+
+\see \ref relnotes_2_0_ref_channels
+\see bladerf_get_channel_count() - Get the number of RX or TX channels
+ supported by the given device.
+
+\subsection relnotes_2_0_api_range Defined BLADERF_*_{MAX,MIN,etc} constants replaced by bladerf_get_*_range functions
+
+The precompiler constants for supported minimum/maximum values have been
+deprecated and replaced with a set of context-aware functions. The old
+constants will be removed in a later release.
+
+
+Required actions
+| API Component | Importance | Action |
+
+ | BLADERF_RXVGA1_GAIN_MIN |
+
+ Required for full compatibility
+
+ \note This action is required for proper functioning of new bladeRF
+ models. The old constants are only valid for the original
+ bladeRF, and are not valid for other models.
+ |
+
+ Use bladerf_get_gain_stage_range() to retrieve the range of allowable
+ gains for a specific gain stage.
+
+ \see bladerf_get_gain() and bladerf_set_gain()
+ |
+
+| BLADERF_RXVGA1_GAIN_MAX |
+| BLADERF_RXVGA2_GAIN_MIN |
+| BLADERF_RXVGA2_GAIN_MAX |
+| BLADERF_TXVGA1_GAIN_MIN |
+| BLADERF_TXVGA1_GAIN_MAX |
+| BLADERF_TXVGA2_GAIN_MIN |
+| BLADERF_TXVGA2_GAIN_MAX |
+| BLADERF_LNA_GAIN_MID_DB |
+| BLADERF_LNA_GAIN_MAX_DB |
+
+ | BLADERF_SAMPLERATE_MIN |
+
+ Use bladerf_get_sample_rate_range() to retrieve the range of allowable
+ sample rates for a given channel.
+ |
+
+| BLADERF_SAMPLERATE_REC_MAX |
+
+ | BLADERF_BANDWIDTH_MIN |
+
+ Use bladerf_get_bandwidth_range() to retrieve the supported range of
+ bandwidths for a given channel.
+ |
+
+| BLADERF_BANDWIDTH_MAX |
+
+ | BLADERF_FREQUENCY_MIN_XB200 |
+
+ Use bladerf_get_frequency_range() to retrieve the supported range of
+ frequencies for a given channel.
+
+ \note The range will vary depending on the particular hardware
+ configuration, such as if a XB-200 is attached.
+ |
+
+| BLADERF_FREQUENCY_MIN |
+| BLADERF_FREQUENCY_MAX |
+
+
+An example use of bladerf_get_frequency_range():
+
+\code{.c}
+bool is_frequency_within_range(struct bladerf *dev, bladerf_channel channel, bladerf_frequency frequency)
+{
+ int status;
+ struct bladerf_range range;
+
+ status = bladerf_get_frequency_range(dev, channel, &range);
+ if (status < 0) {
+ // error case
+ }
+
+ return ((frequency / range.scale) >= range.min && (frequency / range.scale) <= range.max);
+}
+\endcode
+
+\remarks
+\li Don't use the legacy `BLADERF_*_{MIN,MAX}` defines or any hardcoded values
+ derived from them.
+\li Don't assume that the ranges will remain constant throughout operation,
+ or that they are the same for all channels.
+\li Don't hardcode ranges, or guess them based on the board model.
+\li Do remember that the ranges can change depending on configuration, e.g.
+ bladerf_get_gain_range() may return different values for an RX channel
+ depending on the configured center frequency.
+\li Do call `bladerf_get_*_range()` every time you need to know -- don't
+ cache it!
+\li Do test to ensure user-supplied values are valid before using them, when
+ possible.
+\li Do handle \ref BLADERF_ERR_RANGE errors when setting values, especially if
+ you don't check for validity first. The library will only return this if
+ it is not sensible to clamp the value to be within range, e.g. with
+ bladerf_set_sample_rate().
+
+\see bladerf_get_gain_stages() - Get a list of available gain stages.
+\see bladerf_set_gain() - Set overall system gain.
+\see bladerf_get_gain() - Get overall system gain.
+
+\subsection relnotes_2_0_api_gain bladerf_{get,set}_gain range standardization
+
+Previously, the ranges used by bladerf_get_gain() and bladerf_set_gain() were
+somewhat arbitrary, with a value of 0 being the minimum possible gain, and the
+maximum possible gain being the sum of the max gain for all gain stages.
+
+To allow the same gain settings to produce similar results on all bladeRF
+models, we've adjusted the gain ranges for these two functions to define 60 dB
+as the maximum available gain on RX, and roughly +0 dBm output power on TX.
+
+
-Required actions
-| API Component | Importance | Action |
-
- | bladerf_sync_config() |
- Required |
-
- The `bladerf_module` argument has been replaced with
- \ref bladerf_channel_layout.
-
- Replace `BLADERF_MODULE_RX` with \ref BLADERF_RX_X1, and
- `BLADERF_MODULE_TX` with \ref BLADERF_TX_X1.
-
- \warning Applications using these functions must be modified to pass
- in the correct type.
-
- \note Existing `bladerf_module` values are valid for SISO applications,
- but an explicit cast is required:
-```
-void configure_module_sync(bladerf_module module) {
- // ...
- status = bladerf_sync_config(dev, (bladerf_channel_layout)module, format, num_buffers, buffer_size, num_transfers, stream_timeout);
- // ...
-}
-```
- |
-
-| bladerf_stream() |
-
- | bladerf_get_timestamp() |
- Minor |
-
- The `bladerf_module` argument has been replaced with
- \ref bladerf_direction.
-
- Replace `BLADERF_MODULE_RX` with \ref BLADERF_RX, and
- `BLADERF_MODULE_TX` with \ref BLADERF_TX.
-
- \note Existing `bladerf_module` values are still valid, and a cast
- should not be necessary.
- |
-
-| bladerf_set_stream_timeout() |
-| bladerf_get_stream_timeout() |
-
- | bladerf_sync_tx() |
-
- The `samples` parameter is now a pointer to a `const`.
-
- This should not impact user code.
- |
-
-
-
-\see \ref BLADERF_FORMAT_SC16_Q11 describes the sample interleaving format.
-\see bladerf_interleave_stream_buffer() - Interleaves contiguous blocks of
- samples in preparation for MIMO TX.
-\see bladerf_deinterleave_stream_buffer() - Deinterleaves samples into
- contiguous blocks after MIMO RX.
-\see bladerf_get_channel_count() - Get the number of RX or TX channels
- supported by the given device.
-
-\subsection relnotes_2_0_0_api_channel bladerf_channel replaces bladerf_module
-
-In libbladeRF 1.x, `bladerf_module` was an enum with two valid choices:
-`BLADERF_MODULE_RX` and `BLADERF_MODULE_TX`. To support MIMO, this enum has
-been replaced with \ref bladerf_channel, and a pair of convenience macros have
-been defined to specify channels: BLADERF_CHANNEL_RX(ch) and
-BLADERF_CHANNEL_TX(ch).
-
-For backwards compatibility, `bladerf_module` is a typedef of
-\ref bladerf_channel, and the `BLADERF_MODULE_RX` and `BLADERF_MODULE_TX`
-identifiers are now macros for BLADERF_CHANNEL_RX(0) and BLADERF_CHANNEL_TX(0)
-respectively.
-
-Note that some `bladerf_module` instances have been replaced with
-\ref bladerf_direction and \ref bladerf_channel_layout depending on context.
-See the \ref api_stream section elsewhere in this document.
-
-
-Required actions
-| API Component | Importance | Action |
-
- | bladerf_enable_module() |
- Required for MIMO support, optional otherwise |
-
- Replace `bladerf_module` with \ref bladerf_channel.
-
- Replace `BLADERF_MODULE_RX` with `BLADERF_CHANNEL_RX(0)`, or
- generally, `BLADERF_CHANNEL_RX(channel_number)`
-
- Replace `BLADERF_MODULE_TX` with `BLADERF_CHANNEL_TX(0)`, or
- generally, `BLADERF_CHANNEL_TX(channel_number)`
- |
-
-| bladerf_set_gain() |
-| bladerf_set_gain_mode() |
-| bladerf_get_gain_mode() |
-| bladerf_set_sample_rate() |
-| bladerf_set_rational_sample_rate() |
-| bladerf_get_sample_rate() |
-| bladerf_get_rational_sample_rate() |
-| bladerf_set_bandwidth() |
-| bladerf_get_bandwidth() |
-| bladerf_set_lpf_mode() |
-| bladerf_get_lpf_mode() |
-| bladerf_select_band() |
-| bladerf_set_frequency() |
-| bladerf_schedule_retune() |
-| bladerf_cancel_scheduled_retunes() |
-| bladerf_get_frequency() |
-| bladerf_get_quick_tune() |
-| bladerf_trigger_init() |
-| bladerf_set_correction() |
-| bladerf_get_correction() |
-| bladerf_xb200_set_filterbank() |
-| bladerf_xb200_get_filterbank() |
-| bladerf_xb200_set_path() |
-| bladerf_xb200_get_path() |
-| bladerf_read_trigger() |
-| bladerf_write_trigger() |
-
-
-\see bladerf_get_channel_count() - Get the number of RX or TX channels
- supported by the given device.
-
-\subsection relnotes_2_0_0_api_range bladerf_get_*_range functions replace #define'd constants
-
-The `#define`'d constants for supported minimum/maximum values have been
-deprecated and replaced with a set of context-aware functions.
-
-
-Required actions
-| API Component | Importance | Action |
-
- | BLADERF_RXVGA1_GAIN_MIN |
- Required for complete bladeRF Micro compatibility |
-
- Use bladerf_get_gain_stage_range() to retrieve the range of allowable
- gains for a specific gain stage. This should be called after setting
- the frequency with bladerf_set_frequency().
- |
-
-| BLADERF_RXVGA1_GAIN_MAX |
-| BLADERF_RXVGA2_GAIN_MIN |
-| BLADERF_RXVGA2_GAIN_MAX |
-| BLADERF_TXVGA1_GAIN_MIN |
-| BLADERF_TXVGA1_GAIN_MAX |
-| BLADERF_TXVGA2_GAIN_MIN |
-| BLADERF_TXVGA2_GAIN_MAX |
-| BLADERF_LNA_GAIN_MID_DB |
-| BLADERF_LNA_GAIN_MAX_DB |
-
- | BLADERF_SAMPLERATE_MIN |
-
- Use bladerf_get_sample_rate_range() to retrieve the range of allowable
- sample rates for a given channel.
- |
-
-| BLADERF_SAMPLERATE_REC_MAX |
-
- | BLADERF_BANDWIDTH_MIN |
-
- Use bladerf_get_bandwidth_range() to retrieve the supported range of
- bandwidths for a given channel.
- |
-
-| BLADERF_BANDWIDTH_MAX |
-
- | BLADERF_FREQUENCY_MIN_XB200 |
-
- Use bladerf_get_frequency_range() to retrieve the supported range of
- frequencies for a given channel.
-
- \note This will vary depending on the particular hardware configuration
- (such as if a XB-200 is attached).
- |
-
-| BLADERF_FREQUENCY_MIN |
-| BLADERF_FREQUENCY_MAX |
-
-
-An example use of bladerf_get_frequency_range():
-
-\code{.c}
-bool is_frequency_within_range(struct bladerf *dev, bladerf_channel channel, bladerf_frequency frequency)
-{
- int status;
- struct bladerf_range range;
-
- status = bladerf_get_frequency_range(dev, channel, &range);
- if (status < 0) {
- // error case
- }
-
- return ((frequency / range.scale) >= range.min && (frequency / range.scale) <= range.max);
-}
-\endcode
-
-\see bladerf_get_gain_stages() - Get a list of available gain stages.
-\see bladerf_set_gain() - Set overall system gain.
-\see bladerf_get_gain() - Get overall system gain.
-
-\subsection relnotes_2_0_0_api_typedefs New type definitions for parameters
-
-The following types are now defined:
-
-\li ::bladerf_gain (gain value in dB; `int`)
-\li ::bladerf_sample_rate (sample rate in samples per second; `unsigned int`)
-\li ::bladerf_bandwidth (bandwidth in Hz; `unsigned int`)
-\li ::bladerf_frequency (center frequency in Hz; `uint64_t`)
-\li ::bladerf_timestamp (timestamp in ticks; `uint64_t`)
-\li ::bladerf_correction_value (correction value in arbitrary units; `int16_t`)
-
-With the exception of ::bladerf_frequency, none of the underlying types changed
-from libbladeRF 1.x.x and no changes are strictly necessary. However, the
-declarations changed for the following functions:
-
-\li bladerf_set_gain()
-\li bladerf_get_gain()
-\li bladerf_set_gain_stage()
-\li bladerf_get_gain_stage()
-\li bladerf_set_sample_rate()
-\li bladerf_get_sample_rate()
-\li bladerf_set_bandwidth()
-\li bladerf_get_bandwidth()
-\li bladerf_select_band()
-\li bladerf_set_frequency()
-\li bladerf_get_frequency()
-\li bladerf_schedule_retune()
-\li bladerf_set_correction()
-\li bladerf_get_correction()
-\li bladerf_get_timestamp()
-
-As well as:
-
-\li struct bladerf_metadata
-
-\section relnotes_2_0_0_feats New features
-
-\subsection relnotes_2_0_0_feats_platform Multiple platform support
-
-We reorganized libbladeRF to easily support multiple hardware platforms. You
-will find a new directory tree, `host/libraries/libbladeRF/src/board/`,
-containing subdirectories for each supported platform (currently `bladerf1/` for
-the LMS6002D-based bladeRF family, and `bladerf2/` for the AD9361-based bladeRF
-Micro family).
-
-Likewise, product-specific API calls have been moved into two new header files:
-bladeRF1.h and bladeRF2.h. Functions which apply to all boards remain in
-libbladeRF.h.
-
-\see Refer to bladeRF1.h and bladeRF2.h for a list of affected functions.
-
-\note Using API calls specified in bladeRF1.h or bladeRF2.h is not recommended
- for most use cases. They are provided for backwards compatibility and
- low-level hardware control, and are subject to change.
-
-We also rearranged a number of source files into subdirectories of
-`host/libraries/libbladeRF/src/`. In addition to the pre-existing `backend/`,
-you'll also find `board/` (product-specific code), `driver/` (device drivers),
-`expansion/` (expansion board drivers), `helpers/` (helpful utility functions),
-and `streaming/` (sample streaming code).
-
-\subsection relnotes_2_0_0_feats_gc Gain control improvements
-
-The original manual gain control functionality in libbladeRF is very low-level
-and hardware-specific, and requires significant knowledge of the underlying
-RF module to adjust. As such, new gain control methods have been introduced
-to the API, and the following functions are now deprecated:
-
-\li bladerf_set_lna_gain() and bladerf_get_lna_gain()
-\li bladerf_set_rxvga1() and bladerf_get_rxvga1()
-\li bladerf_set_rxvga2() and bladerf_get_rxvga2()
-\li bladerf_set_txvga1() and bladerf_get_txvga1()
-\li bladerf_set_txvga2() and bladerf_get_txvga2()
-
-Instead, applications should use one of the following approaches:
-
-\subsubsection relnotes_2_0_0_feats_gc_agc Automatic Gain Control (AGC)
-
-Automatic gain control is available for RX channels, starting with
-