libbitfury.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /**
  2. * libbitfury.h - headers for Bitfury chip/board library
  3. *
  4. * Copyright (c) 2013 bitfury
  5. * Copyright (c) 2013 legkodymov
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. *
  11. * This program is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, see http://www.gnu.org/licenses/.
  18. **/
  19. #ifndef __LIBBITFURY_H__
  20. #define __LIBBITFURY_H__
  21. #include "miner.h"
  22. extern int libbitfury_detectChips(void);
  23. struct bitfury_payload {
  24. unsigned char midstate[32];
  25. unsigned int junk[8];
  26. unsigned m7;
  27. unsigned ntime;
  28. unsigned nbits;
  29. unsigned nnonce;
  30. };
  31. struct bitfury_device {
  32. unsigned char osc[8];
  33. unsigned newbuf[17];
  34. unsigned oldbuf[17];
  35. struct work * work;
  36. struct work * owork;
  37. int job_switched;
  38. struct bitfury_payload payload;
  39. struct bitfury_payload opayload;
  40. unsigned int results[16];
  41. int results_n;
  42. };
  43. int libbitfury_readHashData(unsigned int *res);
  44. int libbitfury_sendHashData(struct bitfury_device *bf, int chip_n);
  45. void work_to_payload(struct bitfury_payload *p, struct work *w);
  46. #endif /* __LIBBITFURY_H__ */