X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fflash%2Fflash.h;h=05c4b2c48f70b81c2b4d862e0b3982c348131dd8;hb=2689f58f2a0afa296a29ab301a4c1665b914caab;hp=a41586f78f55f60c0720f0d3615fb122d81c769c;hpb=2e779198535580515dfa9c8bfe1f3fe08abdb84b;p=openocd diff --git a/src/flash/flash.h b/src/flash/flash.h index a41586f7..05c4b2c4 100644 --- a/src/flash/flash.h +++ b/src/flash/flash.h @@ -2,7 +2,7 @@ * Copyright (C) 2005 by Dominic Rath * * Dominic.Rath@gmx.de * * * - * Copyright (C) 2007,2008 Øyvind Harboe * + * Copyright (C) 2007,2008 Øyvind Harboe * * oyvind.harboe@zylin.com * * * * Copyright (C) 2008 by Spencer Oliver * @@ -76,7 +76,7 @@ struct flash_bank_s; * that matches @c DRIVERNAME. * * The flash subsystem calls some of the other drivers routines a using - * corresponding static flash_driver_ < i>callback () + * corresponding static flash_driver_callback() * routine in flash.c. */ typedef struct flash_driver_s @@ -313,6 +313,16 @@ extern int default_flash_mem_blank_check(struct flash_bank_s *bank); * @returns A flash_bank_t for flash bank @a num, or NULL */ extern flash_bank_t *get_flash_bank_by_num(int num); +/** + * Retreives @a bank from a command argument, reporting errors parsing + * the bank identifier or retreiving the specified bank. + * @param cmd_ctx The command context for reporting errors. + * @param str The string containing the bank identifier. + * @param bank On output, contians a pointer to the bank or NULL. + * @returns ERROR_OK on success, or an error indicating the problem. + */ +int flash_command_get_bank_by_num( + struct command_context_s *cmd_ctx, char *str, flash_bank_t **bank); /** * Returns the flash bank like get_flash_bank_by_num(), without probing. * @param num The flash bank number.