MTD driver interface.
This define the functions to access a MTD.
A MTD is composed of pages combined into sectors. A sector is the smallest erasable unit. The number of pages in a sector must be constant for the whole MTD.
The erase operation is available only for entire sectors.
Definition at line 200 of file mtd.h.
|
| int(* | init )(mtd_dev_t *dev) |
| | Initialize Memory Technology Device (MTD)
|
| |
| int(* | read )(mtd_dev_t *dev, void *buff, uint32_t addr, uint32_t size) |
| | Read from the Memory Technology Device (MTD)
|
| |
| int(* | read_page )(mtd_dev_t *dev, void *buff, uint32_t page, uint32_t offset, uint32_t size) |
| | Read from the Memory Technology Device (MTD) using pagewise addressing.
|
| |
| int(* | write_page )(mtd_dev_t *dev, const void *buff, uint32_t page, uint32_t offset, uint32_t size) |
| | Write to the Memory Technology Device (MTD) using pagewise addressing.
|
| |
| int(* | erase )(mtd_dev_t *dev, uint32_t addr, uint32_t size) |
| | Erase sector(s) over the Memory Technology Device (MTD)
|
| |
| int(* | erase_sector )(mtd_dev_t *dev, uint32_t sector, uint32_t count) |
| | Erase sector(s) of the Memory Technology Device (MTD)
|
| |
| int(* | power )(mtd_dev_t *dev, enum mtd_power_state power) |
| | Control power of Memory Technology Device (MTD)
|
| |
| uint8_t | flags |
| | Properties of the MTD driver.
|
| |
| int(* mtd_desc::write_page) (mtd_dev_t *dev, const void *buff, uint32_t page, uint32_t offset, uint32_t size) |
Write to the Memory Technology Device (MTD) using pagewise addressing.
offset should not exceed the page size
A write may write fewer bytes than requested. A driver that maps to a memory with a page-wise write granularity writes at most up to the end of the page. The number of bytes written is returned, so that the caller can continue with the next page.
- Parameters
-
| [in] | dev | Pointer to the selected driver |
| [out] | buff | Pointer to the data to be written |
| [in] | page | Page number to start writing to |
| [in] | offset | Byte offset from the start of the page |
| [in] | size | Number of bytes |
- Return values
-
| n | bytes written on success |
| <0 | value on error |
Definition at line 270 of file mtd.h.