Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: add support for MTDs emulated in RAM #19443

Merged
merged 10 commits into from
Apr 12, 2023
Next Next commit
drivers/mtd: small fixes in doc
  • Loading branch information
gschorcht committed Apr 11, 2023
commit 756197316ddf5fd1665875c70ac659e06bb441e1
16 changes: 8 additions & 8 deletions drivers/include/mtd.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* * A **sector** is the device's erase unit. Calls to @ref mtd_erase need to
* work in alignment with this number (commonly somewhere around 1kiB).
*
* (Note that this corresponse to the term "page" as used in the flashpage
* (Note that this corresponds to the term "page" as used in the flashpage
* API, and the term "eraseblock" in Linux's MTD).
*
* * A **page** is the largest a device can write in one transfer.
Expand Down Expand Up @@ -108,7 +108,7 @@ typedef struct mtd_desc mtd_desc_t;
typedef struct {
const mtd_desc_t *driver; /**< MTD driver */
uint32_t sector_count; /**< Number of sector in the MTD */
uint32_t pages_per_sector; /**< Number of pages by sector in the MTD */
uint32_t pages_per_sector; /**< Number of pages per sector in the MTD */
uint32_t page_size; /**< Size of the pages in the MTD */
uint32_t write_size; /**< Minimum size and alignment of writes to the device */
#if defined(MODULE_MTD_WRITE_PAGE) || DOXYGEN
Expand Down Expand Up @@ -324,8 +324,8 @@ int mtd_read(mtd_dev_t *mtd, void *dest, uint32_t addr, uint32_t count);
* @param[in] offset offset from the start of the page (in bytes)
* @param[in] size the number of bytes to read
*
* @return 0 on success
* @return < 0 if an error occurred
* @return number of bytes read on success
* @return < 0 value on error
* @return -ENODEV if @p mtd is not a valid device
* @return -ENOTSUP if operation is not supported on @p mtd
* @return -EOVERFLOW if @p addr or @p count are not valid, i.e. outside memory
Expand Down Expand Up @@ -373,8 +373,8 @@ int mtd_write(mtd_dev_t *mtd, const void *src, uint32_t addr, uint32_t count);
* @param[in] offset byte offset from the start of the page
* @param[in] size the number of bytes to write
*
* @return 0 on success
* @return < 0 if an error occurred
* @return number of bytes written on success
* @return < 0 value on error
* @return -ENODEV if @p mtd is not a valid device
* @return -ENOTSUP if operation is not supported on @p mtd
* @return -EOVERFLOW if @p addr or @p count are not valid, i.e. outside memory,
Expand Down Expand Up @@ -403,8 +403,8 @@ int mtd_write_page_raw(mtd_dev_t *mtd, const void *src, uint32_t page,
* @param[in] offset byte offset from the start of the page
* @param[in] size the number of bytes to write
*
* @return 0 on success
* @return < 0 if an error occurred
* @return number of bytes written on success
* @return < 0 value on error
* @return -ENODEV if @p mtd is not a valid device
* @return -ENOTSUP if operation is not supported on @p mtd
* @return -EOVERFLOW if @p addr or @p count are not valid, i.e. outside memory,
Expand Down