Modification into 17th July New display demo code

Dependencies:   SDFileSystem ds3231 eeprom_Nikita mbed testUniGraphic_150217

Fork of Ext_Demo_17July2017_newdis by SenseSemi

eeprom_pgm.cpp

Committer:
avp2417
Date:
2017-07-23
Revision:
34:8f6b0dc124e8
Parent:
24:d992ee8369f4

File content as of revision 34:8f6b0dc124e8:

#include "mbed.h"
#include "eeprom.h"
#include "eeprom_pgm.h"

#include <stdio.h> 
Serial ec(USBTX, USBRX); // tx, rx
EEPROM rom(PTC11, PTC10, 0x00, EEPROM::T24C32);
 
 
 

void eprom_write(uint32_t address, int32_t data) 
{
    rom.write(address ,data);           // write data into the address
 
}

void eprom_write_8(uint32_t address, int8_t data) 
{
    rom.write(address ,data);           // write data into the address
 
}

void eprom_write_16(uint32_t address, int16_t data) 
{
    rom.write(address ,data);           // write data into the address
 
}


int32_t eprom_read(uint32_t address)       // readng the data from the specified address
{
    int32_t rdata;                     // changed to int32_t
    rom.read(address, rdata);        
   // ec.printf("Read back value=%d\n", rdata);  
    return rdata;
}

int8_t eprom_read_8(uint32_t address)       // readng the data from the specified address
{
    int8_t rdata;                     // changed to int32_t
    rom.read(address, rdata);        
    //ec.printf("Read back value=%d\n", rdata);  
    return rdata;
}

int16_t eprom_read_16(uint32_t address)       // readng the data from the specified address
{
    int16_t rdata;                     // changed to int32_t
    rom.read(address, rdata);        
    //ec.printf("Read back value=%d\n", rdata);  
    return rdata;
}