![]() |
RTEMS 6.3
|
Flash device. More...
#include <flashdev.h>
Data Fields | |
| int(*) | read (rtems_flashdev *flash, uintptr_t offset, size_t count, void *buffer) |
| Call to the device driver to read the flash device. | |
| int(*) | write (rtems_flashdev *flash, uintptr_t offset, size_t count, const void *buffer) |
| Call to the device driver to write to the flash device. | |
| int(*) | erase (rtems_flashdev *flash, uintptr_t offset, size_t count) |
| Call to the device driver to erase the flash device. | |
| uint32_t(*) | jedec_id (rtems_flashdev *flash) |
| Call to the device driver to return the JEDEC ID. | |
| int(*) | flash_type (rtems_flashdev *flash, rtems_flashdev_flash_type *type) |
| Call to the device driver to return the flash type. | |
| int(*) | page_info_by_offset (rtems_flashdev *flash, off_t search_offset, off_t *page_offset, size_t *page_size) |
| Call to device driver to get size and offset of page at given offset. | |
| int(*) | page_info_by_index (rtems_flashdev *flashdev, off_t search_index, off_t *page_offset, size_t *page_size) |
| Call to device driver to get size and offset of page at given index. | |
| int(*) | page_count (rtems_flashdev *flashdev, int *page_count) |
| Call to device driver to return the number of pages on the flash device. | |
| int(*) | write_block_size (rtems_flashdev *flashdev, size_t *write_block_size) |
| Call to device driver to return the minimum write size of the flash device. | |
| int(*) | sector_info_by_offset (rtems_flashdev *flash, off_t search_offset, off_t *sector_offset, size_t *sector_size) |
| Call to device driver to get size and offset of sector at given offset. | |
| int(*) | sector_count (rtems_flashdev *flashdev, int *page_count) |
| Call to device driver to return the number of sectors on the flash device. | |
| int(*) | oob_bytes_per_page (rtems_flashdev *flashdev, size_t *oob_bytes_per_page) |
| Call to device driver to return the size of the out of band space. | |
| int(*) | oob_read (rtems_flashdev *flash, uintptr_t offset, size_t count, void *buffer) |
| Call to the device driver to read the out of band space of the flash device. | |
| int(*) | oob_write (rtems_flashdev *flash, uintptr_t offset, size_t count, const void *buffer) |
| Call to the device driver to write to the out of band space of the flash device. | |
| int(*) | sector_mark_bad (rtems_flashdev *flash, off_t offset) |
| Call to the device driver to mark a sector as being bad. | |
| int(*) | sector_health (rtems_flashdev *flash, off_t search_offset, uint8_t *sector_bad) |
| Call to device driver to get health of sector at given offset. | |
| void(*) | destroy (rtems_flashdev *flashdev) |
| Destroys the flash device. | |
| void(*) | priv_destroy (rtems_flashdev *flashdev) |
| Callback to destroy private data not owned directly by the flashdev framework. | |
| void * | driver |
| Pointer to device driver. | |
| rtems_recursive_mutex | mutex |
| Mutex to protect the flash device access. | |
| rtems_flashdev_region_table * | region_table |
| Region table defining size and memory for region allocations. | |
Flash device.
| void(*) rtems_flashdev::destroy(rtems_flashdev *flashdev) |
Destroys the flash device.
| [in] | flash | Pointer to flash device. |
| int(*) rtems_flashdev::erase(rtems_flashdev *flash, uintptr_t offset, size_t count) |
Call to the device driver to erase the flash device.
| [in] | flash | Pointer to flash device. |
| [in] | offset | Address to erase at. |
| [in] | count | Number of bytes to erase. |
| 0 | Successful operation. |
| 1 | Failed operation. |
| int(*) rtems_flashdev::flash_type(rtems_flashdev *flash, rtems_flashdev_flash_type *type) |
Call to the device driver to return the flash type.
| [in] | flash | The flash device. |
| [out] | type | The type of flash device. |
| 0 | Success @retbal Other Failure |
| uint32_t(*) rtems_flashdev::jedec_id(rtems_flashdev *flash) |
Call to the device driver to return the JEDEC ID.
| [in] | flash | The flash device. |
| JEDEC | ID. |
| int(*) rtems_flashdev::oob_bytes_per_page(rtems_flashdev *flashdev, size_t *oob_bytes_per_page) |
Call to device driver to return the size of the out of band space.
| [in] | flashdev | Pointer to flash device. |
| [out] | oob_bytes_per_page | The number of bytes of OOB space per page. |
| 0 | Success. |
| non-zero | Failed. |
| int(*) rtems_flashdev::oob_read(rtems_flashdev *flash, uintptr_t offset, size_t count, void *buffer) |
Call to the device driver to read the out of band space of the flash device.
The offset specified is relative to a contiguous out of band space, not to normal data space.
| [in] | flash | Pointer to flash device. |
| [in] | offset | Address to read from. |
| [in] | count | Number of bytes to read. |
| [out] | buffer | Buffer for data to be read into. |
| 0 | Successful operation. |
| 1 | Failed operation. |
| int(*) rtems_flashdev::oob_write(rtems_flashdev *flash, uintptr_t offset, size_t count, const void *buffer) |
Call to the device driver to write to the out of band space of the flash device.
The offset specified is relative to a contiguous out of band space, not to normal data space.
| [in] | flash | Pointer to flash device. |
| [in] | offset | Address to write to. |
| [in] | count | Number of bytes to read. |
| [in] | buffer | Buffer for data to be written from. |
| 0 | Successful operation. |
| 1 | Failed operation. |
| int(*) rtems_flashdev::page_count(rtems_flashdev *flashdev, int *page_count) |
Call to device driver to return the number of pages on the flash device.
| [out] | page_count | The number of pages on the flash device. |
| 0 | Success. |
| non-zero | Failed. |
| int(*) rtems_flashdev::page_info_by_index(rtems_flashdev *flashdev, off_t search_index, off_t *page_offset, size_t *page_size) |
Call to device driver to get size and offset of page at given index.
| [in] | flash | The flash device |
| [in] | search_index | The index of the page which info is to be returned. |
| [out] | page_offset | The offset of the start of the page |
| [out] | page_size | The size of the page |
| 0 | Success. |
| non-zero | Failed. |
| int(*) rtems_flashdev::page_info_by_offset(rtems_flashdev *flash, off_t search_offset, off_t *page_offset, size_t *page_size) |
Call to device driver to get size and offset of page at given offset.
| [in] | flash | The flash device |
| [in] | search_offset | The offset of the page which info is to be returned. |
| [out] | page_offset | The offset of the start of the page |
| [out] | page_size | The size of the page |
| 0 | Success. |
| non-zero | Failed. |
| void(*) rtems_flashdev::priv_destroy(rtems_flashdev *flashdev) |
Callback to destroy private data not owned directly by the flashdev framework.
| [in] | flash | Pointer to flash device. |
| int(*) rtems_flashdev::read(rtems_flashdev *flash, uintptr_t offset, size_t count, void *buffer) |
Call to the device driver to read the flash device.
| [in] | flash | Pointer to flash device. |
| [in] | offset | Address to read from. |
| [in] | count | Number of bytes to read. |
| [out] | buffer | Buffer for data to be read into. |
| 0 | Successful operation. |
| 1 | Failed operation. |
| int(*) rtems_flashdev::sector_count(rtems_flashdev *flashdev, int *page_count) |
Call to device driver to return the number of sectors on the flash device.
| [out] | sector_count | The number of sector on the flash device. |
| 0 | Success. |
| non-zero | Failed. |
| int(*) rtems_flashdev::sector_health(rtems_flashdev *flash, off_t search_offset, uint8_t *sector_bad) |
Call to device driver to get health of sector at given offset.
| [in] | flash | The flash device |
| [in] | search_offset | The offset of the sector which info is to be returned. |
| [out] | sector_bad | The disposition of the sector, non-zero being bad |
| 0 | Success. |
| non-zero | Failed. |
| int(*) rtems_flashdev::sector_info_by_offset(rtems_flashdev *flash, off_t search_offset, off_t *sector_offset, size_t *sector_size) |
Call to device driver to get size and offset of sector at given offset.
| [in] | flash | The flash device |
| [in] | search_offset | The offset of the sector which info is to be returned. |
| [out] | sector_offset | The offset of the start of the page |
| [out] | sector_size | The size of the page |
| 0 | Success. |
| non-zero | Failed. |
| int(*) rtems_flashdev::sector_mark_bad(rtems_flashdev *flash, off_t offset) |
Call to the device driver to mark a sector as being bad.
Sectors are referred to as blocks in NAND devices. Not all devices have bad sector management.
| [in] | flash | Pointer to flash device. |
| [in] | offset | Address of the beginning of the sector. |
| 0 | Successful operation. |
| 1 | Failed operation. |
| int(*) rtems_flashdev::write(rtems_flashdev *flash, uintptr_t offset, size_t count, const void *buffer) |
Call to the device driver to write to the flash device.
| [in] | flash | Pointer to flash device. |
| [in] | offset | Address to write to. |
| [in] | count | Number of bytes to read. |
| [in] | buffer | Buffer for data to be written from. |
| 0 | Successful operation. |
| 1 | Failed operation. |
| int(*) rtems_flashdev::write_block_size(rtems_flashdev *flashdev, size_t *write_block_size) |
Call to device driver to return the minimum write size of the flash device.
| [out] | write_block_size | The minimum write size of the flash device. |
| 0 | Success. |
| non-zero | Failed. |