mirror of
https://github.com/greatscottgadgets/hackrf.git
synced 2026-03-13 18:58:54 +01:00
Add flash status read
This commit is contained in:
@@ -79,6 +79,7 @@ typedef enum {
|
||||
HACKRF_VENDOR_REQUEST_SET_HW_SYNC_MODE = 29,
|
||||
HACKRF_VENDOR_REQUEST_RESET = 30,
|
||||
HACKRF_VENDOR_REQUEST_OPERACAKE_SET_RANGES = 31,
|
||||
HACKRF_VENDOR_REQUEST_SPIFLASH_STATUS = 32,
|
||||
} hackrf_vendor_request;
|
||||
|
||||
#define USB_CONFIG_STANDARD 0x1
|
||||
@@ -957,6 +958,30 @@ int ADDCALL hackrf_spiflash_read(hackrf_device* device, const uint32_t address,
|
||||
}
|
||||
}
|
||||
|
||||
int ADDCALL hackrf_spiflash_status(hackrf_device* device, uint8_t* data)
|
||||
{
|
||||
int result;
|
||||
|
||||
result = libusb_control_transfer(
|
||||
device->usb_device,
|
||||
LIBUSB_ENDPOINT_IN | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,
|
||||
HACKRF_VENDOR_REQUEST_SPIFLASH_STATUS,
|
||||
0,
|
||||
0,
|
||||
data,
|
||||
2,
|
||||
0
|
||||
);
|
||||
|
||||
if (result < 1)
|
||||
{
|
||||
last_libusb_error = result;
|
||||
return HACKRF_ERROR_LIBUSB;
|
||||
} else {
|
||||
return HACKRF_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
int ADDCALL hackrf_cpld_write(hackrf_device* device,
|
||||
unsigned char* const data, const unsigned int total_length)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user