29 Commits

Author SHA1 Message Date
Mike Walters
f426ac2174 hackrf_spiflash: use defines for compatibility_check return value 2023-01-05 15:13:06 +00:00
Michael Ossmann
06b9d7bee0 Clean up source code copyright notices. 2022-09-23 14:46:52 -04:00
Michael Ossmann
9329c5e44e Detect hardware platform at run-time.
Firmware now detects the hardware it is running on at startup and
refuses to run if it is compiled for the wrong platform. The board ID
returned by firmware to the host is now derived from run-time detection
rather than a compile-time value. A separate method to retrieve
compile-time supported platform is added.

On HackRF One, pin straps are checked to determine hardware revision.
This is informational to aid troubleshooting and does not affect any
function.
2022-09-14 07:08:47 -04:00
Martin Ling
c0d13de598 Add braces to all control statements without them. 2022-08-03 23:46:46 +01:00
Martin Ling
c3fdf402d7 Reformat all code to new clang-format standard. 2022-08-03 23:46:44 +01:00
Michael Ossmann
a6fa7876cb Give descriptive names to streams.
They were previously given the confusing name of fd even though they are
not file descriptors.
2021-01-27 11:59:29 -07:00
Dominic Spill
5f560d6ad3 Merge branch 'mossmann-master' into flash-investigation 2017-12-05 16:18:19 -07:00
Dominic Spill
c416fa1294 SPI Flash: add function to clear SPI flash status register 2017-11-06 10:42:19 -07:00
Dominic Spill
f20763419f Optional spi flash status read 2017-09-12 18:04:15 -06:00
Dominic Spill
8f544ee60d Add flash status read 2017-09-12 17:52:07 -06:00
Dominic Spill
fb24c389a4 Fix issue with rad1o compatibility check string 2017-08-11 08:00:01 +01:00
Dominic Spill
75d3a0a5b1 Add check for correct firmware when flashing to a devices
It's using the product string for now, but there are other
things that we could check too. Use -i to ignore the check.
rad1o badge will always pass the check because it uses
"HackRF" as the product string, whichis a substring of both
other devices..
2017-08-09 11:29:24 +01:00
Dominic Spill
35df00bd84 Remove repeated check for fd==NULL 2017-02-04 00:06:23 -07:00
Dominic Spill
255b7b4705 Add USB API versioning 2017-01-30 18:30:17 -07:00
Michael Ossmann
0b061134b0 Filled in some missing long options for command line tools that use long options. 2017-01-29 18:32:11 -07:00
Michael Ossmann
9211b70770 Added -h/-? option for help to all command line tools. 2017-01-29 17:37:29 -07:00
Dominic Spill
da743b84ef Safely call hackrf_close() after resetting the HackRF 2017-01-27 16:08:57 -07:00
Dominic Spill
9e78ccb4e7 Correct argument parsing logic 2017-01-27 16:06:01 -07:00
Dominic Spill
b047dd0cb4 Add software controlled reset 2017-01-27 15:03:53 -07:00
Dominic Spill
a062596819 Default SPI flash read length to size of SPI flash
Fixes #214
2015-09-09 12:08:28 +01:00
Jared Boone
8cfa81f40c Add hackrf_spiflash verbose option, make default not-verbose. 2015-07-10 10:32:55 -07:00
Heikki Hannikainen
c0b3638cce Do not break hackrf_open() API, provide a hackrf_open_by_serial() instead for the new functionality. 2015-02-24 07:43:45 +02:00
Heikki Hannikainen
6aa5f00186 hackrf_spiflash: added -d for device serial number 2015-02-24 01:13:31 +02:00
Jared Boone
9dbe967bf2 Serial number firmware and host-side changes. Very hacky at this point.
Among the TODOs:
* Refactor obtaining LPC serial number and chip ID into separate API and header/source files. Remove from main().
* Create a usb_set_serial_number_descriptor() or similar function to be called before USB stack is started.
* Ensure USB serial number descriptor is valid even if code forgets to initialize the serial number before the USB stack is started. May be as simple as providing default initializer for usb_descriptor_string_serial_number[].
* Create a #define/constant for the usb_descriptor_string_serial_number length.
* Identify what's causing intermittent crashes in hackrf_transfer when no serial number is specified. I'm probably misusing getopt.
* Permit serial number without leading zeros so you don't have to type as much.
* Add support for serial number argument in other hackrf_* tools.
* Provide libhackrf support for enumerating multiple HackRFs, so that hackrf_info can list all devices. May require an additional libhackrf function, outside of hackrf_open().

...and anything else that makes this less of a hack.
2015-02-23 19:23:31 +02:00
Hoernchen
56830da123 tools: x64 fixes for msvc 2013-06-11 13:27:34 +02:00
TitanMKD
54ef9c9508 hackrf_spiflash added checks & error on fileopen() error for read & write. 2013-06-07 19:37:37 +02:00
Michael Ossmann
14257a0032 fix #define false 1 2013-05-28 22:50:54 -06:00
Hoernchen
a9c301cfd4 windows, pt3 2013-05-27 14:02:15 +02:00
TitanMKD
345794fdb9 Moved host/libhackrf/examples to host/hackrf-tools 2013-05-17 01:13:24 +02:00