Updated Readme example

pull/7774/head
Deepika 2017-07-24 11:19:36 -05:00
parent e2dbe1fae7
commit 38247b9987
1 changed files with 24 additions and 16 deletions

View File

@ -387,12 +387,20 @@ The following sample code illustrates how to use the sd-driver Block Device API:
printf("Init failed \n");
return -1;
}
printf("sd size: %llu\n", sd.size());
printf("sd read size: %llu\n", sd.get_read_size());
printf("sd program size: %llu\n", sd.get_program_size());
printf("sd erase size: %llu\n", sd.get_erase_size());
// set the frequency
if ( 0 != sd.frequency(5000000)) {
printf("Error setting frequency \n");
}
if ( 0 != sd.erase(0, sd.get_erase_size())) {
printf("Error Erasing block \n");
}
// Write some the data block to the device
if ( 0 == sd.program(block, 0, 512)) {
// read the data block from the device