![]() |
libbladeRF
1.1.0
Nuand bladeRF library
|
Data Structures | |
| struct | bladerf_image |
Macros | |
| #define | BLADERF_IMAGE_MAGIC_LEN 7 |
| #define | BLADERF_IMAGE_CHECKSUM_LEN 32 |
| #define | BLADERF_IMAGE_RESERVED_LEN 128 |
Functions | |
| API_EXPORT struct bladerf_image *CALL_CONV | bladerf_alloc_image (bladerf_image_type type, uint32_t address, uint32_t length) |
| API_EXPORT struct bladerf_image *CALL_CONV | bladerf_alloc_cal_image (bladerf_fpga_size fpga_size, uint16_t vctcxo_trim) |
| API_EXPORT void CALL_CONV | bladerf_free_image (struct bladerf_image *image) |
| API_EXPORT int CALL_CONV | bladerf_image_write (struct bladerf_image *image, const char *file) |
| API_EXPORT int CALL_CONV | bladerf_image_read (struct bladerf_image *image, const char *file) |
This section contains a file format and associated routines for storing and loading flash contents with metadata.
| #define BLADERF_IMAGE_CHECKSUM_LEN 32 |
Size of bladeRF flash image checksum
Definition at line 2126 of file libbladeRF.h.
| #define BLADERF_IMAGE_MAGIC_LEN 7 |
Size of the magic signature at the beginning of bladeRF image files
Definition at line 2121 of file libbladeRF.h.
| #define BLADERF_IMAGE_RESERVED_LEN 128 |
Size of reserved region of flash image
Definition at line 2131 of file libbladeRF.h.
| enum bladerf_image_type |
Type of data stored in a flash image
Definition at line 2105 of file libbladeRF.h.
| API_EXPORT struct bladerf_image* CALL_CONV bladerf_alloc_cal_image | ( | bladerf_fpga_size | fpga_size, |
| uint16_t | vctcxo_trim | ||
| ) |
Create a flash image initialized to contain a calibration data region. This is intended to be used in conjunction with bladerf_image_write(), or a write of the image's data field to flash.
| fpga_size | Target FPGA size |
| vctcxo_trim | VCTCXO oscillator trim value. |
| API_EXPORT struct bladerf_image* CALL_CONV bladerf_alloc_image | ( | bladerf_image_type | type, |
| uint32_t | address, | ||
| uint32_t | length | ||
| ) |
Allocate and initialize an image structure.
This following bladerf_image fields are populated: magic, version, timestamp, type, address, and length
The following bladerf_image fields are zeroed out: checksum, serial, and reserved,
If the length parameter is not 0, the bladerf_image data field will be dynamically allocated. Otherwise, data will be set to NULL.
lenth should be use only with bladerf_image_write(); bladerf_image_read() allocates and sets data based upon size of the image contents, and does not attempt to free() the data field before setting it.The address and length fields should be set 0 when reading an image from a file.
| API_EXPORT void CALL_CONV bladerf_free_image | ( | struct bladerf_image * | image | ) |
Free a bladerf_image previously obtained via bladerf_alloc_image. If the bladerf_image's data field is non-NULL, it will be freed.
| API_EXPORT int CALL_CONV bladerf_image_read | ( | struct bladerf_image * | image, |
| const char * | file | ||
| ) |
Read flash image from a file.
| [out] | image | Flash image structure to populate. |
| [in] | file | File to read image from. |
image parameter has been obtained via a call to bladerf_alloc_image(), with a length of 0.image fields will be populated upon success, overwriting any previous values.image paramater should not be used if this function fails.| API_EXPORT int CALL_CONV bladerf_image_write | ( | struct bladerf_image * | image, |
| const char * | file | ||
| ) |
Write a flash image to a file.
This function will fill in the checksum field before writing the contents to the specified file. The user-supplied contents of this field are ignored.
image has been initialized using bladerf_alloc_image() image->checksum will be populated if this function succeeds| [in] | image | Flash image |
| [in] | file | File to write the flash image to |
1.8.6