gc3355.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright 2014 Nate Woolls
  3. * Copyright 2014 GridSeed Team
  4. * Copyright 2014 Dualminer Team
  5. * Copyright 2014 Luke Dashjr
  6. *
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License as published by the Free
  9. * Software Foundation; either version 3 of the License, or (at your option)
  10. * any later version. See COPYING for more details.
  11. */
  12. #ifndef bfgminer_gc3355_h
  13. #define bfgminer_gc3355_h
  14. #include <stdbool.h>
  15. #include <stdint.h>
  16. #include "miner.h"
  17. // options configurable by the end-user
  18. extern int opt_sha2_units;
  19. extern
  20. int opt_pll_freq;
  21. // GridSeed common code begins here
  22. #define GC3355_ORB_DEFAULT_CHIPS 5
  23. #define GC3355_BLADE_DEFAULT_CHIPS 40
  24. #define GC3355_READ_SIZE 12
  25. struct gc3355_info
  26. {
  27. uint16_t freq;
  28. unsigned chips;
  29. };
  30. #define gc3355_open(path) serial_open(path, 115200, 1, true)
  31. #define gc3355_close(fd) serial_close(fd)
  32. extern ssize_t gc3355_read(int fd, char *buf, size_t size);
  33. extern ssize_t gc3355_write(int fd, const void * const buf, const size_t size);
  34. extern void gc3355_init_miner(int fd, int pll_freq);
  35. extern void gc3355_init_dualminer(int fd, int pll_freq, bool scrypt_only, bool detect_only);
  36. extern void gc3355_scrypt_reset(int fd);
  37. extern void gc3355_scrypt_only_reset(int fd);
  38. extern void gc3355_scrypt_prepare_work(unsigned char cmd[156], struct work *);
  39. extern void gc3355_sha2_prepare_work(unsigned char cmd[52], struct work *);
  40. extern int64_t gc3355_get_firmware_version(int fd);
  41. extern void gc3355_set_pll_freq(int fd, int pll_freq);
  42. #define gc3355_get_cts_status(fd) ((get_serial_cts(fd) == BGV_LOW) ? 1 : 0)
  43. #endif