group::DRIVE

This is the interface for accessing drives.

The drive is usually one of two types:

  • Serial Flash (mostly use command flash interface)
  • SD/MMC Flash memory

Terminology

  • Page: the size of a writeable chunk of memory
  • Sector: the size of an eraseable chunk of memory (commonly 4KB on serial NAND devices)

Multiple pages typically make up a sector. Pages are aligned to sector boundaries.

Details

defineDRIVE_VERSION


defineDRIVE_IOC_IDENT_CHAR


defineI_DRIVE_GETVERSION

Gets the driver version.


defineI_DRIVE_GETINFO

Gets the drive info (drive_info_t).


defineI_DRIVE_SETATTR

Sets the drive attributes (See also: drive_attr_t).


defineI_DRIVE_SETACTION


defineI_DRIVE_ISBUSY

See if the drive is busy. This ioctl call will return greater than one if the device is busy and 0 if drive is not busy.


defineI_DRIVE_TOTAL


enum@10

  • DRIVE_FLAG_PROTECT Enables driver write protection.
  • DRIVE_FLAG_UNPROTECT Disables driver write protection.
  • DRIVE_FLAG_ERASE_BLOCKS Erases blocks on the disk. A block consists of the smallest eraseable memory size (See also: driver_info_t and erase_block_size). The return value is the amount of memory actually erased. Some devices can only erase only block at a Time.
  • DRIVE_FLAG_ERASE_SECTORS
  • DRIVE_FLAG_ERASE_DEVICE Erases the drive.
  • DRIVE_FLAG_POWERDOWN Puts the drive in power down mode.
  • DRIVE_FLAG_POWERUP Powers up the driver (after power down).
  • DRIVE_FLAG_INIT Initializes the drive.
  • DRIVE_FLAG_RESET Issue a reset to the drive.


date: “2019-06-27” layout: post title: struct::drive_info_t katex: true

categories: struct

This is the data structure for accessing information about the device.

Methods

Details

public u32o_flags

Attribute flags supported by this driver


public u32o_events

MCU Event flags supported by this driver


public u16address_size

Number of bytes per address location (typically 1 for small devices 512 for larger ones)


public u16write_block_size

Minimum write block size


public u32num_write_blocks

Number of write blocks (size is num_write_blocks*write_block_size)


public u32erase_block_size

Minimum eraseable block size


public u32erase_block_time

Time in microseconds to erase one block


public u32erase_device_time

Time in microseconds to erase the device


public u32bitrate

Max bitrate


public u32resd



date: “2019-06-27” layout: post title: struct::drive_attr_t katex: true

categories: struct

This is the data structure used with setting drive attributes.

Methods

Details

public u32o_flags

Drive flags such as DRIVE_FLAG_INIT


public u32start

Start block (used with DRIVE_FLAG_ERASE_BLOCKS). This should be the address divided by drive_info_t->address_size.


public u32end

End block (used with DRIVE_FLAG_ERASE_BLOCKS). This should be the address divided by drive_info_t->address_size.


public u32resd


X

Thanks for Coming!

Subscribe to news and updates