Alberto Piganti / Mbed 2 deprecated blip_EEPROM

Dependencies:   mbed

Fork of M0_EEPROM_test by Suga koubou

main.cpp

Committer:
pighixxx
Date:
2015-11-30
Revision:
1:da7402308a49
Parent:
0:09bfe87fd66a

File content as of revision 1:da7402308a49:

// miniBLIP EEPROM demo
#include    "mbed.h"
#include    "IAP.h"

#define     MEM_SIZE        256
#define     TARGET_ADDRESS   64

IAP     iap;

int main() {
    char    mem[ MEM_SIZE ];  
    //Fill eeprom with data
    for ( int i = 0; i < MEM_SIZE; i++ )
        mem[ i ]    = i & 0xFF;
    //Write
    r   = iap.write_eeprom( mem, (char*)TARGET_ADDRESS, MEM_SIZE );
    //Read
    r   = iap.read_eeprom( (char*)TARGET_ADDRESS, mem, MEM_SIZE );

}