6.8.2. C source file containing the Flash-specific C functions

Example 6.2 shows a template C source file for defining your Flash-specific C functions.

Example 6.2. myflash.c

#include "flash.h"

/******************************
 * Initialise the Flash device
 ******************************/
UINT32 RVDFlash_Init(UINT32 base_of_flash)
{
    // Place your initialization code here

    return 0;      // success
}


/******************************
 * Erase the Flash memory
 ******************************/
UINT32 RVDFLASH_Erase(UINT32 base_address,
                      UINT32 block_count,
                      UINT32 block_size)
{
    // Place your flash erase code here

    return 0;      // success
}


/******************************
 * Write to the Flash memory
 ******************************/
UINT32 RVDFLASH_Write(UINT32 base_address,
                      UINT32 byte_count,
                      UINT32 block_offset,
                      UINT32 from_buffer,
                      UINT32 verify)
{
    // Place your flash write code here

    return 0;      // success
}


/******************************
 * Validate the Flash memory
 ******************************/
UINT32 RVDFLASH_Validate(UINT32 base_address,
                         UINT32 byte_count,
                         UINT32 block_offset,
                         UINT32 from_buffer)
{
    // Place your flash validate code here

    return 0;      // success
}

See also

Copyright © 2002-2011 ARM. All rights reserved.ARM DUI 0182N
Non-ConfidentialID052111