|
Register a LIBMEM driver for a 16 bit SST39xFx00A FLASH chip.
-
Parameters:
-
|
h
|
A pointer to the LIBMEM handle structure to use for this LIBMEM driver. |
|
start
|
The start address of the FLASH memory. |
|
size
|
The size of the FLASH memory. |
|
geometry
|
A NULL terminated description of the FLASH's geometry. |
|
flash_info
|
A pointer to the FLASH information structure or NULL if not required. |
-
Returns:
- The LIBMEM status result.
Example:
libmem_driver_handle_t flash1_handle;
uint8_t *flash1_start = (uint8_t *)0x10000000;
libmem_flash_info_t flash1_info;
const int flash1_max_geometry_regions = 4;
libmem_geometry_t flash1_geometry[flash1_max_geometry_regions];
size_t size;
int res;
res = libmem_cfi_get_info(flash1_start, &size, flash1_geometry, flash1_max_geometry_regions, &flash1_info);
if (res == LIBMEM_STATUS_SUCCESS)
{
res = libmem_register_sst39xFx00A_16_driver(&flash1_handle, flash1_start, size, flash1_geometry, &flash1_info)
if (res == LIBMEM_STATUS_SUCCESS)
printf("libmem_register_sst39xFx00A_16_driver : success\n");
else
printf("libmem_register_sst39xFx00A_16_driver : failed (%d)\n", res);
}
else
printf("libmem_cfi_get_info : failed (%d)\n", res);
|
|