summaryrefslogtreecommitdiff
path: root/src/flash/nand.h
diff options
context:
space:
mode:
authorZachary T Welch <zw@superlucidity.net>2009-10-23 01:13:19 -0700
committerZachary T Welch <zw@superlucidity.net>2009-11-05 18:03:20 -0800
commit11e545f56091e4fa808bd57a215d6b8066b39295 (patch)
treec60d0c44f7260cafb13422bf6147c73b4a718998 /src/flash/nand.h
parent4189fdad28c283602b80ff7bc5a43bd5963019e7 (diff)
downloadopenocd_libswd-11e545f56091e4fa808bd57a215d6b8066b39295.tar.gz
openocd_libswd-11e545f56091e4fa808bd57a215d6b8066b39295.tar.bz2
openocd_libswd-11e545f56091e4fa808bd57a215d6b8066b39295.tar.xz
openocd_libswd-11e545f56091e4fa808bd57a215d6b8066b39295.zip
Add Flash/NAND bank command argument helpers.
This eliminates redundant code for parsing and retreiving the bank specified from a script command argument. This patch was written to replace existing functionality; however, the parsing logic can be updated later to allow flash commands to accept bank names as well as their numbers.
Diffstat (limited to 'src/flash/nand.h')
-rw-r--r--src/flash/nand.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/flash/nand.h b/src/flash/nand.h
index b73e3304..d8674943 100644
--- a/src/flash/nand.h
+++ b/src/flash/nand.h
@@ -217,6 +217,11 @@ extern int nand_calculate_ecc_kw(struct nand_device_s *device, const uint8_t *da
extern int nand_register_commands(struct command_context_s *cmd_ctx);
extern int nand_init(struct command_context_s *cmd_ctx);
+/// helper for parsing a nand device command argument string
+int nand_command_get_device_by_num(struct command_context_s *cmd_ctx,
+ char *str, nand_device_t **device);
+
+
#define ERROR_NAND_DEVICE_INVALID (-1100)
#define ERROR_NAND_OPERATION_FAILED (-1101)
#define ERROR_NAND_OPERATION_TIMEOUT (-1102)