OpenOCD
flash/common.h File Reference
Include dependency graph for flash/common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ERROR_FLASH_BANK_INVALID   (-900)
 
#define ERROR_FLASH_BANK_NOT_PROBED   (-907)
 
#define ERROR_FLASH_BUSY   (-905)
 
#define ERROR_FLASH_DST_BREAKS_ALIGNMENT   (-904)
 
#define ERROR_FLASH_DST_OUT_OF_BANK   (-903)
 
#define ERROR_FLASH_OPER_UNSUPPORTED   (-908)
 
#define ERROR_FLASH_OPERATION_FAILED   (-902)
 
#define ERROR_FLASH_PROTECTED   (-909)
 
#define ERROR_FLASH_SECTOR_INVALID   (-901)
 
#define ERROR_FLASH_SECTOR_NOT_ERASED   (-906)
 

Functions

bool flash_driver_name_matches (const char *name, const char *expected)
 Attempt to match the expected name with the name of a driver. More...
 
unsigned int get_flash_name_index (const char *name)
 Parses the optional '.index' portion of a flash bank identifier. More...
 

Macro Definition Documentation

◆ ERROR_FLASH_BANK_INVALID

#define ERROR_FLASH_BANK_INVALID   (-900)

Definition at line 28 of file flash/common.h.

◆ ERROR_FLASH_BANK_NOT_PROBED

#define ERROR_FLASH_BANK_NOT_PROBED   (-907)

Definition at line 35 of file flash/common.h.

◆ ERROR_FLASH_BUSY

#define ERROR_FLASH_BUSY   (-905)

Definition at line 33 of file flash/common.h.

◆ ERROR_FLASH_DST_BREAKS_ALIGNMENT

#define ERROR_FLASH_DST_BREAKS_ALIGNMENT   (-904)

Definition at line 32 of file flash/common.h.

◆ ERROR_FLASH_DST_OUT_OF_BANK

#define ERROR_FLASH_DST_OUT_OF_BANK   (-903)

Definition at line 31 of file flash/common.h.

◆ ERROR_FLASH_OPER_UNSUPPORTED

#define ERROR_FLASH_OPER_UNSUPPORTED   (-908)

Definition at line 36 of file flash/common.h.

◆ ERROR_FLASH_OPERATION_FAILED

#define ERROR_FLASH_OPERATION_FAILED   (-902)

Definition at line 30 of file flash/common.h.

◆ ERROR_FLASH_PROTECTED

#define ERROR_FLASH_PROTECTED   (-909)

Definition at line 37 of file flash/common.h.

◆ ERROR_FLASH_SECTOR_INVALID

#define ERROR_FLASH_SECTOR_INVALID   (-901)

Definition at line 29 of file flash/common.h.

◆ ERROR_FLASH_SECTOR_NOT_ERASED

#define ERROR_FLASH_SECTOR_NOT_ERASED   (-906)

Definition at line 34 of file flash/common.h.

Function Documentation

◆ flash_driver_name_matches()

bool flash_driver_name_matches ( const char *  name,
const char *  expected 
)

Attempt to match the expected name with the name of a driver.

Parameters
nameThe name of the driver (from the bank's device structure).
expectedThe expected driver name, passed by the user.

Definition at line 27 of file common.c.

References name.

Referenced by get_flash_bank_by_name_noprobe(), and get_nand_device_by_name().

◆ get_flash_name_index()

unsigned int get_flash_name_index ( const char *  name)

Parses the optional '.index' portion of a flash bank identifier.

Parameters
nameThe desired driver name, passed by the user.
Returns
The parsed index request, or 0 if not present. If the name provides a suffix but it does not parse as an unsigned integer, the routine returns ~0U. This will prevent further matching.

Definition at line 14 of file common.c.

References ERROR_OK, and name.

Referenced by get_flash_bank_by_name_noprobe(), and get_nand_device_by_name().