driver-bf1.h 954 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright 2013 DI Andreas Auer
  3. *
  4. * This program is free software; you can redistribute it and/or modify it
  5. * under the terms of the GNU General Public License as published by the Free
  6. * Software Foundation; either version 3 of the License, or (at your option)
  7. * any later version. See COPYING for more details.
  8. *
  9. * Created on: 09.10.2013
  10. * Author: DI Andreas Auer
  11. * Mail: aauer1@gmail.com
  12. */
  13. #ifndef DRIVER_BF1_H_
  14. #define DRIVER_BF1_H_
  15. #define BF1_BAUD 115200
  16. struct BF1Identity
  17. {
  18. uint8_t version;
  19. char product[8];
  20. uint32_t serial;
  21. } __attribute__((packed));
  22. struct BF1State
  23. {
  24. uint8_t state;
  25. uint8_t switched;
  26. uint32_t nonce;
  27. } __attribute__((packed));
  28. struct BF1HashData
  29. {
  30. uint32_t golden_nonce;
  31. uint32_t nonce;
  32. };
  33. struct BF1Info
  34. {
  35. uint32_t baud;
  36. struct BF1Identity id;
  37. struct work *work;
  38. struct work *prev_work[2];
  39. char rx_buffer[1024];
  40. uint32_t rx_len;
  41. };
  42. #endif /* DRIVER_S6LX75_H_ */