Content originally posted in LPCWare by researchinnovation on Mon Jun 25 05:05:49 MST 2012
Hi...!!!
This is working.....!!!
#ifdef __USE_CMSIS
#include "LPC11xx.h"
#endif
#include <cr_section_macros.h>
#include <NXP/crp.h>
#include "filehandler.h"
#include "filehandlerconfig.h"
#include <stdio.h>
__CRP const unsigned int CRP_WORD = CRP_NO_CRP ;
extern uint8_t I2CMasterBuffer[BUFSIZE];
int main(void) {
int j=0;
FILE *fh;
ErrCode Err = ERR_OK;
Err = InitialiseI2C();
fh=fopen(FILENAME, FILEOPENMODE);
while (!feof(fh))
{
fread(&I2CMasterBuffer[2],1,BUFSIZE-2, fh);
printf("\n In main reading from file \t\t\t\t:: %s\n",&I2CMasterBuffer[2]);
Err = TxI2C();
for(j=0;j<BUFSIZE-2;j++)
I2CMasterBuffer[j+2]=0;
}
fclose(fh);
return 0 ;
}
Thanks & Regards.....:)