Nios® II Software Developer Handbook

ID 683525
Date 8/28/2023
Public
Document Table of Contents

15.1.51. alt_read_flash()

Prototype

int alt_read_flash(alt_flash_fd* fd,

int offset,

void* dest_addr,

int length)

Commonly Called By

C/C++ programs

Device drivers

Thread-safe

No.

Available from ISR

No.

Include

<sys/alt_flash.h>

Description

The alt_read_flash() function reads data from flash. length bytes are read from the flash fd, starting offset bytes from the beginning of the flash and are written to the location dest_addr.

Call this function only when operating in single-threaded mode.

The only valid values for the fd parameter are those returned from the alt_flash_open_dev function. If any other value is passed, the behavior of this function is undefined.

Return

The return value is zero on success and nonzero otherwise.