#include #include #include #include #include #include #include #include #define READ_SIZE 512 #define READ_BUF_LEN 2048 #define DEV_NAME "/sys/bus/spi/devices/spi0.0/fram" int main(int argc, char ** argv) { char read_buffer[READ_SIZE]={0,}; char *device = NULL; int i,j,k; unsigned int fd; unsigned int size; device = argv[1]; if(argc < 3) device = DEV_NAME; fd = open (device, O_RDWR); if(fd < 0) { fputs("Error \n",stderr); exit(1); } printf(" 0 1 2 3 4 5 6 7 8 9 A B C D E F"); for(i=0, k=0; i<4; i++) { size = read(fd, read_buffer, READ_SIZE); for(j=0; j