flash.h File Reference
#include "pico.h"
Include dependency graph for flash.h:

Go to the source code of this file.

Macros

#define PARAM_ASSERTIONS_ENABLED_FLASH   0
 
#define FLASH_PAGE_SIZE   (1u << 8)
 
#define FLASH_SECTOR_SIZE   (1u << 12)
 
#define FLASH_BLOCK_SIZE   (1u << 16)
 
#define FLASH_UNIQUE_ID_SIZE_BYTES   8
 

Functions

void flash_range_erase (uint32_t flash_offs, size_t count)
 Erase areas of flash. More...
 
void flash_range_program (uint32_t flash_offs, const uint8_t *data, size_t count)
 Program flash. More...
 
void flash_get_unique_id (uint8_t *id_out)
 Get flash unique 64 bit identifierUse a standard 4Bh RUID instruction to retrieve the 64 bit unique identifier from a flash device attached to the QSPI interface. Since there is a 1:1 association between the MCU and this flash, this also serves as a unique identifier for the board. More...
 
void flash_do_cmd (const uint8_t *txbuf, uint8_t *rxbuf, size_t count)
 Execute bidirectional flash commandLow-level function to execute a serial command on a flash device attached to the QSPI interface. Bytes are simultaneously transmitted and received from txbuf and to rxbuf. Therefore, both buffers must be the same length, count, which is the length of the overall transaction. This is useful for reading metadata from the flash chip, such as device ID or SFDP parameters. More...