int libmem_erase uint8_t *  start,
size_t  size,
uint8_t **  erase_start,
size_t *  erase_size
 

Erase a block of memory using a LIBMEM driver.

Parameters:
start   A pointer to the start address of the memory range to erase.
size   The size of the memory range to erase in bytes.
erase_start   A pointer to a location in memory to store a pointer to the start of the memory range that has actually been erased or NULL if not required.
erase_size   A pointer to a location in memory to store the size in bytes of the memory range that has actually been erased or NULL if not required.
Returns:
The LIBMEM status result.
This function locates the LIBMEM driver for the address pointed to by start and then calls the LIBMEM driver's erase function.

Note that the address range being erased cannot span multiple LIBMEM drivers.

Example:

    uint8_t *erase_start;
    size_t erase_size;
    int res;

    res = libmem_erase((uint8_t *)0x10000000, 1024, &erase_start, &erase_size);

    if (res == LIBMEM_STATUS_SUCCESS)
      printf("libmem_erase : success (erased %08X - 0x%08X)\n", erase_start, erase_start + erase_size - 1);
    else
      printf("libmem_erase : failed (%d)\n", res);