driver-aan.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef BFG_DRIVER_AAN
  2. #define BFG_DRIVER_AAN
  3. #include <stdbool.h>
  4. #include <stdint.h>
  5. #include "lowl-spi.h"
  6. #include "miner.h"
  7. #define AAN_ALL_CHIPS 0
  8. #define AAN_MAX_JOBID 4
  9. struct aan_hooks {
  10. void (*precmd)(struct spi_port *);
  11. };
  12. struct aan_board_data {
  13. struct spi_port *spi;
  14. struct timeval tv_next_poll;
  15. struct cgpu_info *master_dev;
  16. // Master board only
  17. int queues_empty;
  18. };
  19. struct aan_chip_data {
  20. uint8_t chipid;
  21. int8_t last_jobid;
  22. struct work *works[AAN_MAX_JOBID];
  23. float desired_nonce_pdiff;
  24. float current_nonce_pdiff;
  25. };
  26. extern int aan_detect_spi(int *out_chipcount, struct spi_port * const *spi_a, int spi_n);
  27. extern bool aan_init(struct thr_info *);
  28. extern bool aan_queue_append(struct thr_info *, struct work *);
  29. extern void aan_queue_flush(struct thr_info *);
  30. extern void aan_poll(struct thr_info *);
  31. extern const char *aan_set_diff(struct cgpu_info *, const char *optname, const char *newvalue, char *replybuf, enum bfg_set_device_replytype *);
  32. extern const struct bfg_set_device_definition aan_set_device_funcs[];
  33. #endif