Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed mbed-rtos SimpleDMA FreescaleIAP eeprom
Fork of CDMS_CODE_FM_28JAN2017 by
Flash.h
- Committer:
- chaithanyarss
- Date:
- 2016-07-08
- Revision:
- 248:407ab7e337cd
- Parent:
- 52:0bd68655c651
- Child:
- 249:1560c64adffb
File content as of revision 248:407ab7e337cd:
#include "FreescaleIAP.h"
int strt_add = flash_size() - (2*SECTOR_SIZE);
uint32_t flasharray[8];    //256+(3*1024)
/*corrected*/
int *nativeflash = (int*)strt_add;
/*Writing to the Flash*/
void FCTN_CDMS_WR_FLASH(uint16_t j,uint32_t fdata)  //j-position to write address  ; fdata - flash data to be written
{
    for(int i=0;i<8;i++)
    {
        flasharray[i]=nativeflash[i];
    }
    flasharray[j]=fdata;
    erase_sector(strt_add);
    program_flash(strt_add, (char*)flasharray,32);
}
/*End*/
/*Reading from Flash*/
uint32_t* FCTN_BAE_RD_FLASH()
{
    for(int i=0;i<8;i++)
    {
        flasharray[i]=nativeflash[i];
    }
    return flasharray;
}
/*End*/
            
    