requests.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * =====================================================================================
  3. *
  4. * ________ .__ __ ________ ____ ________
  5. * \_____ \ __ __|__| ____ | | __\______ \ _______ _/_ |/ _____/
  6. * / / \ \| | \ |/ ___\| |/ / | | \_/ __ \ \/ /| / __ \
  7. * / \_/. \ | / \ \___| < | ` \ ___/\ / | \ |__\ \
  8. * \_____\ \_/____/|__|\___ >__|_ \/_______ /\___ >\_/ |___|\_____ /
  9. * \__> \/ \/ \/ \/ \/
  10. *
  11. * www.optixx.org
  12. *
  13. *
  14. * Version: 1.0
  15. * Created: 07/21/2009 03:32:16 PM
  16. * Author: david@optixx.org
  17. *
  18. * =====================================================================================
  19. */
  20. #ifndef __REQUESTS_H__
  21. #define __REQUESTS_H__
  22. #define USB_UPLOAD_INIT 0
  23. #define USB_UPLOAD_ADDR 1
  24. #define USB_DOWNLOAD_INIT 2
  25. #define USB_DOWNLOAD_ADDR 3
  26. #define USB_CRC 4
  27. #define USB_CRC_ADDR 5
  28. #define USB_BULK_UPLOAD_INIT 6
  29. #define USB_BULK_UPLOAD_ADDR 7
  30. #define USB_BULK_UPLOAD_NEXT 8
  31. #define USB_BULK_UPLOAD_END 9
  32. #define USB_MODE_SNES 10
  33. #define USB_MODE_AVR 11
  34. #define USB_AVR_RESET 12
  35. #define USB_SET_LAODER 13
  36. typedef struct usb_transaction_t {
  37. uint32_t req_addr;
  38. uint32_t req_addr_end;
  39. uint8_t req_bank;
  40. uint32_t req_bank_size;
  41. uint16_t req_bank_cnt;
  42. uint8_t req_percent;
  43. uint8_t req_percent_last;
  44. uint8_t req_state;
  45. uint8_t rx_remaining;
  46. uint8_t tx_remaining;
  47. uint16_t sync_errors;
  48. uint8_t tx_buffer[32];
  49. uint8_t rx_buffer[8];
  50. uint8_t loader_enabled;
  51. } usb_transaction_t;
  52. #endif /* __REQUESTS_H_INCLUDED__ */