testmode.h 909 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * testmode.h
  3. *
  4. * Greaseweazle test-mode command protocol. Subject to change!
  5. *
  6. * Written & released by Keir Fraser <keir.xen@gmail.com>
  7. *
  8. * This is free and unencumbered software released into the public domain.
  9. * See the file COPYING for more details, or visit <http://unlicense.org>.
  10. */
  11. #define CMD_option_bytes 0
  12. #define CMD_pins 1
  13. #define CMD_led 2
  14. #define CMD_test_headers 3
  15. #define CMD_wdat_osc_on 4
  16. #define CMD_wdat_osc_off 5
  17. /* CMD_test_headers return code in rsp.u.x[0] */
  18. #define TESTHEADER_success 100
  19. struct cmd {
  20. uint32_t cmd;
  21. union {
  22. uint8_t pins[64/8];
  23. uint32_t x[28/4];
  24. } u;
  25. };
  26. struct rsp {
  27. union {
  28. uint8_t opt[32];
  29. uint8_t pins[64/8];
  30. uint32_t x[32/4];
  31. } u;
  32. };
  33. /*
  34. * Local variables:
  35. * mode: C
  36. * c-file-style: "Linux"
  37. * c-basic-offset: 4
  38. * tab-width: 4
  39. * indent-tabs-mode: nil
  40. * End:
  41. */