comm.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Linux driver for TerraTec DMX 6Fire USB
  3. *
  4. * Author: Torsten Schenk <torsten.schenk@zoho.com>
  5. * Created: Jan 01, 2011
  6. * Copyright: (C) Torsten Schenk
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. */
  13. #ifndef USB6FIRE_COMM_H
  14. #define USB6FIRE_COMM_H
  15. #include "common.h"
  16. enum /* settings for comm */
  17. {
  18. COMM_RECEIVER_BUFSIZE = 64,
  19. };
  20. struct comm_runtime {
  21. struct sfire_chip *chip;
  22. struct urb receiver;
  23. u8 *receiver_buffer;
  24. u8 serial; /* urb serial */
  25. void (*init_urb)(struct comm_runtime *rt, struct urb *urb, u8 *buffer,
  26. void *context, void(*handler)(struct urb *urb));
  27. /* writes control data to the device */
  28. int (*write8)(struct comm_runtime *rt, u8 request, u8 reg, u8 value);
  29. int (*write16)(struct comm_runtime *rt, u8 request, u8 reg,
  30. u8 vh, u8 vl);
  31. };
  32. int usb6fire_comm_init(struct sfire_chip *chip);
  33. void usb6fire_comm_abort(struct sfire_chip *chip);
  34. void usb6fire_comm_destroy(struct sfire_chip *chip);
  35. #endif /* USB6FIRE_COMM_H */