dcmi_get_device_flash_info Prototype
Syntax
int dcmi_get_device_flash_info (int card_id, int device_id, unsigned int flash_index, struct dm_flash_info_stru *pflash_info);
Function
This interface is used to obtain the information about the flash memory in the chip.
Parameter Description
Parameter |
Input/Output |
Type |
Description |
---|---|---|---|
card_id |
Input |
int |
ID of the Atlas 300T training card (model 9000). Query the supported IDs by referring to dcmi_get_card_num_list Prototype. |
device_id |
Input |
int |
Chip ID. The value is 0 (there is only one chip). Query the actually supported range by referring to dcmi_get_device_num_in_card Prototype. |
flash_index |
Input |
unsigned int |
Flash index. |
pflash_info |
Output |
dm_flash_info_stru * |
Flash information. The flash information struct is as follows: struct dm_flash_info_stru { unsigned long flash_id; /* combined device & manufacturer code */ unsigned short device_id; /* device id */ unsigned short vendor; /* the primary vendor id */ unsigned int state; /*flash health*/ unsigned long size; /* total size in bytes */ unsigned int sector_count; /* number of erase units */ unsigned short manufacturer_id; /* manufacturer id */ } |
Return Value
Type |
Description |
---|---|
int |
Results:
|
Exception Handling
N/A
Constraints
N/A
Calling Example
int i;
int ret = 0;
int card_id = 0x56;
int device_id = 0;
struct dm_flash_info_stru flash_info = {0};
unsigned int flash_count = 0;
ret = dcmi_get_device_flash_count(card_id, device_id,, &flash_count);
...
for (i = 0; i < flash_count; i++){
ret = dcmi_get_device_flash_info(card_id, device_id, i, &flash_info);
if(ret != 0) {
//todo: records logs
return ret;
}
...
}
...