RTEMS 6.1-rc5
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Enumerations | Functions
flashdev.h File Reference

Generic Flash API. More...

#include <rtems/thread.h>
#include <sys/types.h>

Go to the source code of this file.

Data Structures

struct  rtems_flashdev_region
 General definition for on flash device. More...
 
struct  rtems_flashdev_region_table
 Struct holding region definitions. More...
 
struct  rtems_flashdev_ioctl_page_info
 Page information returned from IOCTL calls. More...
 
struct  rtems_flashdev_ioctl_sector_info
 Sector information returned from IOCTL calls. More...
 
struct  rtems_flashdev
 Flash device. More...
 

Macros

#define RTEMS_FLASHDEV_IOCTL_OBTAIN   0
 Obtains the flash device.
 
#define RTEMS_FLASHDEV_IOCTL_RELEASE   1
 Releases the flash device.
 
#define RTEMS_FLASHDEV_IOCTL_JEDEC_ID   2
 Returns the JEDEC ID of the flash device. This IOCTL call is informational only.
 
#define RTEMS_FLASHDEV_IOCTL_ERASE   3
 Erases flash device.
 
#define RTEMS_FLASHDEV_IOCTL_REGION_SET   4
 Set a region that limits read, write and erase calls to within it. Regions are file descriptor specific and limited to a single region per file descriptor and 32 regions total per flash device. Regions can be changed or updated by calling this IOCTL again.
 
#define RTEMS_FLASHDEV_IOCTL_REGION_UNSET   5
 Removes the set region on the file descriptor.
 
#define RTEMS_FLASHDEV_IOCTL_TYPE   6
 Returns the type of flash device (e.g. NOR or NAND).
 
#define RTEMS_FLASHDEV_IOCTL_PAGEINFO_BY_OFFSET   7
 Get the size and address of flash page at given offset.
 
#define RTEMS_FLASHDEV_IOCTL_PAGEINFO_BY_INDEX   8
 Get the size and address of nth flash page where n is index passed in.
 
#define RTEMS_FLASHDEV_IOCTL_PAGE_COUNT   9
 Get the number of pages in flash device.
 
#define RTEMS_FLASHDEV_IOCTL_WRITE_BLOCK_SIZE   10
 Get the minimum write size supported by the driver.
 
#define RTEMS_FLASHDEV_IOCTL_SECTORINFO_BY_OFFSET   11
 Get the size and address of flash erase sector at given offset.
 
#define RTEMS_FLASHDEV_IOCTL_SECTOR_COUNT   12
 Get the number of erase sectors in flash device.
 
#define RTEMS_FLASHDEV_MAX_REGIONS   32
 The maximum number of region limited file descriptors allowed to be open at once.
 

Typedefs

typedef struct rtems_flashdev rtems_flashdev
 
typedef enum rtems_flashdev_flash_type rtems_flashdev_flash_type
 Enum for flash type returned from IOCTL call.
 
typedef struct rtems_flashdev_region rtems_flashdev_region
 General definition for on flash device.
 
typedef struct rtems_flashdev_region_table rtems_flashdev_region_table
 Struct holding region definitions.
 
typedef struct rtems_flashdev_ioctl_page_info rtems_flashdev_ioctl_page_info
 Page information returned from IOCTL calls.
 
typedef struct rtems_flashdev_ioctl_sector_info rtems_flashdev_ioctl_sector_info
 Sector information returned from IOCTL calls.
 

Enumerations

enum  rtems_flashdev_flash_type { RTEMS_FLASHDEV_NOR , RTEMS_FLASHDEV_NAND }
 Enum for flash type returned from IOCTL call. More...
 

Functions

rtems_flashdevrtems_flashdev_alloc_and_init (size_t size)
 Allocate and initialize the flash device.
 
int rtems_flashdev_init (rtems_flashdev *flash)
 Initialize the flash device.
 
int rtems_flashdev_register (rtems_flashdev *flash, const char *flash_path)
 Register the flash device.
 
void rtems_flashdev_destroy (rtems_flashdev *flash)
 Destroys the flash device.
 
void rtems_flashdev_destroy_and_free (rtems_flashdev *flash)
 Destroys the flash device and frees its memory.
 

Detailed Description

Generic Flash API.