Nios II Classic Software Developer’s Handbook

ID 683282
Date 5/14/2015
Public
Document Table of Contents

14.1.32. alt_get_flash_info()

Prototype

int alt_get_flash_info(alt_flash_fd* fd, 


flash_region** info,

int* number_of_regions)

Commonly Called By

C/C++ programs

Device drivers

Thread-safe

No.

Available from ISR

No.

Include

<sys/alt_flash.h>

Description

The alt_get_flash_info() function gets the details of the erase region of a flash part. The flash part is specified by the descriptor fd, a pointer to the start of the flash_region structures is returned in the info parameter, and the number of flash regions are returned in number of regions.

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 upon success. A negative return value indicates failure.