Nios® V Processor Software Developer Handbook

ID 743810
Date 7/20/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

13.1.1.31. alt_flash_open_dev()

Prototype

alt_flash_fd* alt_flash_open_dev(const char* name)

Commonly Called By

C/C++ programs

Device drivers

Thread-safe

No.

Available from ISR

No.

Include

<sys/alt_flash.h>

Description

The alt_flash_open_dev() function opens a flash device. After it is opened, you can perform the following operations:
  • Write to a flash device using alt_write_flash()
  • Read from a flash device using alt_read_flash()
  • Control individual flash blocks using alt_get_flash_info(), alt_erase_flash_block(), or alt_write_flash_block().

    Call the alt_flash_open_dev function only when operating in single-threaded mode.

Return

The return value is zero upon failure. Any other value indicates success.