Skip to content

Commit 0afc985

Browse files
authored
Update some outdated technical docs (#1190)
* update outdated libhackrf documentation * update outdated hackrf_sweep documentation
1 parent dfb6611 commit 0afc985

File tree

2 files changed

+31
-24
lines changed

2 files changed

+31
-24
lines changed

docs/source/hackrf_sweep.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ Usage
1414
[-p antenna_enable] # Antenna port power, 1=Enable, 0=Disable
1515
[-l gain_db] # RX LNA (IF) gain, 0-40dB, 8dB steps
1616
[-g gain_db] # RX VGA (baseband) gain, 0-62dB, 2dB steps
17-
[-n num_samples] # Number of samples per frequency, 8192-4294967296
18-
[-w bin_width] # FFT bin width (frequency resolution) in Hz
17+
[-w bin_width] # FFT bin width (frequency resolution) in Hz, 2445-5000000
1918
[-1] # one shot mode
19+
[-N num_sweeps] # Number of sweeps to perform
2020
[-B] # binary output
2121
[-I] # binary inverse FFT output
2222
-r filename # output file
@@ -112,8 +112,8 @@ Running ``hackrf_sweep -f 2400:2490`` gives the following example results:
112112
- -66.02
113113
- -62.12
114114
115-
Two ranges of 5 MHz are analyzed at once from the same set of samples, so a single timestamp applies to the whole range.
115+
Each sweep across the entire specified frequency range is given a single time stamp.
116116

117117
The fifth column tells you the width in Hz (1 MHz in this case) of each frequency bin, which you can set with ``-w``. The sixth column is the number of samples analyzed to produce that row of data.
118118

119-
Each of the remaining columns shows the power detected in each of several frequency bins. In this case there are five bins, the first from 2400 to 2401 MHz, the second from 2401 to 2402 MHz, and so forth.
119+
Each of the remaining columns shows the power detected in each of several frequency bins. In this case there are five bins, the first from 2400 to 2401 MHz, the second from 2401 to 2402 MHz, and so forth.

docs/source/libhackrf_api.rst

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ Compute nearest freq for bw filter (manual filter)
197197
Reading and Writing Registers
198198
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
199199

200+
These low level functions are intended for debugging purposes only.
201+
200202

201203
HackRF MAX2837 Read
202204
^^^^^^^^^^^^^^^^^^^
@@ -282,7 +284,7 @@ Updating Firmware
282284
HackRF CPLD Write
283285
^^^^^^^^^^^^^^^^^
284286

285-
Device will need to be reset after hackrf_cpld_write.
287+
A bitstream is written to the CPLD by the firmware during normal operation (since release 2021.03.1). This function writes a bitstream to the CPLD's flash which is not necessary for normal use. The device will need to be reset by physically pressing the reset button after hackrf_cpld_write.
286288

287289
**Syntax:** ``int hackrf_cpld_write(hackrf_device* device, unsigned char* const data, const unsigned int total_length)``
288290

@@ -462,35 +464,37 @@ These values identify the board type of the connected hardware. This value can b
462464
463465
* - Board
464466
- Frequency range
465-
- Bandwidth
467+
- Sample Rate
466468
- Antenna port power
467469
* - HackRF One
468-
- 1MHz - 6Ghz
469-
- 20MHz
470+
- 1 MHz–6 GHz
471+
- 20 Msps
470472
- Yes
471473
* - Jawbreaker
472-
- 10MHz - 6GHz
473-
- 20MHz
474+
- 10 MHz–6 GHz
475+
- 20 Msps
476+
- No
477+
* - rad1o
478+
- 50 MHz–4 GHz
479+
- 20 Msps
474480
- No
475-
* - Rad1o
476-
- 50MHz - 4GHz
477-
- 20MHz
478-
- Unknown
479481
* - Jellybean
480482
- N/A
481-
- 20MHz
483+
- 20 Msps
482484
- No
483485
484-
Most boards will identify as HackRF One, Jawbreaker or Rad1o. Jellybean was a pre-production revision of HackRF. No hardware device should intentionally report itself with an invalid board ID.
486+
Most boards will identify as HackRF One, Jawbreaker, or rad1o. Jellybean was a pre-production revision of HackRF that is no longer supported. No hardware device should intentionally report itself with an unrecognized or undetected board ID.
485487

486488
.. code-block :: sh
487489
488490
enum hackrf_board_id {
489491
BOARD_ID_JELLYBEAN = 0,
490492
BOARD_ID_JAWBREAKER = 1,
491-
BOARD_ID_HACKRF_ONE = 2,
493+
BOARD_ID_HACKRF1_OG = 2,
492494
BOARD_ID_RAD1O = 3,
493-
BOARD_ID_INVALID = 0xFF,
495+
BOARD_ID_HACKRF1_R9 = 4,
496+
BOARD_ID_UNRECOGNIZED = 0xFE,
497+
BOARD_ID_UNDETECTED = 0xFF,
494498
};
495499
496500
@@ -512,18 +516,19 @@ USB Product IDs
512516
Transceiver Mode
513517
^^^^^^^^^^^^^^^^
514518

515-
HackRF can operate in three main transceiver modes, Receive, Transmit and Signal Source. There is also a CPLD update mode which is used to write firmware images to the CPLD.
519+
HackRF can operate in four main transceiver modes: Receive, Transmit, Signal Source, and Sweep. There is also a CPLD update mode which is used to write firmware images to the CPLD flash.
516520

517521
The transceiver mode can be changed with ``hackrf_set_transceiver_mode`` with the value parameter set to one of the following:
518522

519523
.. code-block:: sh
520524
521525
enum transceiver_mode_t {
522-
TRANSCEIVER_MODE_OFF = 0,
523-
TRANSCEIVER_MODE_RX = 1,
524-
TRANSCEIVER_MODE_TX = 2,
525-
TRANSCEIVER_MODE_SS = 3,
526-
TRANSCEIVER_MODE_CPLD_UPDATE = 4
526+
HACKRF_TRANSCEIVER_MODE_OFF = 0,
527+
HACKRF_TRANSCEIVER_MODE_RECEIVE = 1,
528+
HACKRF_TRANSCEIVER_MODE_TRANSMIT = 2,
529+
HACKRF_TRANSCEIVER_MODE_SS = 3,
530+
TRANSCEIVER_MODE_CPLD_UPDATE = 4,
531+
TRANSCEIVER_MODE_RX_SWEEP = 5,
527532
};
528533
529534
Receive mode (TRANSCEIVER_MODE_RX) is used to stream samples from the radio to the host system. Use ``hackrf_set_freq`` to set the center frequency of receiver and ``hackrf_set_sample_rate`` to set the sample rate (effective bandwidth).
@@ -551,6 +556,8 @@ Function return values
551556
HACKRF_ERROR_STREAMING_THREAD_ERR = -1002,
552557
HACKRF_ERROR_STREAMING_STOPPED = -1003,
553558
HACKRF_ERROR_STREAMING_EXIT_CALLED = -1004,
559+
HACKRF_ERROR_USB_API_VERSION = -1005,
560+
HACKRF_ERROR_NOT_LAST_DEVICE = -2000,
554561
HACKRF_ERROR_OTHER = -9999,
555562
};
556563

0 commit comments

Comments
 (0)