/****************************************************/
/*                                                  */
/* 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>

/* pulse the reset register */

int main()
{
 ROCKH_id rock_id;
 int err;

 /* 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;
   }

 /* reset the ROCK */
 err = rockh_write_reset(rock_id,0);
 if (err!=ROCKH_ERROR_OK)
   {
     printf("Error writing ROCK!: %s",ErrorGetMessage());
     return 1;
   }
 
 wait(1000); /* wait 1 sec */

 err = rockh_write_reset(rock_id,0xff);
 if (err!=ROCKH_ERROR_OK)
   {
     printf("Error writing ROCK!: %s",ErrorGetMessage());
     return 1;
   }

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

}