libbladeRF  2.1.0-0.2018.10~rc1-2
Nuand bladeRF library
Functions

Description

These functions provide the ability to erase, read, and write the SPI flash.

Warning
Use of SPI flash functions requires an understanding of the underlying SPI flash device, and the bladeRF's flash memory map. Be sure to review the following page and the associated flash datasheet before using these functions: https://github.com/nuand/bladeRF/wiki/FX3-Firmware#spi-flash-layout

These functions are thread-safe.

Functions

API_EXPORT int CALL_CONV bladerf_erase_flash (struct bladerf *dev, uint32_t erase_block, uint32_t count)
 
API_EXPORT int CALL_CONV bladerf_read_flash (struct bladerf *dev, uint8_t *buf, uint32_t page, uint32_t count)
 
API_EXPORT int CALL_CONV bladerf_write_flash (struct bladerf *dev, const uint8_t *buf, uint32_t page, uint32_t count)
 

Function Documentation

◆ bladerf_erase_flash()

API_EXPORT int CALL_CONV bladerf_erase_flash ( struct bladerf *  dev,
uint32_t  erase_block,
uint32_t  count 
)

Erase regions of the bladeRF's SPI flash

Note
This function operates in units of 64 KiB erase blocks
Parameters
devDevice handle
[in]erase_blockErase block from which to start erasing
[in]countNumber of blocks to erase
Returns
0 on success, or BLADERF_ERR_INVAL on an invalid erase_block or count value, or a value from Error codes list on other failures

◆ bladerf_read_flash()

API_EXPORT int CALL_CONV bladerf_read_flash ( struct bladerf *  dev,
uint8_t *  buf,
uint32_t  page,
uint32_t  count 
)

Read data from the bladeRF's SPI flash

Note
This function operates in units of 256-byte pages.
Parameters
devDevice handle
[in]bufBuffer to read data into. Must be count * BLADERF_FLASH_PAGE_SIZE bytes or larger.
[in]pagePage to begin reading from
[in]countNumber of pages to read
Returns
0 on success, or BLADERF_ERR_INVAL on an invalid page or count value, or a value from Error codes list on other failures.

◆ bladerf_write_flash()

API_EXPORT int CALL_CONV bladerf_write_flash ( struct bladerf *  dev,
const uint8_t *  buf,
uint32_t  page,
uint32_t  count 
)

Write data to the bladeRF's SPI flash device

Note
This function operates in units of 256-byte pages.
Parameters
devDevice handle
[in]bufData to write to flash
[in]pagePage to begin writing at
[in]countNumber of pages to write
Returns
0 on success, or BLADERF_ERR_INVAL on an invalid page or count value, or a value from Error codes list on other failures.