Skip to content

Commit 1d1b354

Browse files
committed
sys/shell/cmds: add mtd.doc.md
1 parent 60e53ad commit 1d1b354

File tree

2 files changed

+75
-1
lines changed

2 files changed

+75
-1
lines changed

sys/shell/cmds/mtd.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,8 @@ static int _cmd_mtd(int argc, char **argv)
427427
" read_page: Read a region of memory on the MTD (pagewise addressing)\n"
428428
" write: Write a region of memory on the MTD\n"
429429
" write_page_raw: Write a region of memory on the MTD (pagewise addressing)\n"
430-
" write_page: Write a region of memory on the MTD (pagewise addressing, read-modify-write)\n"
430+
" write_page: Write a region of memory on the MTD\n"
431+
" (pagewise addressing, read-modify-write)\n"
431432
" erase: Erase a region of memory on the MTD\n"
432433
" erase_sector: Erase a sector of memory on the MTD\n"
433434
" info: Print properties of the MTD device\n"

sys/shell/cmds/mtd.doc.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
@defgroup sys_shell_commands_mtd MTD shell command
2+
@ingroup sys_shell_commands
3+
@brief MTD shell command for low level storage device access
4+
5+
Available MTD Subcommands
6+
==========================
7+
8+
There are different subcommands available to read and write data to and from an MTD,
9+
as well as additional subcommands for example to print information or to control
10+
power states.
11+
12+
Subcommand: read \<addr\> \<len\>
13+
-----------------------------
14+
15+
The subcommand takes a memory address and a length in bytes of how many bytes to read.
16+
@see mtd_read
17+
18+
Subcommand: read_page \<page\> \<offset\> \<len\>
19+
-------------------------------------------
20+
21+
The subcommand takes a page number, an offset within that page and a length in bytes
22+
of how many bytes to read.
23+
@see mtd_read_page
24+
25+
Subcommand: write [-b] \<addr\> \<data\>
26+
------------------------------------
27+
28+
The subcommand takes a memory address and data to write.
29+
If the optional parameter `-b` is used, it is expected that the provided data only
30+
consists of hexadecimal digits, else it is expected that the data is a string.
31+
@see mtd_write
32+
33+
Subcommand: write_page_raw [-b] \<page\> \<offset\> \<data\>
34+
------------------------------------------------------
35+
36+
The subcommand takes a page number, a byte offset within the page and data to write.
37+
If the optional parameter `-b` is used, it is expected that the provided data only
38+
consists of hexadecimal digits, else it is expected that the data is a string.
39+
@see mtd_write_page_raw
40+
41+
Subcommand: write_page [-b] \<page\> \<offset\> \<data\>
42+
--------------------------------------------------
43+
44+
The subcommand takes a page number, a byte offset within the page and data to write.
45+
If the optional parameter `-b` is used, it is expected that the provided data only
46+
consists of hexadecimal digits, else it is expected that the data is a string.
47+
The command only can be used when the module `mtd_write_page` is used.
48+
@see mtd_write_page
49+
50+
Subcommand: erase \<addr\> \<len\>
51+
------------------------------
52+
53+
The subcommand takes a memory address and a length in bytes of how many bytes to erase.
54+
@see mtd_erase
55+
56+
Subcommand: erase \<sector\> [count]
57+
----------------------------------
58+
59+
The subcommand takes a sector number and additionally a number of bytes to erase from this sector.
60+
@see mtd_erase_sector
61+
62+
Subcommand: info
63+
----------------
64+
65+
The subcommand takes no additional arguments.
66+
Information about storage size is printed.
67+
68+
69+
Subcommand: power \<on|off\>
70+
--------------------------
71+
72+
The subcommand takes one parameter to power the MTD on or off, if it is implemented by the MTD driver.
73+
@see mtd_power

0 commit comments

Comments
 (0)