RTEMS 6.3
Loading...
Searching...
No Matches
rtems_flashdev Struct Reference

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.

Detailed Description

Flash device.

Field Documentation

◆ destroy

void(*) rtems_flashdev::destroy(rtems_flashdev *flashdev)

Destroys the flash device.

Parameters
[in]flashPointer to flash device.

◆ erase

int(*) rtems_flashdev::erase(rtems_flashdev *flash, uintptr_t offset, size_t count)

Call to the device driver to erase the flash device.

Parameters
[in]flashPointer to flash device.
[in]offsetAddress to erase at.
[in]countNumber of bytes to erase.
Return values
0Successful operation.
1Failed operation.

◆ flash_type

int(*) rtems_flashdev::flash_type(rtems_flashdev *flash, rtems_flashdev_flash_type *type)

Call to the device driver to return the flash type.

Parameters
[in]flashThe flash device.
[out]typeThe type of flash device.
Return values
0Success @retbal Other Failure

◆ jedec_id

uint32_t(*) rtems_flashdev::jedec_id(rtems_flashdev *flash)

Call to the device driver to return the JEDEC ID.

Parameters
[in]flashThe flash device.
Return values
JEDECID.

◆ oob_bytes_per_page

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.

Parameters
[in]flashdevPointer to flash device.
[out]oob_bytes_per_pageThe number of bytes of OOB space per page.
Return values
0Success.
non-zeroFailed.

◆ oob_read

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.

Parameters
[in]flashPointer to flash device.
[in]offsetAddress to read from.
[in]countNumber of bytes to read.
[out]bufferBuffer for data to be read into.
Return values
0Successful operation.
1Failed operation.

◆ oob_write

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.

Parameters
[in]flashPointer to flash device.
[in]offsetAddress to write to.
[in]countNumber of bytes to read.
[in]bufferBuffer for data to be written from.
Return values
0Successful operation.
1Failed operation.

◆ page_count

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.

Parameters
[out]page_countThe number of pages on the flash device.
Return values
0Success.
non-zeroFailed.

◆ page_info_by_index

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.

Parameters
[in]flashThe flash device
[in]search_indexThe index of the page which info is to be returned.
[out]page_offsetThe offset of the start of the page
[out]page_sizeThe size of the page
Return values
0Success.
non-zeroFailed.

◆ page_info_by_offset

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.

Parameters
[in]flashThe flash device
[in]search_offsetThe offset of the page which info is to be returned.
[out]page_offsetThe offset of the start of the page
[out]page_sizeThe size of the page
Return values
0Success.
non-zeroFailed.

◆ priv_destroy

void(*) rtems_flashdev::priv_destroy(rtems_flashdev *flashdev)

Callback to destroy private data not owned directly by the flashdev framework.

Parameters
[in]flashPointer to flash device.

◆ read

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.

Parameters
[in]flashPointer to flash device.
[in]offsetAddress to read from.
[in]countNumber of bytes to read.
[out]bufferBuffer for data to be read into.
Return values
0Successful operation.
1Failed operation.

◆ sector_count

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.

Parameters
[out]sector_countThe number of sector on the flash device.
Return values
0Success.
non-zeroFailed.

◆ sector_health

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.

Parameters
[in]flashThe flash device
[in]search_offsetThe offset of the sector which info is to be returned.
[out]sector_badThe disposition of the sector, non-zero being bad
Return values
0Success.
non-zeroFailed.

◆ sector_info_by_offset

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.

Parameters
[in]flashThe flash device
[in]search_offsetThe offset of the sector which info is to be returned.
[out]sector_offsetThe offset of the start of the page
[out]sector_sizeThe size of the page
Return values
0Success.
non-zeroFailed.

◆ sector_mark_bad

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.

Parameters
[in]flashPointer to flash device.
[in]offsetAddress of the beginning of the sector.
Return values
0Successful operation.
1Failed operation.

◆ write

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.

Parameters
[in]flashPointer to flash device.
[in]offsetAddress to write to.
[in]countNumber of bytes to read.
[in]bufferBuffer for data to be written from.
Return values
0Successful operation.
1Failed operation.

◆ write_block_size

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.

Parameters
[out]write_block_sizeThe minimum write size of the flash device.
Return values
0Success.
non-zeroFailed.

The documentation for this struct was generated from the following file: