FRAM Dump Utility

Dependencies:   MB85RSxx_SPI mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "MB85RSxx_SPI.h"
00003 
00004  
00005 MB85RSxx_SPI fram(PC_12, PC_11, PC_10, PD_2);
00006 
00007 int main() {
00008     char r_data=0;
00009     int addr, cnt1, idx1;
00010     
00011     printf("\nFRAM Dump Utility\n");
00012     fram.Init();
00013       
00014     printf("\n*** FRAM Read Operation ***\n");
00015     printf("Address      :00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F\n");
00016     addr=0;
00017     
00018     // You can change loop count. 
00019     for(idx1=0; idx1 < 10; idx1++)
00020     {
00021         printf("Address %04d :", idx1*10);
00022         for(cnt1=0; cnt1< 16;cnt1++)
00023         {
00024             //wait_us(5);
00025             r_data = fram.read(addr);
00026             printf("%02X ", r_data);
00027             addr++;
00028         }
00029         printf("\n");
00030     }
00031     printf("FRAM Dump Done\n");
00032 }