/****************************************************/
/*                                                  */
/* This is an example of use of the rockhard module */
/*                                                  */
/* Some parts are missing, so do not compile it!    */
/*                                                  */
/****************************************************/

#include <Error.h>
#include <rockhard.h>

/* read the fifo register and write it in a file */

int main()
{
 ROCKH_id rock_id;
 int err;
 unsigned char afifo;

 /* open the rock */
 
 err = rockh_open(0x50010000,0x100000,0x09,0,&rock_id);
 if (err!=ROCKH_ERROR_OK)
   {
     printf("Error opening ROCK!: %s",ErrorGetMessage());
     return 1;
   }

 /* read the ROCK */
 for (i=0; i<100; i++)
   {
     afifo = rockh_read_fifo(rock_id);

     fprintf(outfile,"%x\n",afifo);

     wait(1000); /* wait a sec */
   }

 /* close the rock */
 rockh_close(rock_id);

}