libbitfury.h 797 B

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef __LIBBITFURY_H__
  2. #define __LIBBITFURY_H__
  3. #include "miner.h"
  4. #include "spidevc.h"
  5. extern int libbitfury_detectChips(struct spi_port *);
  6. struct bitfury_payload {
  7. unsigned char midstate[32];
  8. unsigned int junk[8];
  9. unsigned m7;
  10. unsigned ntime;
  11. unsigned nbits;
  12. unsigned nnonce;
  13. };
  14. struct bitfury_device {
  15. struct spi_port *spi;
  16. unsigned char osc[8];
  17. unsigned newbuf[17];
  18. unsigned oldbuf[17];
  19. struct work * work;
  20. struct work * owork;
  21. int job_switched;
  22. struct bitfury_payload payload;
  23. struct bitfury_payload opayload;
  24. unsigned int results[16];
  25. int results_n;
  26. };
  27. int libbitfury_readHashData(unsigned int *res);
  28. void libbitfury_sendHashData(struct bitfury_device *bf, int chip_n);
  29. void work_to_payload(struct bitfury_payload *p, struct work *w);
  30. #endif /* __LIBBITFURY_H__ */