libbitfury.h 988 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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. int chip;
  17. unsigned char osc[8];
  18. unsigned newbuf[17];
  19. unsigned oldbuf[17];
  20. struct work * work;
  21. struct work * owork;
  22. int job_switched;
  23. uint32_t atrvec[20];
  24. struct bitfury_payload payload;
  25. struct bitfury_payload opayload;
  26. unsigned int results[16];
  27. int results_n;
  28. };
  29. int libbitfury_readHashData(unsigned int *res);
  30. extern void libbitfury_sendHashData1(struct bitfury_device *d, bool want_results);
  31. void libbitfury_sendHashData(struct bitfury_device *bf, int chip_n);
  32. void work_to_payload(struct bitfury_payload *p, struct work *w);
  33. extern void payload_to_atrvec(uint32_t *atrvec, struct bitfury_payload *);
  34. #endif /* __LIBBITFURY_H__ */