libbitfury.h 891 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. struct bitfury_payload payload;
  24. struct bitfury_payload opayload;
  25. unsigned int results[16];
  26. int results_n;
  27. };
  28. int libbitfury_readHashData(unsigned int *res);
  29. extern void libbitfury_sendHashData1(struct bitfury_device *d, bool want_results);
  30. void libbitfury_sendHashData(struct bitfury_device *bf, int chip_n);
  31. void work_to_payload(struct bitfury_payload *p, struct work *w);
  32. #endif /* __LIBBITFURY_H__ */